| POST | /warranty/v1/GetBrandPrivacyPolicy |
|---|
import Foundation
import ServiceStack
public class GetBrandPrivacyPolicy : BaseRequest<String>
{
public var countryId:String
public var languageId:String
public var brandTrigram:String
public var posId:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case countryId
case languageId
case brandTrigram
case posId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
countryId = try container.decodeIfPresent(String.self, forKey: .countryId)
languageId = try container.decodeIfPresent(String.self, forKey: .languageId)
brandTrigram = try container.decodeIfPresent(String.self, forKey: .brandTrigram)
posId = try container.decodeIfPresent(Int.self, forKey: .posId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if countryId != nil { try container.encode(countryId, forKey: .countryId) }
if languageId != nil { try container.encode(languageId, forKey: .languageId) }
if brandTrigram != nil { try container.encode(brandTrigram, forKey: .brandTrigram) }
if posId != nil { try container.encode(posId, forKey: .posId) }
}
}
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(){}
}
Swift GetBrandPrivacyPolicy 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.
POST /warranty/v1/GetBrandPrivacyPolicy HTTP/1.1
Host: qp-microservices-booster.richemont.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"countryId":"String","languageId":"String","brandTrigram":"String","posId":0,"sid":"String","app":"String","_os":"String","_appVersion":"String","_searchMethod":"String"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length (string)