| GET,OPTIONS | /v1/quote/{QuoteUID} |
|---|
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 Quote implements IConvertible
{
int? QuoteID;
String? QuoteUID;
String? TenantId;
String? BranchId;
int? ProjectID;
String? ProjectUID;
String? ProjectName;
String? Name;
String? Status;
double? Total;
String? Notes;
String? Currency;
String? FromName;
String? FromPhone;
String? FromEmail;
String? FromAddress;
String? ToName;
String? ToPhone;
String? ToEmail;
String? ToAddress;
DateTime? ExpiresAt;
bool? IsLocked;
bool? FinalPriceAfterCompletion;
String? ApprovedByName;
DateTime? ApprovedAt;
String? DeclinedByName;
DateTime? DeclinedAt;
String? DeclineReason;
String? CreatedBy;
DateTime? CreatedAt;
String? UpdatedBy;
DateTime? UpdatedAt;
List<QuoteItem>? Items = [];
Quote({this.QuoteID,this.QuoteUID,this.TenantId,this.BranchId,this.ProjectID,this.ProjectUID,this.ProjectName,this.Name,this.Status,this.Total,this.Notes,this.Currency,this.FromName,this.FromPhone,this.FromEmail,this.FromAddress,this.ToName,this.ToPhone,this.ToEmail,this.ToAddress,this.ExpiresAt,this.IsLocked,this.FinalPriceAfterCompletion,this.ApprovedByName,this.ApprovedAt,this.DeclinedByName,this.DeclinedAt,this.DeclineReason,this.CreatedBy,this.CreatedAt,this.UpdatedBy,this.UpdatedAt,this.Items});
Quote.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
QuoteID = json['QuoteID'];
QuoteUID = json['QuoteUID'];
TenantId = json['TenantId'];
BranchId = json['BranchId'];
ProjectID = json['ProjectID'];
ProjectUID = json['ProjectUID'];
ProjectName = json['ProjectName'];
Name = json['Name'];
Status = json['Status'];
Total = JsonConverters.toDouble(json['Total']);
Notes = json['Notes'];
Currency = json['Currency'];
FromName = json['FromName'];
FromPhone = json['FromPhone'];
FromEmail = json['FromEmail'];
FromAddress = json['FromAddress'];
ToName = json['ToName'];
ToPhone = json['ToPhone'];
ToEmail = json['ToEmail'];
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'];
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
UpdatedBy = json['UpdatedBy'];
UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
Items = JsonConverters.fromJson(json['Items'],'List<QuoteItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'QuoteID': QuoteID,
'QuoteUID': QuoteUID,
'TenantId': TenantId,
'BranchId': BranchId,
'ProjectID': ProjectID,
'ProjectUID': ProjectUID,
'ProjectName': ProjectName,
'Name': Name,
'Status': Status,
'Total': Total,
'Notes': Notes,
'Currency': Currency,
'FromName': FromName,
'FromPhone': FromPhone,
'FromEmail': FromEmail,
'FromAddress': FromAddress,
'ToName': ToName,
'ToPhone': ToPhone,
'ToEmail': ToEmail,
'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,
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'UpdatedBy': UpdatedBy,
'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!),
'Items': JsonConverters.toJson(Items,'List<QuoteItem>',context!)
};
getTypeName() => "Quote";
TypeContext? context = _ctx;
}
class QuoteResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
Quote? Quote;
QuoteResponse({this.ResponseStatus,this.Quote});
QuoteResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Quote = JsonConverters.fromJson(json['Quote'],'Quote',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Quote': JsonConverters.toJson(Quote,'Quote',context!)
};
getTypeName() => "QuoteResponse";
TypeContext? context = _ctx;
}
class GetQuoteRequest implements IConvertible
{
String? QuoteUID;
GetQuoteRequest({this.QuoteUID});
GetQuoteRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
QuoteUID = json['QuoteUID'];
return this;
}
Map<String, dynamic> toJson() => {
'QuoteUID': QuoteUID
};
getTypeName() => "GetQuoteRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'QuoteItem': TypeInfo(TypeOf.Class, create:() => QuoteItem()),
'Quote': TypeInfo(TypeOf.Class, create:() => Quote()),
'List<QuoteItem>': TypeInfo(TypeOf.Class, create:() => <QuoteItem>[]),
'QuoteResponse': TypeInfo(TypeOf.Class, create:() => QuoteResponse()),
'GetQuoteRequest': TypeInfo(TypeOf.Class, create:() => GetQuoteRequest()),
});
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 /v1/quote/{QuoteUID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<QuoteResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Quote>
<ApprovedAt>0001-01-01T00:00:00</ApprovedAt>
<ApprovedByName>String</ApprovedByName>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<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>
<FromEmail>String</FromEmail>
<FromName>String</FromName>
<FromPhone>String</FromPhone>
<IsLocked>false</IsLocked>
<Items>
<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>
</Items>
<Name>String</Name>
<Notes>String</Notes>
<ProjectID>0</ProjectID>
<ProjectName>String</ProjectName>
<ProjectUID>00000000-0000-0000-0000-000000000000</ProjectUID>
<QuoteID>0</QuoteID>
<QuoteUID>00000000-0000-0000-0000-000000000000</QuoteUID>
<Status>String</Status>
<TenantId>00000000-0000-0000-0000-000000000000</TenantId>
<ToAddress>String</ToAddress>
<ToEmail>String</ToEmail>
<ToName>String</ToName>
<ToPhone>String</ToPhone>
<Total>0</Total>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
<UpdatedBy>String</UpdatedBy>
</Quote>
<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>
</QuoteResponse>