| PUT,OPTIONS | /v1/quote |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QuoteItem:
quote_item_i_d: int = 0
quote_i_d: int = 0
item_type: Optional[str] = None
source_ref_id: Optional[int] = None
job_i_d: Optional[int] = None
name: Optional[str] = None
description: Optional[str] = None
quantity: Optional[Decimal] = None
unit_price: Optional[Decimal] = None
is_taxable: Optional[bool] = None
display_order: Optional[int] = None
is_deleted: Optional[bool] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Quote:
quote_i_d: int = 0
quote_u_i_d: Optional[str] = None
tenant_id: Optional[str] = None
branch_id: Optional[str] = None
project_i_d: int = 0
project_u_i_d: Optional[str] = None
project_name: Optional[str] = None
name: Optional[str] = None
status: Optional[str] = None
total: Optional[Decimal] = None
notes: Optional[str] = None
currency: Optional[str] = None
from_name: Optional[str] = None
from_phone: Optional[str] = None
from_email: Optional[str] = None
from_address: Optional[str] = None
to_name: Optional[str] = None
to_phone: Optional[str] = None
to_email: Optional[str] = None
to_address: Optional[str] = None
expires_at: Optional[datetime.datetime] = None
is_locked: Optional[bool] = None
final_price_after_completion: Optional[bool] = None
approved_by_name: Optional[str] = None
approved_at: Optional[datetime.datetime] = None
declined_by_name: Optional[str] = None
declined_at: Optional[datetime.datetime] = None
decline_reason: Optional[str] = None
created_by: Optional[str] = None
created_at: Optional[datetime.datetime] = None
updated_by: Optional[str] = None
updated_at: Optional[datetime.datetime] = None
items: List[QuoteItem] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QuoteResponse:
response_status: Optional[ResponseStatus] = None
quote: Optional[Quote] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateQuoteRequest:
quote: Optional[Quote] = None
Python UpdateQuoteRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /v1/quote HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Quote:
{
QuoteID: 0,
QuoteUID: 00000000000000000000000000000000,
TenantId: 00000000000000000000000000000000,
BranchId: 00000000000000000000000000000000,
ProjectID: 0,
ProjectUID: 00000000000000000000000000000000,
ProjectName: String,
Name: String,
Status: String,
Total: 0,
Notes: String,
Currency: String,
FromName: String,
FromPhone: String,
FromEmail: String,
FromAddress: String,
ToName: String,
ToPhone: String,
ToEmail: String,
ToAddress: String,
ExpiresAt: 0001-01-01,
IsLocked: False,
FinalPriceAfterCompletion: False,
ApprovedByName: String,
ApprovedAt: 0001-01-01,
DeclinedByName: String,
DeclinedAt: 0001-01-01,
DeclineReason: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedBy: String,
UpdatedAt: 0001-01-01,
Items:
[
{
QuoteItemID: 0,
QuoteID: 0,
ItemType: String,
SourceRefId: 0,
JobID: 0,
Name: String,
Description: String,
Quantity: 0,
UnitPrice: 0,
IsTaxable: False,
DisplayOrder: 0,
IsDeleted: False
}
]
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Quote:
{
QuoteID: 0,
QuoteUID: 00000000000000000000000000000000,
TenantId: 00000000000000000000000000000000,
BranchId: 00000000000000000000000000000000,
ProjectID: 0,
ProjectUID: 00000000000000000000000000000000,
ProjectName: String,
Name: String,
Status: String,
Total: 0,
Notes: String,
Currency: String,
FromName: String,
FromPhone: String,
FromEmail: String,
FromAddress: String,
ToName: String,
ToPhone: String,
ToEmail: String,
ToAddress: String,
ExpiresAt: 0001-01-01,
IsLocked: False,
FinalPriceAfterCompletion: False,
ApprovedByName: String,
ApprovedAt: 0001-01-01,
DeclinedByName: String,
DeclinedAt: 0001-01-01,
DeclineReason: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedBy: String,
UpdatedAt: 0001-01-01,
Items:
[
{
QuoteItemID: 0,
QuoteID: 0,
ItemType: String,
SourceRefId: 0,
JobID: 0,
Name: String,
Description: String,
Quantity: 0,
UnitPrice: 0,
IsTaxable: False,
DisplayOrder: 0,
IsDeleted: False
}
]
}
}