digitaluapi

<back to all web services

Files

Requires Authentication
Requires any of the roles:Client, Admin, Partner
The following routes are available for this service:
All Verbs/restfiles/files
All Verbs/restfiles/files/{Path*}
import 'package:servicestack/servicestack.dart';
import 'dart:collection';

class Files implements IConvertible
{
    String? Path;
    String? TextContents;
    bool? ForDownload;

    Files({this.Path,this.TextContents,this.ForDownload});
    Files.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Path = json['Path'];
        TextContents = json['TextContents'];
        ForDownload = json['ForDownload'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Path': Path,
        'TextContents': TextContents,
        'ForDownload': ForDownload
    };

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

class Folder implements IConvertible
{
    String? Name;
    DateTime? ModifiedDate;
    int? FileCount;

    Folder({this.Name,this.ModifiedDate,this.FileCount});
    Folder.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Name = json['Name'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        FileCount = json['FileCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'FileCount': FileCount
    };

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

class File implements IConvertible
{
    String? Name;
    String? Extension;
    int? FileSizeBytes;
    DateTime? ModifiedDate;
    bool? IsTextFile;

    File({this.Name,this.Extension,this.FileSizeBytes,this.ModifiedDate,this.IsTextFile});
    File.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Name = json['Name'];
        Extension = json['Extension'];
        FileSizeBytes = json['FileSizeBytes'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        IsTextFile = json['IsTextFile'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'Extension': Extension,
        'FileSizeBytes': FileSizeBytes,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'IsTextFile': IsTextFile
    };

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

class FolderResult implements IConvertible
{
    List<Folder>? Folders;
    List<File>? Files;

    FolderResult({this.Folders,this.Files});
    FolderResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Folders': JsonConverters.toJson(Folders,'List<Folder>',context!),
        'Files': JsonConverters.toJson(Files,'List<File>',context!)
    };

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

class FileResult implements IConvertible
{
    String? Name;
    String? Extension;
    int? FileSizeBytes;
    DateTime? ModifiedDate;
    bool? IsTextFile;
    String? Contents;

    FileResult({this.Name,this.Extension,this.FileSizeBytes,this.ModifiedDate,this.IsTextFile,this.Contents});
    FileResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Name = json['Name'];
        Extension = json['Extension'];
        FileSizeBytes = json['FileSizeBytes'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        IsTextFile = json['IsTextFile'];
        Contents = json['Contents'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'Extension': Extension,
        'FileSizeBytes': FileSizeBytes,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'IsTextFile': IsTextFile,
        'Contents': Contents
    };

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

class FilesResponse implements IConvertible
{
    FolderResult? Directory;
    FileResult? File;
    ResponseStatus? ResponseStatus;

    FilesResponse({this.Directory,this.File,this.ResponseStatus});
    FilesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Directory = JsonConverters.fromJson(json['Directory'],'FolderResult',context!);
        File = JsonConverters.fromJson(json['File'],'FileResult',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Directory': JsonConverters.toJson(Directory,'FolderResult',context!),
        'File': JsonConverters.toJson(File,'FileResult',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'duengageapi.uat.scadsoftware.com', types: <String, TypeInfo> {
    'Files': TypeInfo(TypeOf.Class, create:() => Files()),
    'Folder': TypeInfo(TypeOf.Class, create:() => Folder()),
    'File': TypeInfo(TypeOf.Class, create:() => File()),
    'FolderResult': TypeInfo(TypeOf.Class, create:() => FolderResult()),
    'List<Folder>': TypeInfo(TypeOf.Class, create:() => <Folder>[]),
    'List<File>': TypeInfo(TypeOf.Class, create:() => <File>[]),
    'FileResult': TypeInfo(TypeOf.Class, create:() => FileResult()),
    'FilesResponse': TypeInfo(TypeOf.Class, create:() => FilesResponse()),
});

Dart Files 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.

POST /restfiles/files HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<Files xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceInterface">
  <ForDownload>false</ForDownload>
  <Path>String</Path>
  <TextContents>String</TextContents>
</Files>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FilesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceInterface">
  <Directory>
    <Files>
      <File>
        <Extension>String</Extension>
        <FileSizeBytes>0</FileSizeBytes>
        <IsTextFile>false</IsTextFile>
        <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
        <Name>String</Name>
      </File>
    </Files>
    <Folders>
      <Folder>
        <FileCount>0</FileCount>
        <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
        <Name>String</Name>
      </Folder>
    </Folders>
  </Directory>
  <File>
    <Contents>String</Contents>
    <Extension>String</Extension>
    <FileSizeBytes>0</FileSizeBytes>
    <IsTextFile>false</IsTextFile>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
  </File>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</FilesResponse>