| POST | /warranty/equipment | Create Equipment Warranty | Create Equipment Warranty API |
|---|
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 CreateEquipmentWarrantyResponse:
# @ApiMember(Description="Equipment number", IsRequired=true)
equipment: Optional[str] = None
"""
Equipment number
"""
# @ApiMember(Description="Warranty type", IsRequired=true)
warranty_type: Optional[str] = None
"""
Warranty type
"""
# @ApiMember(Description="Master warranty", IsRequired=true)
master_warranty: Optional[str] = None
"""
Master warranty
"""
# @ApiMember(Description="Warranty start date", IsRequired=true)
warranty_start_date: Optional[str] = None
"""
Warranty start date
"""
# @ApiMember(Description="Warranty end date")
warranty_end_date: Optional[str] = None
"""
Warranty end date
"""
# @ApiMember(Description="Warranty creation date", IsRequired=true)
warranty_creation_date: Optional[str] = None
"""
Warranty creation date
"""
# @ApiMember(Description="Warranty creation time", IsRequired=true)
warranty_creation_time: Optional[str] = None
"""
Warranty creation time
"""
# @ApiMember(Description="Object number (ERP)", IsRequired=true)
object_number: Optional[str] = None
"""
Object number (ERP)
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateEquipmentWarranty:
# @ApiMember(Description="Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided")
brand: Optional[str] = None
"""
Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided
"""
# @ApiMember(Description="Richemont POS code", IsRequired=true)
pos_code: Optional[str] = None
"""
Richemont POS code
"""
# @ApiMember(Description="Equipment", IsRequired=true)
equipment: Optional[str] = None
"""
Equipment
"""
# @ApiMember(Description="Warranty type", IsRequired=true)
warranty_type: Optional[str] = None
"""
Warranty type
"""
# @ApiMember(Description="Date of the warranty start date e.g. 2025-06-01", IsRequired=true)
warranty_start_date: datetime.datetime = datetime.datetime(1, 1, 1)
"""
Date of the warranty start date e.g. 2025-06-01
"""
Python CreateEquipmentWarranty DTOs
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.
POST /warranty/equipment HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateEquipmentWarranty xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Sellout.ServiceModel">
<brand>String</brand>
<equipment>String</equipment>
<posCode>String</posCode>
<warrantyStartDate>0001-01-01T00:00:00</warrantyStartDate>
<warrantyType>String</warrantyType>
</CreateEquipmentWarranty>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CreateEquipmentWarrantyResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Sellout.ServiceModel"> <equipment>String</equipment> <masterWarranty>String</masterWarranty> <objectNumber>String</objectNumber> <warrantyCreationDate>String</warrantyCreationDate> <warrantyCreationTime>String</warrantyCreationTime> <warrantyEndDate>String</warrantyEndDate> <warrantyStartDate>String</warrantyStartDate> <warrantyType>String</warrantyType> </CreateEquipmentWarrantyResponse>