Trendsic Platform Service

<back to all web services

AttachmentVersionRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,POST,OPTIONS/v1/AttachmentVersion/{AttachmentId}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class AttachmentVersion implements IConvertible
{
    int? AttachmentVersionId;
    String? AttachmentId;
    int? VersionNo;
    String? AttachmentName;
    String? MimeType;
    double? FileSizeInKB;
    String? AWSKey;
    String? RevisionLabel;
    String? Notes;
    int? RestoredFromVersionNo;
    String? UploadedBy;
    DateTime? UploadedAt;
    bool? IsCurrent;
    String? DownloadUrl;

    AttachmentVersion({this.AttachmentVersionId,this.AttachmentId,this.VersionNo,this.AttachmentName,this.MimeType,this.FileSizeInKB,this.AWSKey,this.RevisionLabel,this.Notes,this.RestoredFromVersionNo,this.UploadedBy,this.UploadedAt,this.IsCurrent,this.DownloadUrl});
    AttachmentVersion.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AttachmentVersionId = json['AttachmentVersionId'];
        AttachmentId = json['AttachmentId'];
        VersionNo = json['VersionNo'];
        AttachmentName = json['AttachmentName'];
        MimeType = json['MimeType'];
        FileSizeInKB = JsonConverters.toDouble(json['FileSizeInKB']);
        AWSKey = json['AWSKey'];
        RevisionLabel = json['RevisionLabel'];
        Notes = json['Notes'];
        RestoredFromVersionNo = json['RestoredFromVersionNo'];
        UploadedBy = json['UploadedBy'];
        UploadedAt = JsonConverters.fromJson(json['UploadedAt'],'DateTime',context!);
        IsCurrent = json['IsCurrent'];
        DownloadUrl = json['DownloadUrl'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AttachmentVersionId': AttachmentVersionId,
        'AttachmentId': AttachmentId,
        'VersionNo': VersionNo,
        'AttachmentName': AttachmentName,
        'MimeType': MimeType,
        'FileSizeInKB': FileSizeInKB,
        'AWSKey': AWSKey,
        'RevisionLabel': RevisionLabel,
        'Notes': Notes,
        'RestoredFromVersionNo': RestoredFromVersionNo,
        'UploadedBy': UploadedBy,
        'UploadedAt': JsonConverters.toJson(UploadedAt,'DateTime',context!),
        'IsCurrent': IsCurrent,
        'DownloadUrl': DownloadUrl
    };

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

class Attachment implements IConvertible
{
    String? AttachmentId;
    String? TableName;
    String? FieldName;
    int? RecordId;
    String? AttachmentName;
    String? MimeType;
    Uint8List? AttachmentData = [];
    double? FileSizeInKB;
    DateTime? CreatedDate;
    String? CreatedBy;
    bool? NeedsOCR;
    DateTime? OCRDate;
    bool? IsSecurities;
    String? AWSKey;
    String? PresignedUrl;

    Attachment({this.AttachmentId,this.TableName,this.FieldName,this.RecordId,this.AttachmentName,this.MimeType,this.AttachmentData,this.FileSizeInKB,this.CreatedDate,this.CreatedBy,this.NeedsOCR,this.OCRDate,this.IsSecurities,this.AWSKey,this.PresignedUrl});
    Attachment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AttachmentId = json['AttachmentId'];
        TableName = json['TableName'];
        FieldName = json['FieldName'];
        RecordId = json['RecordId'];
        AttachmentName = json['AttachmentName'];
        MimeType = json['MimeType'];
        AttachmentData = JsonConverters.fromJson(json['AttachmentData'],'Uint8List',context!);
        FileSizeInKB = JsonConverters.toDouble(json['FileSizeInKB']);
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        CreatedBy = json['CreatedBy'];
        NeedsOCR = json['NeedsOCR'];
        OCRDate = JsonConverters.fromJson(json['OCRDate'],'DateTime',context!);
        IsSecurities = json['IsSecurities'];
        AWSKey = json['AWSKey'];
        PresignedUrl = json['PresignedUrl'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AttachmentId': AttachmentId,
        'TableName': TableName,
        'FieldName': FieldName,
        'RecordId': RecordId,
        'AttachmentName': AttachmentName,
        'MimeType': MimeType,
        'AttachmentData': JsonConverters.toJson(AttachmentData,'Uint8List',context!),
        'FileSizeInKB': FileSizeInKB,
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
        'CreatedBy': CreatedBy,
        'NeedsOCR': NeedsOCR,
        'OCRDate': JsonConverters.toJson(OCRDate,'DateTime',context!),
        'IsSecurities': IsSecurities,
        'AWSKey': AWSKey,
        'PresignedUrl': PresignedUrl
    };

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

class AttachmentVersionResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    String? AttachmentId;
    List<AttachmentVersion>? Versions = [];
    int? CurrentVersionNo;
    Attachment? Head;

    AttachmentVersionResponse({this.ResponseStatus,this.AttachmentId,this.Versions,this.CurrentVersionNo,this.Head});
    AttachmentVersionResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        AttachmentId = json['AttachmentId'];
        Versions = JsonConverters.fromJson(json['Versions'],'List<AttachmentVersion>',context!);
        CurrentVersionNo = json['CurrentVersionNo'];
        Head = JsonConverters.fromJson(json['Head'],'Attachment',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'AttachmentId': AttachmentId,
        'Versions': JsonConverters.toJson(Versions,'List<AttachmentVersion>',context!),
        'CurrentVersionNo': CurrentVersionNo,
        'Head': JsonConverters.toJson(Head,'Attachment',context!)
    };

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

class AttachmentVersionRequest implements IConvertible
{
    String? AttachmentId;
    String? RevisionLabel;
    String? Notes;

    AttachmentVersionRequest({this.AttachmentId,this.RevisionLabel,this.Notes});
    AttachmentVersionRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AttachmentId = json['AttachmentId'];
        RevisionLabel = json['RevisionLabel'];
        Notes = json['Notes'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AttachmentId': AttachmentId,
        'RevisionLabel': RevisionLabel,
        'Notes': Notes
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'AttachmentVersion': TypeInfo(TypeOf.Class, create:() => AttachmentVersion()),
    'Attachment': TypeInfo(TypeOf.Class, create:() => Attachment()),
    'Uint8List': TypeInfo(TypeOf.Class, create:() => Uint8List(0)),
    'AttachmentVersionResponse': TypeInfo(TypeOf.Class, create:() => AttachmentVersionResponse()),
    'List<AttachmentVersion>': TypeInfo(TypeOf.Class, create:() => <AttachmentVersion>[]),
    'AttachmentVersionRequest': TypeInfo(TypeOf.Class, create:() => AttachmentVersionRequest()),
});

Dart AttachmentVersionRequest DTOs

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

HTTP + JSV

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

POST /v1/AttachmentVersion/{AttachmentId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	AttachmentId: 00000000000000000000000000000000,
	RevisionLabel: String,
	Notes: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	AttachmentId: 00000000000000000000000000000000,
	Versions: 
	[
		{
			AttachmentVersionId: 0,
			AttachmentId: 00000000000000000000000000000000,
			VersionNo: 0,
			AttachmentName: String,
			MimeType: String,
			FileSizeInKB: 0,
			AWSKey: String,
			RevisionLabel: String,
			Notes: String,
			RestoredFromVersionNo: 0,
			UploadedBy: String,
			UploadedAt: 0001-01-01,
			IsCurrent: False,
			DownloadUrl: String
		}
	],
	CurrentVersionNo: 0,
	Head: 
	{
		AttachmentId: 00000000000000000000000000000000,
		TableName: String,
		FieldName: String,
		RecordId: 0,
		AttachmentName: String,
		MimeType: String,
		AttachmentData: AA==,
		FileSizeInKB: 0,
		CreatedDate: 0001-01-01,
		CreatedBy: String,
		NeedsOCR: False,
		OCRDate: 0001-01-01,
		IsSecurities: False,
		AWSKey: String,
		PresignedUrl: String
	}
}