| GET | /warranty/v1/cards |
|---|
import Foundation
import ServiceStack
public class ListWarrantyCardsRequest : BaseRequest<ListWarrantyCardsResponse>
{
public var user:String
public var site:String
public var system:String
public var application:String
public var article:String
public var ref:String
public var serial:String
public var page:Int
public var size:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case user
case site
case system
case application
case article
case ref
case serial
case page
case size
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
user = try container.decodeIfPresent(String.self, forKey: .user)
site = try container.decodeIfPresent(String.self, forKey: .site)
system = try container.decodeIfPresent(String.self, forKey: .system)
application = try container.decodeIfPresent(String.self, forKey: .application)
article = try container.decodeIfPresent(String.self, forKey: .article)
ref = try container.decodeIfPresent(String.self, forKey: .ref)
serial = try container.decodeIfPresent(String.self, forKey: .serial)
page = try container.decodeIfPresent(Int.self, forKey: .page)
size = try container.decodeIfPresent(Int.self, forKey: .size)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if user != nil { try container.encode(user, forKey: .user) }
if site != nil { try container.encode(site, forKey: .site) }
if system != nil { try container.encode(system, forKey: .system) }
if application != nil { try container.encode(application, forKey: .application) }
if article != nil { try container.encode(article, forKey: .article) }
if ref != nil { try container.encode(ref, forKey: .ref) }
if serial != nil { try container.encode(serial, forKey: .serial) }
if page != nil { try container.encode(page, forKey: .page) }
if size != nil { try container.encode(size, forKey: .size) }
}
}
public class BaseRequest<TResponse : Codable> : IRequest, Codable
{
public var sid:String
public var app:String
public var _os:String
public var _appVersion:String
public var _searchMethod:String
required public init(){}
}
public class ListWarrantyCardsResponse : BaseResponse
{
public var warranty:[Warranty] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case warranty
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
warranty = try container.decodeIfPresent([Warranty].self, forKey: .warranty) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if warranty.count > 0 { try container.encode(warranty, forKey: .warranty) }
}
}
public class BaseResponse : IRespose, Codable
{
public var _xmlns:String
public var _type:String
public var _source:String
public var _tstamp:String
public var _user:String
public var _env:String
public var _uri:String
public var _query:String
required public init(){}
}
public class Warranty : Codable
{
public var article:[Article] = []
public var warrantyId:String
public var createdBy:String
public var createdAt:String
public var issuedBy:String
public var selloutId:String
public var activationDate:String
public var pin:String
public var promoterTypeId:String
public var promoterTypeDs:String
public var site:Site
public var crmEnabled:Bool
public var canBeExtended:Bool
public var canBeRetriggered:Bool
required public init(){}
}
public class Article : Codable
{
public var ref:String
public var serial:String
public var name:String
public var site:LookupInt
public var brand:String
public var isConsignment:Bool
required public init(){}
}
public class LookupInt : ILookupInt, Codable
{
public var object:String
public var id:Int
required public init(){}
}
public class Site : Codable
{
public var object:String
public var id:String
public var name:String
public var address:Address
public var crmPrivacyPolicyMandatory:Bool
public var crmAllowStoreDataAbroadVisible:Bool
public var isTimeVallee:Bool
public var crmPrivacyPolicyTimeValleeMandatory:Bool
public var crmAllowStoreDataAbroadTimeValleeVisible:Bool
public var allowToCreateEndCustomerOutsideChina:Bool
public var displayFirstLastNameNotLatin:Bool
public var languageTransliteration:String
public var doNotDisplayPOSDataInDisclaimers:Bool
public var crmFirstNameMandatory:Bool
public var crmCityMandatory:Bool
public var manageOwnStock:Bool
required public init(){}
}
public class Address : Codable
{
public var line1:String
public var line2:String
public var city:String
public var zipCode:String
public var countryCode:String
required public init(){}
}
Swift ListWarrantyCardsRequest DTOs
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 /warranty/v1/cards HTTP/1.1 Host: qp-microservices-booster.richemont.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"warranty":[{"article":[{"ref":"String","serial":"String","name":"String","shortDesc":"String","brand":"String","warrantyStatusId":0,"warrantyStatusDesc":"String","warrantyStatusCode":"String","isConsignment":false}],"warrantyId":"String","createdBy":"String","createdAt":"String","issuedBy":"String","selloutId":"String","activationDate":"String","pin":"String","promoterTypeId":"String","promoterTypeDs":"String","site":{"object":"String","id":"String","name":"String","address":{"line1":"String","line2":"String","city":"String","zipCode":"String","countryCode":"String"},"crmPrivacyPolicyMandatory":false,"crmAllowStoreDataAbroadVisible":false,"isTimeVallee":false,"crmPrivacyPolicyTimeValleeMandatory":false,"crmAllowStoreDataAbroadTimeValleeVisible":false,"allowToCreateEndCustomerOutsideChina":false,"displayFirstLastNameNotLatin":false,"languageTransliteration":"String","doNotDisplayPOSDataInDisclaimers":false,"crmFirstNameMandatory":false,"crmCityMandatory":false,"manageOwnStock":false},"crmEnabled":false,"canBeExtended":false,"canBeRetriggered":false}],"_xmlns":"String","_type":"String","_source":"String","_tstamp":"String","_user":"String","_env":"String","_uri":"String","_query":"String"}