| 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 .other suffix or ?format=other
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: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Name":"String","Status":"String","Currency":"String","Total":0,"Notes":"String","FromName":"String","FromAddress":"String","ToName":"String","ToAddress":"String","ExpiresAt":"0001-01-01T00:00:00.0000000","IsLocked":false,"FinalPriceAfterCompletion":false,"ApprovedByName":"String","ApprovedAt":"0001-01-01T00:00:00.0000000","DeclinedByName":"String","DeclinedAt":"0001-01-01T00:00:00.0000000","DeclineReason":"String","LineItems":[{"QuoteItemID":0,"QuoteID":0,"ItemType":"String","SourceRefId":0,"JobID":0,"Name":"String","Description":"String","Quantity":0,"UnitPrice":0,"IsTaxable":false,"DisplayOrder":0,"IsDeleted":false}]}