| 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 .xml suffix or ?format=xml
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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetPromoterTypesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Sale">
<promoterTypes>
<PromoterType>
<description>String</description>
<promoterTypeId>String</promoterTypeId>
</PromoterType>
</promoterTypes>
</GetPromoterTypesResponse>