Sanctions Search API: v2

<back to all web services

GetEulaStatus

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)
    }
}


Swift GetEulaStatus DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .soap12 suffix or ?format=soap12

HTTP + SOAP12

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /soap12 HTTP/1.1 
Host: api.sanctionssearch.com 
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>

<GetEulaStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Authentication>
    <ApiUserId>String</ApiUserId>
    <ApiUserKey>String</ApiUserKey>
  </Authentication>
  <SubUserName>String</SubUserName>
</GetEulaStatus>

</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>

<GetEulaStatusResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Data>
    <ResponseStatus>
      <ErrorCode>String</ErrorCode>
      <Message>String</Message>
      <StackTrace>String</StackTrace>
      <Errors>
        <ResponseError>
          <ErrorCode>String</ErrorCode>
          <FieldName>String</FieldName>
          <Message>String</Message>
          <Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </Meta>
        </ResponseError>
      </Errors>
      <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </Meta>
    </ResponseStatus>
    <AgreeToContact>false</AgreeToContact>
    <AgreeToContactDate>0001-01-01T00:00:00</AgreeToContactDate>
    <AgreeToContactInfo>String</AgreeToContactInfo>
    <AgreeToDataProtection>false</AgreeToDataProtection>
    <AgreeToDataProtectionDate>0001-01-01T00:00:00</AgreeToDataProtectionDate>
    <AgreeToDataProtectionInfo>String</AgreeToDataProtectionInfo>
    <AgreeToTerms>false</AgreeToTerms>
    <AgreeToTermsDate>0001-01-01T00:00:00</AgreeToTermsDate>
    <AgreeToTermsInfo>String</AgreeToTermsInfo>
    <PrivacyPolicy>String</PrivacyPolicy>
    <TermsAndConditions>String</TermsAndConditions>
  </Data>
</GetEulaStatusResponse>

</soap12:Body>
</soap12:Envelope>