Create a new sanctions search for an entity | This will create a new sanctions search for an entity, such as a company, vessel, organisation, or group. |
import Foundation
import ServiceStack
/**
* Create a new sanctions search for an entity
*/
// @Api(Description="Create a new sanctions search for an entity")
// @ApiResponse(Description="Your request is successful if the \"<em>Data.ResponseStatus.Message</em>\" field is \"<b>Success</b>\".", StatusCode=200)
// @DataContract
public class AddCompanySearch : IBaseRequest, Codable
{
/**
* Authentication object
*/
// @DataMember
// @ApiMember(DataType="Authentication", Description="Authentication object", IsRequired=true)
public var authentication:Authentication
/**
* Request object
*/
// @DataMember
// @ApiMember(DataType="SearchCompanyRequest", Description="Request object", IsRequired=true)
public var request:SearchCompanyRequest
required public init(){}
}
// @DataContract
public class Authentication : IAuthentication, Codable
{
/**
* The API User ID that will authenticate your request
*/
// @DataMember
// @ApiMember(DataType="string", Description="The API User ID that will authenticate your request", IsRequired=true)
public var apiUserId:String
/**
* The API User Key that will authenticate your request
*/
// @DataMember
// @ApiMember(DataType="string", Description="The API User Key that will authenticate your request", IsRequired=true)
public var apiUserKey:String
required public init(){}
}
public class SearchCompanyRequest : Codable
{
/**
* The name of the entity that is being searched.
*/
// @ApiMember(DataType="string", Description="The name of the entity that is being searched.", IsRequired=true)
public var companyName:String
/**
* The country where the entity is registered.
*/
// @ApiMember(DataType="string", Description="The country where the entity is registered.", Format="int64")
public var country:String
/**
* The address where the entity is registered.
*/
// @ApiMember(DataType="string", Description="The address where the entity is registered.")
public var address:String
/**
* Array of sanctions lists to be included in the search. At least one is required.
*/
// @ApiMember(DataType="ArrayOfSanctionsLists", Description="Array of sanctions lists to be included in the search. At least one is required.", IsRequired=true)
public var selectedSanctionsLists:ArrayOfSanctionsLists
required public init(){}
}
public class ArrayOfSanctionsLists : List<String>
{
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)
}
}
// @DataContract
public class AddCompanySearchResponse : Codable
{
// @DataMember
// @ApiMember(IsRequired=true)
public var data:AddCompanySearchData
required public init(){}
}
// @DataContract
public class AddCompanySearchData : IBaseDataResponse, IHasResponseStatus, Codable
{
// @DataMember
public var responseStatus:ResponseStatus
// @DataMember
public var searchRecord:SearchRecord
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)
}
}
public class SearchRecord : Codable
{
public var id:Int
public var searchType:String
public var dateSearched:Date
public var dateUpdated:Date
public var numOfResults:Int
public var clientInResults:Bool
public var clientNotInResults:Bool
public var affectedByUpdate:Bool
public var searchCriteria:SearchCriteria
public var searchResults:SearchResults
required public init(){}
}
public class SearchCriteria : Codable
{
public var name:String
public var dateOfBirth:String
public var countryOfBirth:String
public var nationality:String
public var address:String
required public init(){}
}
public class SearchResults : Codable
{
public var hmtResults:[SearchResultHmTreasury] = []
public var ofacResults:[SearchResultOfac] = []
required public init(){}
}
public class SearchResultHmTreasury : Codable
{
public var resultStrength:Int
public var resultSimilarity:Double
public var resultResolved:Bool
public var resultType:String
public var dateListed:Date
public var dateUpdated:Date
public var name1:String
public var name2:String
public var name3:String
public var name4:String
public var name5:String
public var name6:String
public var dateOfBirth:String
public var countryOfBirth:String
public var nationality:String
public var address1:String
public var address2:String
public var address3:String
public var address4:String
public var address5:String
public var address6:String
public var postCode:String
public var country:String
required public init(){}
}
public class SearchResultOfac : Codable
{
public var resultStrength:Int
public var resultSimilarity:Double
public var resultResolved:Bool
public var resultType:String
public var dateUpdated:Date
public var firstName:String
public var lastName:String
public var addresses:[SearchResultOfacAddress] = []
public var akas:[SearchResultOfacAka] = []
public var dateOfBirths:[SearchResultOfacDateOfBirth] = []
public var nationalities:[SearchResultOfacNationality] = []
public var placeOfBirths:[SearchResultOfacPlaceOfBirth] = []
required public init(){}
}
public class SearchResultOfacAddress : Codable
{
public var address1:String
public var address2:String
public var address3:String
public var city:String
public var state:String
public var postCode:String
public var country:String
required public init(){}
}
public class SearchResultOfacAka : Codable
{
public var firstName:String
public var lastName:String
public var type:String
public var strength:String
required public init(){}
}
public class SearchResultOfacDateOfBirth : Codable
{
public var dateOfBirth:String
required public init(){}
}
public class SearchResultOfacNationality : Codable
{
public var country:String
required public init(){}
}
public class SearchResultOfacPlaceOfBirth : Codable
{
public var placeOfBirth:String
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .soap11 suffix or ?format=soap11
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /soap11 HTTP/1.1
Host: api.sanctionssearch.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: AddCompanySearch
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddCompanySearch xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Authentication>
<ApiUserId>String</ApiUserId>
<ApiUserKey>String</ApiUserKey>
</Authentication>
<Request>
<Address>String</Address>
<CompanyName>String</CompanyName>
<Country>String</Country>
<SelectedSanctionsLists>
<SanctionsListId>String</SanctionsListId>
</SelectedSanctionsLists>
</Request>
</AddCompanySearch>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <AddCompanySearchResponse 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> </ResponseError> </Errors> </ResponseStatus> <SearchRecord> <AffectedByUpdate>false</AffectedByUpdate> <ClientInResults>false</ClientInResults> <ClientNotInResults>false</ClientNotInResults> <DateSearched>0001-01-01T00:00:00</DateSearched> <DateUpdated>0001-01-01T00:00:00</DateUpdated> <Id>0</Id> <NumOfResults>0</NumOfResults> <SearchCriteria> <Address>String</Address> <CountryOfBirth>String</CountryOfBirth> <DateOfBirth>String</DateOfBirth> <Name>String</Name> <Nationality>String</Nationality> </SearchCriteria> <SearchResults> <HMTResults> <SearchResultHmTreasury> <Address1>String</Address1> <Address2>String</Address2> <Address3>String</Address3> <Address4>String</Address4> <Address5>String</Address5> <Address6>String</Address6> <Country>String</Country> <CountryOfBirth>String</CountryOfBirth> <DateListed>0001-01-01T00:00:00</DateListed> <DateOfBirth>String</DateOfBirth> <DateUpdated>0001-01-01T00:00:00</DateUpdated> <Name1>String</Name1> <Name2>String</Name2> <Name3>String</Name3> <Name4>String</Name4> <Name5>String</Name5> <Name6>String</Name6> <Nationality>String</Nationality> <PostCode>String</PostCode> <ResultResolved>false</ResultResolved> <ResultSimilarity>0</ResultSimilarity> <ResultStrength>0</ResultStrength> <ResultType>String</ResultType> </SearchResultHmTreasury> </HMTResults> <OfacResults> <SearchResultOfac> <Addresses> <SearchResultOfacAddress> <Address1>String</Address1> <Address2>String</Address2> <Address3>String</Address3> <City>String</City> <Country>String</Country> <PostCode>String</PostCode> <State>String</State> </SearchResultOfacAddress> </Addresses> <Akas> <SearchResultOfacAka> <FirstName>String</FirstName> <LastName>String</LastName> <Strength>String</Strength> <Type>String</Type> </SearchResultOfacAka> </Akas> <DateOfBirths> <SearchResultOfacDateOfBirth> <DateOfBirth>String</DateOfBirth> </SearchResultOfacDateOfBirth> </DateOfBirths> <DateUpdated>0001-01-01T00:00:00</DateUpdated> <FirstName>String</FirstName> <LastName>String</LastName> <Nationalities> <SearchResultOfacNationality> <Country>String</Country> </SearchResultOfacNationality> </Nationalities> <PlaceOfBirths> <SearchResultOfacPlaceOfBirth> <PlaceOfBirth>String</PlaceOfBirth> </SearchResultOfacPlaceOfBirth> </PlaceOfBirths> <ResultResolved>false</ResultResolved> <ResultSimilarity>0</ResultSimilarity> <ResultStrength>0</ResultStrength> <ResultType>String</ResultType> </SearchResultOfac> </OfacResults> </SearchResults> <SearchType>String</SearchType> </SearchRecord> </Data> </AddCompanySearchResponse> </soap:Body> </soap:Envelope>