GET | /clients | Get all clients |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
@DataContract
public static class GetClients extends PagedRequest
{
/**
* Filter the results to those that have a State matching the state specified
*/
@DataMember
@ApiMember(Description="Filter the results to those that have a State matching the state specified", ParameterType="query")
public ClientState state = null;
/**
* Filter the results to those that have a IsValidateMe flag matching the specified value
*/
@DataMember
@ApiMember(Description="Filter the results to those that have a IsValidateMe flag matching the specified value", ParameterType="query")
public Boolean isValidateMe = null;
/**
* Filter the results to those that have a Name including the specified value
*/
@DataMember
@ApiMember(Description="Filter the results to those that have a Name including the specified value", ParameterType="query")
public String name = null;
/**
* Filter the results to those that were created after (or on) this date
*/
@DataMember
@ApiMember(Description="Filter the results to those that were created after (or on) this date", ParameterType="query")
public Date dateFrom = null;
/**
* Filter the results to those that were created before this date
*/
@DataMember
@ApiMember(Description="Filter the results to those that were created before this date", ParameterType="query")
public Date dateTo = null;
/**
* If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view
*/
@DataMember
@ApiMember(Description="If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view", ParameterType="query")
public String subUserName = null;
public ClientState getState() { return state; }
public GetClients setState(ClientState value) { this.state = value; return this; }
public Boolean getIsValidateMe() { return isValidateMe; }
public GetClients setIsValidateMe(Boolean value) { this.isValidateMe = value; return this; }
public String getName() { return name; }
public GetClients setName(String value) { this.name = value; return this; }
public Date getDateFrom() { return dateFrom; }
public GetClients setDateFrom(Date value) { this.dateFrom = value; return this; }
public Date getDateTo() { return dateTo; }
public GetClients setDateTo(Date value) { this.dateTo = value; return this; }
public String getSubUserName() { return subUserName; }
public GetClients setSubUserName(String value) { this.subUserName = value; return this; }
}
@DataContract
public static class PagedRequest extends BaseRequest
{
/**
* The maximum number of records to be returned in one page
*/
@DataMember(Name="page[limit]")
@SerializedName("page[limit]")
@ApiMember(Description="The maximum number of records to be returned in one page", ParameterType="query")
public Integer pageLimit = null;
/**
* The starting point in the list of records from where the data should be fetched. Zero based index.
*/
@DataMember(Name="page[offset]")
@SerializedName("page[offset]")
@ApiMember(Description="The starting point in the list of records from where the data should be fetched. Zero based index.", ParameterType="query")
public Integer pageOffset = null;
/**
* The term to determine the order in which the data is returned
*/
@DataMember
@ApiMember(Description="The term to determine the order in which the data is returned", ParameterType="query")
public String sort = null;
public Integer getPageLimit() { return pageLimit; }
public PagedRequest setPageLimit(Integer value) { this.pageLimit = value; return this; }
public Integer getPageOffset() { return pageOffset; }
public PagedRequest setPageOffset(Integer value) { this.pageOffset = value; return this; }
public String getSort() { return sort; }
public PagedRequest setSort(String value) { this.sort = value; return this; }
}
@DataContract
public static class BaseRequest implements IBaseRequest
{
/**
* The authentication credentials
*/
@DataMember
@ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
public Authentication authentication = null;
public Authentication getAuthentication() { return authentication; }
public BaseRequest setAuthentication(Authentication value) { this.authentication = value; return this; }
}
@DataContract
public static class Authentication
{
/**
* 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 String apiUserId = null;
/**
* 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 String apiUserKey = null;
public String getApiUserId() { return apiUserId; }
public Authentication setApiUserId(String value) { this.apiUserId = value; return this; }
public String getApiUserKey() { return apiUserKey; }
public Authentication setApiUserKey(String value) { this.apiUserKey = value; return this; }
}
@DataContract(Name="ClientState", Namespace="http://schemas.servicestack.net/types")
public static enum ClientState
{
Undefined,
PendingCompletion,
PendingOcr,
PendingVerification,
Verified;
}
@DataContract
public static class GetClientsResponse
{
@DataMember
public GetClientsData data = null;
public GetClientsData getData() { return data; }
public GetClientsResponse setData(GetClientsData value) { this.data = value; return this; }
}
public static class GetClientsData extends PagedResponse<GetClients>
{
public ArrayOfClientShort clients = null;
public ArrayOfClientShort getClients() { return clients; }
public GetClientsData setClients(ArrayOfClientShort value) { this.clients = value; return this; }
}
public static class PagedResponse<T> extends BaseResponse
{
/**
* The response Metadata
*/
@ApiMember(Description="The response Metadata")
public Meta<T> meta = null;
public Meta<T> getMeta() { return meta; }
public PagedResponse<T> setMeta(Meta<T> value) { this.meta = value; return this; }
}
public static class BaseResponse implements IBaseDataResponse, IHasResponseStatus
{
/**
* The status of the response
*/
@ApiMember(Description="The status of the response")
public ResponseStatus responseStatus = null;
public ResponseStatus getResponseStatus() { return responseStatus; }
public BaseResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
public static class ArrayOfResponseError extends ArrayList<ResponseError>
{
}
public static class Meta<T>
{
/**
* Pagination links
*/
@ApiMember(Description="Pagination links")
public MetaLinks links = null;
/**
* The total number of records for the query
*/
@ApiMember(Description="The total number of records for the query")
public Integer totalCount = null;
/**
* The maximum number of records to be returned in one page
*/
@ApiMember(Description="The maximum number of records to be returned in one page")
public Integer pageLimit = null;
/**
* The starting point in the list of records from where the data should be fetched. Zero based index.
*/
@ApiMember(Description="The starting point in the list of records from where the data should be fetched. Zero based index.")
public Integer pageOffset = null;
public MetaLinks getLinks() { return links; }
public Meta<T> setLinks(MetaLinks value) { this.links = value; return this; }
public Integer getTotalCount() { return totalCount; }
public Meta<T> setTotalCount(Integer value) { this.totalCount = value; return this; }
public Integer getPageLimit() { return pageLimit; }
public Meta<T> setPageLimit(Integer value) { this.pageLimit = value; return this; }
public Integer getPageOffset() { return pageOffset; }
public Meta<T> setPageOffset(Integer value) { this.pageOffset = value; return this; }
}
public static class MetaLinks extends Links
{
/**
* The link to the first page of records
*/
@ApiMember(Description="The link to the first page of records")
public String first = null;
/**
* The link to the last page of records
*/
@ApiMember(Description="The link to the last page of records")
public String last = null;
/**
* The link to the next page of records, if applicable
*/
@ApiMember(Description="The link to the next page of records, if applicable")
public String next = null;
/**
* The link to the last page of records, if applicable
*/
@ApiMember(Description="The link to the last page of records, if applicable")
public String prev = null;
public String getFirst() { return first; }
public MetaLinks setFirst(String value) { this.first = value; return this; }
public String getLast() { return last; }
public MetaLinks setLast(String value) { this.last = value; return this; }
public String getNext() { return next; }
public MetaLinks setNext(String value) { this.next = value; return this; }
public String getPrev() { return prev; }
public MetaLinks setPrev(String value) { this.prev = value; return this; }
}
public static class Links
{
@ApiMember()
public String self = null;
public String getSelf() { return self; }
public Links setSelf(String value) { this.self = value; return this; }
}
public static class ArrayOfClientShort extends ArrayList<ClientShort>
{
}
public static class ClientShort
{
public Integer id = null;
public Date dateCreated = null;
public String name = null;
public String reference = null;
public Boolean isValidateMe = null;
public ClientState state = null;
public Links links = null;
public Integer numOfDocuments = null;
public Image photo = null;
public Integer getId() { return id; }
public ClientShort setId(Integer value) { this.id = value; return this; }
public Date getDateCreated() { return dateCreated; }
public ClientShort setDateCreated(Date value) { this.dateCreated = value; return this; }
public String getName() { return name; }
public ClientShort setName(String value) { this.name = value; return this; }
public String getReference() { return reference; }
public ClientShort setReference(String value) { this.reference = value; return this; }
public Boolean getIsValidateMe() { return isValidateMe; }
public ClientShort setIsValidateMe(Boolean value) { this.isValidateMe = value; return this; }
public ClientState getState() { return state; }
public ClientShort setState(ClientState value) { this.state = value; return this; }
public Links getLinks() { return links; }
public ClientShort setLinks(Links value) { this.links = value; return this; }
public Integer getNumOfDocuments() { return numOfDocuments; }
public ClientShort setNumOfDocuments(Integer value) { this.numOfDocuments = value; return this; }
public Image getPhoto() { return photo; }
public ClientShort setPhoto(Image value) { this.photo = value; return this; }
}
public static class Image
{
public Integer id = null;
public String name = null;
public Integer ocrId = null;
public String url = null;
public Integer getId() { return id; }
public Image setId(Integer value) { this.id = value; return this; }
public String getName() { return name; }
public Image setName(String value) { this.name = value; return this; }
public Integer getOcrId() { return ocrId; }
public Image setOcrId(Integer value) { this.ocrId = value; return this; }
public String getUrl() { return url; }
public Image setUrl(String value) { this.url = value; return this; }
}
}
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 /clients HTTP/1.1 Host: api.sanctionssearch.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetClientsResponse 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> <Meta> <Links> <Self>String</Self> <First>String</First> <Last>String</Last> <Next>String</Next> <Prev>String</Prev> </Links> <PageLimit>0</PageLimit> <PageOffset>0</PageOffset> <TotalCount>0</TotalCount> </Meta> <Clients> <ClientShort> <DateCreated>0001-01-01T00:00:00</DateCreated> <Id>0</Id> <IsValidateMe>false</IsValidateMe> <Links> <Self>String</Self> </Links> <Name>String</Name> <NumOfDocuments>0</NumOfDocuments> <Photo> <Id>0</Id> <Name>String</Name> <OcrId>0</OcrId> <Url>String</Url> </Photo> <Reference>String</Reference> <State>Undefined</State> </ClientShort> </Clients> </Data> </GetClientsResponse>