Required permission: | SharepointFiles |
POST | /DynamicsCRM/Sharepoint/File |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class CRMSharepointFileResponse implements IConvertible
{
ResponseStatus? responseStatus;
String? file_base64;
String? filename;
String? item_id;
int? filesize;
String? mimetype;
String? sharepoint_url;
CRMSharepointFileResponse({this.responseStatus,this.file_base64,this.filename,this.item_id,this.filesize,this.mimetype,this.sharepoint_url});
CRMSharepointFileResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
file_base64 = json['file_base64'];
filename = json['filename'];
item_id = json['item_id'];
filesize = json['filesize'];
mimetype = json['mimetype'];
sharepoint_url = json['sharepoint_url'];
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'file_base64': file_base64,
'filename': filename,
'item_id': item_id,
'filesize': filesize,
'mimetype': mimetype,
'sharepoint_url': sharepoint_url
};
getTypeName() => "CRMSharepointFileResponse";
TypeContext? context = _ctx;
}
class CRMSharepointFileRequest implements IConvertible
{
String? filename;
String? item_id;
bool? convert_to_pdf;
bool? as_thumbnail;
bool? is_development;
bool? is_invoice;
bool? is_tax_receipt;
CRMSharepointFileRequest({this.filename,this.item_id,this.convert_to_pdf,this.as_thumbnail,this.is_development,this.is_invoice,this.is_tax_receipt});
CRMSharepointFileRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
filename = json['filename'];
item_id = json['item_id'];
convert_to_pdf = json['convert_to_pdf'];
as_thumbnail = json['as_thumbnail'];
is_development = json['is_development'];
is_invoice = json['is_invoice'];
is_tax_receipt = json['is_tax_receipt'];
return this;
}
Map<String, dynamic> toJson() => {
'filename': filename,
'item_id': item_id,
'convert_to_pdf': convert_to_pdf,
'as_thumbnail': as_thumbnail,
'is_development': is_development,
'is_invoice': is_invoice,
'is_tax_receipt': is_tax_receipt
};
getTypeName() => "CRMSharepointFileRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'data.regent_college.edu', types: <String, TypeInfo> {
'CRMSharepointFileResponse': TypeInfo(TypeOf.Class, create:() => CRMSharepointFileResponse()),
'CRMSharepointFileRequest': TypeInfo(TypeOf.Class, create:() => CRMSharepointFileRequest()),
});
Dart CRMSharepointFileRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /DynamicsCRM/Sharepoint/File HTTP/1.1
Host: data.regent-college.edu
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"filename":"String","item_id":"String","convert_to_pdf":false,"as_thumbnail":false,"is_development":false,"is_invoice":false,"is_tax_receipt":false}
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"}},"file_base64":"String","filename":"String","item_id":"String","filesize":0,"mimetype":"String","sharepoint_url":"String"}