GET | /account/eula | Get the account EULA & status |
---|
import Foundation
import ServiceStack
// @DataContract
public class GetEulaStatus : BaseRequest
{
/**
* If this is specified, the information will be for the specified sub user, otherwise it will be for the main user account
*/
// @DataMember
// @ApiMember(Description="If this is specified, the information will be for the specified sub user, otherwise it will be for the main user account")
public var subUserName:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case subUserName
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
subUserName = try container.decodeIfPresent(String.self, forKey: .subUserName)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if subUserName != nil { try container.encode(subUserName, forKey: .subUserName) }
}
}
// @DataContract
public class BaseRequest : IBaseRequest, Codable
{
/**
* The authentication credentials
*/
// @DataMember
// @ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
public var authentication:Authentication
required public init(){}
}
// @DataContract
public class Authentication : Codable
{
/**
* The API User ID provided by us when you signed up to use our API
*/
// @DataMember
// @ApiMember(Description="The API User ID provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
public var apiUserId:String
/**
* The API User Key provided by us when you signed up to use our API
*/
// @DataMember
// @ApiMember(Description="The API User Key provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
public var apiUserKey:String
required public init(){}
}
// @DataContract
public class GetEulaStatusResponse : Codable
{
// @DataMember
public var data:GetEulaStatusData
required public init(){}
}
public class GetEulaStatusData : BaseResponse
{
public var termsAndConditions:String
public var privacyPolicy:String
public var agreeToContact:Bool
public var agreeToContactInfo:String
public var agreeToContactDate:Date?
public var agreeToTerms:Bool
public var agreeToTermsInfo:String
public var agreeToTermsDate:Date?
public var agreeToDataProtection:Bool
public var agreeToDataProtectionInfo:String
public var agreeToDataProtectionDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case termsAndConditions
case privacyPolicy
case agreeToContact
case agreeToContactInfo
case agreeToContactDate
case agreeToTerms
case agreeToTermsInfo
case agreeToTermsDate
case agreeToDataProtection
case agreeToDataProtectionInfo
case agreeToDataProtectionDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
termsAndConditions = try container.decodeIfPresent(String.self, forKey: .termsAndConditions)
privacyPolicy = try container.decodeIfPresent(String.self, forKey: .privacyPolicy)
agreeToContact = try container.decodeIfPresent(Bool.self, forKey: .agreeToContact)
agreeToContactInfo = try container.decodeIfPresent(String.self, forKey: .agreeToContactInfo)
agreeToContactDate = try container.decodeIfPresent(Date.self, forKey: .agreeToContactDate)
agreeToTerms = try container.decodeIfPresent(Bool.self, forKey: .agreeToTerms)
agreeToTermsInfo = try container.decodeIfPresent(String.self, forKey: .agreeToTermsInfo)
agreeToTermsDate = try container.decodeIfPresent(Date.self, forKey: .agreeToTermsDate)
agreeToDataProtection = try container.decodeIfPresent(Bool.self, forKey: .agreeToDataProtection)
agreeToDataProtectionInfo = try container.decodeIfPresent(String.self, forKey: .agreeToDataProtectionInfo)
agreeToDataProtectionDate = try container.decodeIfPresent(Date.self, forKey: .agreeToDataProtectionDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if termsAndConditions != nil { try container.encode(termsAndConditions, forKey: .termsAndConditions) }
if privacyPolicy != nil { try container.encode(privacyPolicy, forKey: .privacyPolicy) }
if agreeToContact != nil { try container.encode(agreeToContact, forKey: .agreeToContact) }
if agreeToContactInfo != nil { try container.encode(agreeToContactInfo, forKey: .agreeToContactInfo) }
if agreeToContactDate != nil { try container.encode(agreeToContactDate, forKey: .agreeToContactDate) }
if agreeToTerms != nil { try container.encode(agreeToTerms, forKey: .agreeToTerms) }
if agreeToTermsInfo != nil { try container.encode(agreeToTermsInfo, forKey: .agreeToTermsInfo) }
if agreeToTermsDate != nil { try container.encode(agreeToTermsDate, forKey: .agreeToTermsDate) }
if agreeToDataProtection != nil { try container.encode(agreeToDataProtection, forKey: .agreeToDataProtection) }
if agreeToDataProtectionInfo != nil { try container.encode(agreeToDataProtectionInfo, forKey: .agreeToDataProtectionInfo) }
if agreeToDataProtectionDate != nil { try container.encode(agreeToDataProtectionDate, forKey: .agreeToDataProtectionDate) }
}
}
public class BaseResponse : IBaseDataResponse, IHasResponseStatus, Codable
{
/**
* The status of the response
*/
// @ApiMember(Description="The status of the response")
public var responseStatus:ResponseStatus
required public init(){}
}
public class ArrayOfResponseError : List<ResponseError>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /account/eula HTTP/1.1 Host: api.sanctionssearch.com Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"data":{"termsAndConditions":"String","privacyPolicy":"String","agreeToContact":false,"agreeToContactInfo":"String","agreeToContactDate":"\/Date(-62135596800000-0000)\/","agreeToTerms":false,"agreeToTermsInfo":"String","agreeToTermsDate":"\/Date(-62135596800000-0000)\/","agreeToDataProtection":false,"agreeToDataProtectionInfo":"String","agreeToDataProtectionDate":"\/Date(-62135596800000-0000)\/","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}}