| GET,OPTIONS | /portal/{Token}/quote |
|---|
import 'package:servicestack/servicestack.dart';
class QuoteItem implements IConvertible
{
int? QuoteItemID;
int? QuoteID;
String? ItemType;
int? SourceRefId;
int? JobID;
String? Name;
String? Description;
double? Quantity;
double? UnitPrice;
bool? IsTaxable;
int? DisplayOrder;
bool? IsDeleted;
QuoteItem({this.QuoteItemID,this.QuoteID,this.ItemType,this.SourceRefId,this.JobID,this.Name,this.Description,this.Quantity,this.UnitPrice,this.IsTaxable,this.DisplayOrder,this.IsDeleted});
QuoteItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
QuoteItemID = json['QuoteItemID'];
QuoteID = json['QuoteID'];
ItemType = json['ItemType'];
SourceRefId = json['SourceRefId'];
JobID = json['JobID'];
Name = json['Name'];
Description = json['Description'];
Quantity = JsonConverters.toDouble(json['Quantity']);
UnitPrice = JsonConverters.toDouble(json['UnitPrice']);
IsTaxable = json['IsTaxable'];
DisplayOrder = json['DisplayOrder'];
IsDeleted = json['IsDeleted'];
return this;
}
Map<String, dynamic> toJson() => {
'QuoteItemID': QuoteItemID,
'QuoteID': QuoteID,
'ItemType': ItemType,
'SourceRefId': SourceRefId,
'JobID': JobID,
'Name': Name,
'Description': Description,
'Quantity': Quantity,
'UnitPrice': UnitPrice,
'IsTaxable': IsTaxable,
'DisplayOrder': DisplayOrder,
'IsDeleted': IsDeleted
};
getTypeName() => "QuoteItem";
TypeContext? context = _ctx;
}
class PortalQuoteResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
String? Name;
String? Status;
String? Currency;
double? Total;
String? Notes;
String? FromName;
String? FromAddress;
String? ToName;
String? ToAddress;
DateTime? ExpiresAt;
bool? IsLocked;
bool? FinalPriceAfterCompletion;
String? ApprovedByName;
DateTime? ApprovedAt;
String? DeclinedByName;
DateTime? DeclinedAt;
String? DeclineReason;
List<QuoteItem>? LineItems = [];
PortalQuoteResponse({this.ResponseStatus,this.Name,this.Status,this.Currency,this.Total,this.Notes,this.FromName,this.FromAddress,this.ToName,this.ToAddress,this.ExpiresAt,this.IsLocked,this.FinalPriceAfterCompletion,this.ApprovedByName,this.ApprovedAt,this.DeclinedByName,this.DeclinedAt,this.DeclineReason,this.LineItems});
PortalQuoteResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Name = json['Name'];
Status = json['Status'];
Currency = json['Currency'];
Total = JsonConverters.toDouble(json['Total']);
Notes = json['Notes'];
FromName = json['FromName'];
FromAddress = json['FromAddress'];
ToName = json['ToName'];
ToAddress = json['ToAddress'];
ExpiresAt = JsonConverters.fromJson(json['ExpiresAt'],'DateTime',context!);
IsLocked = json['IsLocked'];
FinalPriceAfterCompletion = json['FinalPriceAfterCompletion'];
ApprovedByName = json['ApprovedByName'];
ApprovedAt = JsonConverters.fromJson(json['ApprovedAt'],'DateTime',context!);
DeclinedByName = json['DeclinedByName'];
DeclinedAt = JsonConverters.fromJson(json['DeclinedAt'],'DateTime',context!);
DeclineReason = json['DeclineReason'];
LineItems = JsonConverters.fromJson(json['LineItems'],'List<QuoteItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Name': Name,
'Status': Status,
'Currency': Currency,
'Total': Total,
'Notes': Notes,
'FromName': FromName,
'FromAddress': FromAddress,
'ToName': ToName,
'ToAddress': ToAddress,
'ExpiresAt': JsonConverters.toJson(ExpiresAt,'DateTime',context!),
'IsLocked': IsLocked,
'FinalPriceAfterCompletion': FinalPriceAfterCompletion,
'ApprovedByName': ApprovedByName,
'ApprovedAt': JsonConverters.toJson(ApprovedAt,'DateTime',context!),
'DeclinedByName': DeclinedByName,
'DeclinedAt': JsonConverters.toJson(DeclinedAt,'DateTime',context!),
'DeclineReason': DeclineReason,
'LineItems': JsonConverters.toJson(LineItems,'List<QuoteItem>',context!)
};
getTypeName() => "PortalQuoteResponse";
TypeContext? context = _ctx;
}
class PortalQuoteRequest implements IConvertible
{
String? Token;
PortalQuoteRequest({this.Token});
PortalQuoteRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Token = json['Token'];
return this;
}
Map<String, dynamic> toJson() => {
'Token': Token
};
getTypeName() => "PortalQuoteRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'QuoteItem': TypeInfo(TypeOf.Class, create:() => QuoteItem()),
'PortalQuoteResponse': TypeInfo(TypeOf.Class, create:() => PortalQuoteResponse()),
'List<QuoteItem>': TypeInfo(TypeOf.Class, create:() => <QuoteItem>[]),
'PortalQuoteRequest': TypeInfo(TypeOf.Class, create:() => PortalQuoteRequest()),
});
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}/quote HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<PortalQuoteResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ApprovedAt>0001-01-01T00:00:00</ApprovedAt>
<ApprovedByName>String</ApprovedByName>
<Currency>String</Currency>
<DeclineReason>String</DeclineReason>
<DeclinedAt>0001-01-01T00:00:00</DeclinedAt>
<DeclinedByName>String</DeclinedByName>
<ExpiresAt>0001-01-01T00:00:00</ExpiresAt>
<FinalPriceAfterCompletion>false</FinalPriceAfterCompletion>
<FromAddress>String</FromAddress>
<FromName>String</FromName>
<IsLocked>false</IsLocked>
<LineItems>
<QuoteItem>
<Description>String</Description>
<DisplayOrder>0</DisplayOrder>
<IsDeleted>false</IsDeleted>
<IsTaxable>false</IsTaxable>
<ItemType>String</ItemType>
<JobID>0</JobID>
<Name>String</Name>
<Quantity>0</Quantity>
<QuoteID>0</QuoteID>
<QuoteItemID>0</QuoteItemID>
<SourceRefId>0</SourceRefId>
<UnitPrice>0</UnitPrice>
</QuoteItem>
</LineItems>
<Name>String</Name>
<Notes>String</Notes>
<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>
<Status>String</Status>
<ToAddress>String</ToAddress>
<ToName>String</ToName>
<Total>0</Total>
</PortalQuoteResponse>