| GET | /v4/affiliate-tokens-sets |
|---|
import Foundation
import ServiceStack
// @DataContract
public class GetAffiliateTokensSetRequest : Codable
{
// @DataMember(Name="setGuid")
public var setGuid:String
required public init(){}
}
// @DataContract
public class GetAffiliateTokensSetResponse : Codable
{
// @DataMember(Name="affiliateTokensSet")
public var affiliateTokensSet:AffiliateTokensSet
// @DataMember(Name="responseStatus")
public var responseStatus:ResponseStatus
required public init(){}
}
public class AffiliateTokensSet : AffiliateTokens, IAffiliateTokensSet
{
// @DataMember(Name="setGuid")
public var setGuid:String
// @DataMember(Name="username")
public var username:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setGuid
case username
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setGuid = try container.decodeIfPresent(String.self, forKey: .setGuid)
username = try container.decodeIfPresent(String.self, forKey: .username)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setGuid != nil { try container.encode(setGuid, forKey: .setGuid) }
if username != nil { try container.encode(username, forKey: .username) }
}
}
public class AffiliateTokens : IAffiliateTokens, Codable
{
public var id:String
public var programs:[AffiliateProgram]
public var createdAtUtc:Date
public var updatedAtUtc:Date
required public init(){}
}
// @DataContract
public class AffiliateProgram : IAffiliateProgram, Codable
{
// @DataMember(Name="programGuid")
public var programGuid:String
// @DataMember(Name="affiliateTokens")
public var affiliateTokens:[String:String]
required public init(){}
}
Swift GetAffiliateTokensSetRequest 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 /v4/affiliate-tokens-sets HTTP/1.1 Host: affiliation-api-zane.dev.platform.georiot.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"affiliateTokensSet":{"setGuid":"String","username":"String","id":"String","programs":[{"programGuid":"String"}],"createdAtUtc":"0001-01-01T00:00:00.0000000","updatedAtUtc":"0001-01-01T00:00:00.0000000"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}