Booster.Microservices

<back to all web services

ListWarrantyCardsRequest

Requires Authentication
The following routes are available for this service:
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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ListWarrantyCardsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Sale">
  <_env xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_env>
  <_query xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_query>
  <_source xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_source>
  <_tstamp xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_tstamp>
  <_type xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_type>
  <_uri xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_uri>
  <_user xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_user>
  <_xmlns xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_xmlns>
  <warranty>
    <Warranty>
      <activationDate>String</activationDate>
      <article>
        <Article>
          <brand>String</brand>
          <isConsignment>false</isConsignment>
          <name>String</name>
          <ref>String</ref>
          <serial>String</serial>
          <shortDesc>String</shortDesc>
          <warrantyStatusCode>String</warrantyStatusCode>
          <warrantyStatusDesc>String</warrantyStatusDesc>
          <warrantyStatusId>0</warrantyStatusId>
        </Article>
      </article>
      <canBeExtended>false</canBeExtended>
      <canBeRetriggered>false</canBeRetriggered>
      <createdAt>String</createdAt>
      <createdBy>String</createdBy>
      <crmEnabled>false</crmEnabled>
      <issuedBy>String</issuedBy>
      <pin>String</pin>
      <promoterTypeDs>String</promoterTypeDs>
      <promoterTypeId>String</promoterTypeId>
      <selloutId>String</selloutId>
      <site>
        <address>
          <city>String</city>
          <countryCode>String</countryCode>
          <line1>String</line1>
          <line2>String</line2>
          <zipCode>String</zipCode>
        </address>
        <allowToCreateEndCustomerOutsideChina>false</allowToCreateEndCustomerOutsideChina>
        <crmAllowStoreDataAbroadTimeValleeVisible>false</crmAllowStoreDataAbroadTimeValleeVisible>
        <crmAllowStoreDataAbroadVisible>false</crmAllowStoreDataAbroadVisible>
        <crmCityMandatory>false</crmCityMandatory>
        <crmFirstNameMandatory>false</crmFirstNameMandatory>
        <crmPrivacyPolicyMandatory>false</crmPrivacyPolicyMandatory>
        <crmPrivacyPolicyTimeValleeMandatory>false</crmPrivacyPolicyTimeValleeMandatory>
        <displayFirstLastNameNotLatin>false</displayFirstLastNameNotLatin>
        <doNotDisplayPOSDataInDisclaimers>false</doNotDisplayPOSDataInDisclaimers>
        <id>String</id>
        <isTimeVallee>false</isTimeVallee>
        <languageTransliteration>String</languageTransliteration>
        <manageOwnStock>false</manageOwnStock>
        <name>String</name>
        <object>String</object>
      </site>
      <warrantyId>String</warrantyId>
    </Warranty>
  </warranty>
</ListWarrantyCardsResponse>