Evo Voice

<back to all web services

GetMyFiles

Gets the files associated with the authenticated user

Requires Authentication
Required role:User
The following routes are available for this service:
GET/app/files
import 'package:servicestack/servicestack.dart';

abstract class EntityInfo
{
    /**
    * The ID of the object
    */
    // @ApiMember(Description="The ID of the object")
    String? id;

    /**
    * The date the object was created
    */
    // @ApiMember(Description="The date the object was created")
    String? dateCreated;

    /**
    * The date the object was last modified
    */
    // @ApiMember(Description="The date the object was last modified")
    String? dateLastModified;

    /**
    * The user that created this object
    */
    // @ApiMember(Description="The user that created this object")
    String? createdBy;

    /**
    * The user that last modified this object
    */
    // @ApiMember(Description="The user that last modified this object")
    String? lastModifiedBy;

    EntityInfo({this.id,this.dateCreated,this.dateLastModified,this.createdBy,this.lastModifiedBy});
    EntityInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        dateCreated = json['dateCreated'];
        dateLastModified = json['dateLastModified'];
        createdBy = json['createdBy'];
        lastModifiedBy = json['lastModifiedBy'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'dateCreated': dateCreated,
        'dateLastModified': dateLastModified,
        'createdBy': createdBy,
        'lastModifiedBy': lastModifiedBy
    };

    getTypeName() => "EntityInfo";
    TypeContext? context = _ctx;
}

enum FileTypes
{
    Upload,
    VoiceMessage,
    CallRecording,
    Fax,
    Attachment,
    FaxOutgoing,
}

class CustomerBreadcrumb implements IConvertible
{
    String? id;
    String? name;

    CustomerBreadcrumb({this.id,this.name});
    CustomerBreadcrumb.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name
    };

    getTypeName() => "CustomerBreadcrumb";
    TypeContext? context = _ctx;
}

class FileInfo extends EntityInfo implements IConvertible
{
    /**
    * The type of file this is
    */
    // @ApiMember(Description="The type of file this is")
    FileTypes? type;

    /**
    * The account ID this file is associated with
    */
    // @ApiMember(Description="The account ID this file is associated with")
    String? accountId;

    /**
    * The name of the account this file is associated with
    */
    // @ApiMember(Description="The name of the account this file is associated with")
    String? accountName;

    /**
    * The ID of the customer this file is associated with
    */
    // @ApiMember(Description="The ID of the customer this file is associated with")
    String? customerId;

    /**
    * The name of the customer this file is associated with
    */
    // @ApiMember(Description="The name of the customer this file is associated with")
    String? customerName;

    /**
    * The breadcrumb to the customer for this file
    */
    // @ApiMember(Description="The breadcrumb to the customer for this file")
    List<CustomerBreadcrumb>? customerBreadcrumb;

    /**
    * The ID of the user this file is assocaited with
    */
    // @ApiMember(Description="The ID of the user this file is assocaited with")
    String? userId;

    /**
    * The name of the user this file is associated with
    */
    // @ApiMember(Description="The name of the user this file is associated with")
    String? userName;

    /**
    * The original file name for the file
    */
    // @ApiMember(Description="The original file name for the file")
    String? fileName;

    /**
    * The URI of the file
    */
    // @ApiMember(Description="The URI of the file")
    String? uri;

    /**
    * The Content type of the file
    */
    // @ApiMember(Description="The Content type of the file")
    String? contentType;

    /**
    * The size of the file
    */
    // @ApiMember(Description="The size of the file")
    int? contentLength;

    /**
    * The Twilio ID of the recording
    */
    // @ApiMember(Description="The Twilio ID of the recording")
    String? recordingSid;

    /**
    * The duration of the recording in seconds
    */
    // @ApiMember(Description="The duration of the recording in seconds")
    int? recordingDuration;

    /**
    * Who is the recording from?
    */
    // @ApiMember(Description="Who is the recording from?")
    String? recordingFrom;

    /**
    * Transcription (if available)
    */
    // @ApiMember(Description="Transcription (if available)")
    String? transcription;

    /**
    * From Address (e.g. caller ID) for incoming calls
    */
    // @ApiMember(Description="From Address (e.g. caller ID) for incoming calls")
    String? fromAddress;

    /**
    * To Address (e.g. dialed number) for outgoing calls
    */
    // @ApiMember(Description="To Address (e.g. dialed number) for outgoing calls")
    String? toAddress;

