Trendsic Platform Service

<back to all web services

UploadRfpAttachment

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
POST/v1/project/rfp/attachment
import 'package:servicestack/servicestack.dart';

class UploadAttachmentResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    String? AttachmentId;
    int? ProjectId;
    String? FileType;
    String? FileName;
    String? ContentType;
    int? ContentLength;
    DateTime? CreatedUtc;

    UploadAttachmentResponse({this.ResponseStatus,this.AttachmentId,this.ProjectId,this.FileType,this.FileName,this.ContentType,this.ContentLength,this.CreatedUtc});
    UploadAttachmentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        AttachmentId = json['AttachmentId'];
        ProjectId = json['ProjectId'];
        FileType = json['FileType'];
        FileName = json['FileName'];
        ContentType = json['ContentType'];
        ContentLength = json['ContentLength'];
        CreatedUtc = JsonConverters.fromJson(json['CreatedUtc'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'AttachmentId': AttachmentId,
        'ProjectId': ProjectId,
        'FileType': FileType,
        'FileName': FileName,
        'ContentType': ContentType,
        'ContentLength': ContentLength,
        'CreatedUtc': JsonConverters.toJson(CreatedUtc,'DateTime',context!)
    };

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

class HttpFile implements IConvertible
{
    String? Name;
    String? FileName;
    int? ContentLength;
    String? ContentType;
    Uint8List? InputStream;

    HttpFile({this.Name,this.FileName,this.ContentLength,this.ContentType,this.InputStream});
    HttpFile.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Name = json['Name'];
        FileName = json['FileName'];
        ContentLength = json['ContentLength'];
        ContentType = json['ContentType'];
        InputStream = JsonConverters.fromJson(json['InputStream'],'Uint8List',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'FileName': FileName,
        'ContentLength': ContentLength,
        'ContentType': ContentType,
        'InputStream': JsonConverters.toJson(InputStream,'Uint8List',context!)
    };

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

class UploadRfpAttachment implements IConvertible
{
    HttpFile? File;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'UploadAttachmentResponse': TypeInfo(TypeOf.Class, create:() => UploadAttachmentResponse()),
    'HttpFile': TypeInfo(TypeOf.Class, create:() => HttpFile()),
    'Uint8List': TypeInfo(TypeOf.Class, create:() => Uint8List(0)),
    'UploadRfpAttachment': TypeInfo(TypeOf.Class, create:() => UploadRfpAttachment()),
});

Dart UploadRfpAttachment DTOs

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

HTTP + CSV

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

POST /v1/project/rfp/attachment HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"File":{"Name":"String","FileName":"String","ContentLength":0,"ContentType":"String"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"AttachmentId":"String","ProjectId":0,"FileType":"String","FileName":"String","ContentType":"String","ContentLength":0,"CreatedUtc":"0001-01-01T00:00:00.0000000"}