| GET | /warranty/v1/GetWeChatQrCode/{boosterCustomerId} |
|---|
import Foundation
import ServiceStack
public class GetWeChatQrCodeRequest : BaseRequest<GetWeChatQrCodeResponse>
{
public var boosterCustomerId:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case boosterCustomerId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
boosterCustomerId = try container.decodeIfPresent(Int.self, forKey: .boosterCustomerId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if boosterCustomerId != nil { try container.encode(boosterCustomerId, forKey: .boosterCustomerId) }
}
}
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 GetWeChatQrCodeResponse : BaseResponse
{
public var weChatQrCodeUrl:String
public var errorCode:String
public var errorMessage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case weChatQrCodeUrl
case errorCode
case errorMessage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
weChatQrCodeUrl = try container.decodeIfPresent(String.self, forKey: .weChatQrCodeUrl)
errorCode = try container.decodeIfPresent(String.self, forKey: .errorCode)
errorMessage = try container.decodeIfPresent(String.self, forKey: .errorMessage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if weChatQrCodeUrl != nil { try container.encode(weChatQrCodeUrl, forKey: .weChatQrCodeUrl) }
if errorCode != nil { try container.encode(errorCode, forKey: .errorCode) }
if errorMessage != nil { try container.encode(errorMessage, forKey: .errorMessage) }
}
}
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(){}
}
Swift GetWeChatQrCodeRequest 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/GetWeChatQrCode/{boosterCustomerId} HTTP/1.1
Host: qp-microservices-booster.richemont.com
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"weChatQrCodeUrl":"String","errorCode":"String","errorMessage":"String","_xmlns":"String","_type":"String","_source":"String","_tstamp":"String","_user":"String","_env":"String","_uri":"String","_query":"String"}