    FileInfo({this.type,this.accountId,this.accountName,this.customerId,this.customerName,this.customerBreadcrumb,this.userId,this.userName,this.fileName,this.uri,this.contentType,this.contentLength,this.recordingSid,this.recordingDuration,this.recordingFrom,this.transcription,this.fromAddress,this.toAddress});
    FileInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        type = JsonConverters.fromJson(json['type'],'FileTypes',context!);
        accountId = json['accountId'];
        accountName = json['accountName'];
        customerId = json['customerId'];
        customerName = json['customerName'];
        customerBreadcrumb = JsonConverters.fromJson(json['customerBreadcrumb'],'List<CustomerBreadcrumb>',context!);
        userId = json['userId'];
        userName = json['userName'];
        fileName = json['fileName'];
        uri = json['uri'];
        contentType = json['contentType'];
        contentLength = json['contentLength'];
        recordingSid = json['recordingSid'];
        recordingDuration = json['recordingDuration'];
        recordingFrom = json['recordingFrom'];
        transcription = json['transcription'];
        fromAddress = json['fromAddress'];
        toAddress = json['toAddress'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'type': JsonConverters.toJson(type,'FileTypes',context!),
        'accountId': accountId,
        'accountName': accountName,
        'customerId': customerId,
        'customerName': customerName,
        'customerBreadcrumb': JsonConverters.toJson(customerBreadcrumb,'List<CustomerBreadcrumb>',context!),
        'userId': userId,
        'userName': userName,
        'fileName': fileName,
        'uri': uri,
        'contentType': contentType,
        'contentLength': contentLength,
        'recordingSid': recordingSid,
        'recordingDuration': recordingDuration,
        'recordingFrom': recordingFrom,
        'transcription': transcription,
        'fromAddress': fromAddress,
        'toAddress': toAddress
    });

    getTypeName() => "FileInfo";
    TypeContext? context = _ctx;
}

class GetMyFilesResponse implements IConvertible
{
    List<FileInfo>? files;

    GetMyFilesResponse({this.files});
    GetMyFilesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        files = JsonConverters.fromJson(json['files'],'List<FileInfo>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'files': JsonConverters.toJson(files,'List<FileInfo>',context!)
    };

    getTypeName() => "GetMyFilesResponse";
    TypeContext? context = _ctx;
}

/**
* Gets the files associated with the authenticated user
*/
// @Api(Description="Gets the files associated with the authenticated user")
class GetMyFiles implements IPost, IConvertible
{
    /**
    * Filter by type
    */
    // @ApiMember(Description="Filter by type")
    List<FileTypes>? fileTypes;

    GetMyFiles({this.fileTypes});
    GetMyFiles.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        fileTypes = JsonConverters.fromJson(json['fileTypes'],'List<FileTypes>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'fileTypes': JsonConverters.toJson(fileTypes,'List<FileTypes>',context!)
    };

    getTypeName() => "GetMyFiles";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
    'EntityInfo': TypeInfo(TypeOf.AbstractClass),
    'FileTypes': TypeInfo(TypeOf.Enum, enumValues:FileTypes.values),
    'CustomerBreadcrumb': TypeInfo(TypeOf.Class, create:() => CustomerBreadcrumb()),
    'FileInfo': TypeInfo(TypeOf.Class, create:() => FileInfo()),
    'List<CustomerBreadcrumb>': TypeInfo(TypeOf.Class, create:() => <CustomerBreadcrumb>[]),
    'GetMyFilesResponse': TypeInfo(TypeOf.Class, create:() => GetMyFilesResponse()),
    'List<FileInfo>': TypeInfo(TypeOf.Class, create:() => <FileInfo>[]),
    'GetMyFiles': TypeInfo(TypeOf.Class, create:() => GetMyFiles()),
    'List<FileTypes>': TypeInfo(TypeOf.Class, create:() => <FileTypes>[]),
});

Dart GetMyFiles DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /app/files HTTP/1.1 
Host: evovoice.io 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetMyFilesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.App">
  <Files xmlns:d2p1="http://schemas.datacontract.org/2004/07/Voice.Api.Files">
    <d2p1:FileInfo>
      <CreatedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</CreatedBy>
      <DateCreated xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateCreated>
      <DateLastModified xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateLastModified>
      <Id xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</Id>
      <LastModifiedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</LastModifiedBy>
      <d2p1:AccountId>String</d2p1:AccountId>
      <d2p1:AccountName>String</d2p1:AccountName>
      <d2p1:ContentLength>0</d2p1:ContentLength>
      <d2p1:ContentType>String</d2p1:ContentType>
      <d2p1:CustomerBreadcrumb xmlns:d4p1="http://schemas.datacontract.org/2004/07/Voice.Api.Customers">
        <d4p1:CustomerBreadcrumb>
          <d4p1:Id>String</d4p1:Id>
          <d4p1:Name>String</d4p1:Name>
        </d4p1:CustomerBreadcrumb>
      </d2p1:CustomerBreadcrumb>
      <d2p1:CustomerId>String</d2p1:CustomerId>
      <d2p1:CustomerName>String</d2p1:CustomerName>
      <d2p1:FileName>String</d2p1:FileName>
      <d2p1:FromAddress>String</d2p1:FromAddress>
      <d2p1:RecordingDuration>0</d2p1:RecordingDuration>
      <d2p1:RecordingFrom>String</d2p1:RecordingFrom>
      <d2p1:RecordingSid>String</d2p1:RecordingSid>
      <d2p1:ToAddress>String</d2p1:ToAddress>
      <d2p1:Transcription>String</d2p1:Transcription>
      <d2p1:Type>Upload</d2p1:Type>
      <d2p1:Uri>String</d2p1:Uri>
      <d2p1:UserId>String</d2p1:UserId>
      <d2p1:UserName>String</d2p1:UserName>
    </d2p1:FileInfo>
  </Files>
</GetMyFilesResponse>