| GET | /warranty/v1/promotertypes/{promoterTypeId*} |
|---|
import Foundation
import ServiceStack
public class GetPromoterTypes : BaseRequest<GetPromoterTypesResponse>
{
public var promoterTypeId:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case promoterTypeId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
promoterTypeId = try container.decodeIfPresent(String.self, forKey: .promoterTypeId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if promoterTypeId != nil { try container.encode(promoterTypeId, forKey: .promoterTypeId) }
}
}
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 GetPromoterTypesResponse : Codable
{
public var promoterTypes:[PromoterType] = []
required public init(){}
}
public class PromoterType : Codable
{
public var promoterTypeId:String
public var Description:String
required public init(){}
}
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/promotertypes/{promoterTypeId*} HTTP/1.1
Host: qp-microservices-booster.richemont.com
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"promoterTypes":[{"promoterTypeId":"String","description":"String"}]}