| GET,OPTIONS | /portal/{Token}/visits |
|---|
import 'package:servicestack/servicestack.dart';
class CustomerVisit implements IConvertible
{
int? AgreementJobID;
DateTime? VisitDate;
DateTime? CompletedAt;
String? ServiceName;
String? CrewNotes;
CustomerVisit({this.AgreementJobID,this.VisitDate,this.CompletedAt,this.ServiceName,this.CrewNotes});
CustomerVisit.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AgreementJobID = json['AgreementJobID'];
VisitDate = JsonConverters.fromJson(json['VisitDate'],'DateTime',context!);
CompletedAt = JsonConverters.fromJson(json['CompletedAt'],'DateTime',context!);
ServiceName = json['ServiceName'];
CrewNotes = json['CrewNotes'];
return this;
}
Map<String, dynamic> toJson() => {
'AgreementJobID': AgreementJobID,
'VisitDate': JsonConverters.toJson(VisitDate,'DateTime',context!),
'CompletedAt': JsonConverters.toJson(CompletedAt,'DateTime',context!),
'ServiceName': ServiceName,
'CrewNotes': CrewNotes
};
getTypeName() => "CustomerVisit";
TypeContext? context = _ctx;
}
class CustomerVisitPhoto implements IConvertible
{
int? ProjectLocationAttachmentID;
int? AgreementJobID;
String? DocTitle;
String? MimeType;
DateTime? UploadDate;
CustomerVisitPhoto({this.ProjectLocationAttachmentID,this.AgreementJobID,this.DocTitle,this.MimeType,this.UploadDate});
CustomerVisitPhoto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectLocationAttachmentID = json['ProjectLocationAttachmentID'];
AgreementJobID = json['AgreementJobID'];
DocTitle = json['DocTitle'];
MimeType = json['MimeType'];
UploadDate = JsonConverters.fromJson(json['UploadDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ProjectLocationAttachmentID': ProjectLocationAttachmentID,
'AgreementJobID': AgreementJobID,
'DocTitle': DocTitle,
'MimeType': MimeType,
'UploadDate': JsonConverters.toJson(UploadDate,'DateTime',context!)
};
getTypeName() => "CustomerVisitPhoto";
TypeContext? context = _ctx;
}
class PortalVisitsResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<CustomerVisit>? Visits = [];
List<CustomerVisitPhoto>? Photos = [];
PortalVisitsResponse({this.ResponseStatus,this.Visits,this.Photos});
PortalVisitsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Visits = JsonConverters.fromJson(json['Visits'],'List<CustomerVisit>',context!);
Photos = JsonConverters.fromJson(json['Photos'],'List<CustomerVisitPhoto>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Visits': JsonConverters.toJson(Visits,'List<CustomerVisit>',context!),
'Photos': JsonConverters.toJson(Photos,'List<CustomerVisitPhoto>',context!)
};
getTypeName() => "PortalVisitsResponse";
TypeContext? context = _ctx;
}
class PortalVisitsRequest implements IConvertible
{
String? Token;
PortalVisitsRequest({this.Token});
PortalVisitsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Token = json['Token'];
return this;
}
Map<String, dynamic> toJson() => {
'Token': Token
};
getTypeName() => "PortalVisitsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'CustomerVisit': TypeInfo(TypeOf.Class, create:() => CustomerVisit()),
'CustomerVisitPhoto': TypeInfo(TypeOf.Class, create:() => CustomerVisitPhoto()),
'PortalVisitsResponse': TypeInfo(TypeOf.Class, create:() => PortalVisitsResponse()),
'List<CustomerVisit>': TypeInfo(TypeOf.Class, create:() => <CustomerVisit>[]),
'List<CustomerVisitPhoto>': TypeInfo(TypeOf.Class, create:() => <CustomerVisitPhoto>[]),
'PortalVisitsRequest': TypeInfo(TypeOf.Class, create:() => PortalVisitsRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /portal/{Token}/visits HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<PortalVisitsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Photos>
<CustomerVisitPhoto>
<AgreementJobID>0</AgreementJobID>
<DocTitle>String</DocTitle>
<MimeType>String</MimeType>
<ProjectLocationAttachmentID>0</ProjectLocationAttachmentID>
<UploadDate>0001-01-01T00:00:00</UploadDate>
</CustomerVisitPhoto>
</Photos>
<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>
<Visits>
<CustomerVisit>
<AgreementJobID>0</AgreementJobID>
<CompletedAt>0001-01-01T00:00:00</CompletedAt>
<CrewNotes>String</CrewNotes>
<ServiceName>String</ServiceName>
<VisitDate>0001-01-01T00:00:00</VisitDate>
</CustomerVisit>
</Visits>
</PortalVisitsResponse>