GET | /dbs | Get all DBS Searches |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Authentication:
# @ApiMember(Description="The API User ID provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
api_user_id: Optional[str] = None
"""
The API User ID provided by us when you signed up to use our API
"""
# @ApiMember(Description="The API User Key provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
api_user_key: Optional[str] = None
"""
The API User Key provided by us when you signed up to use our API
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseRequest(IBaseRequest):
# @ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
authentication: Optional[Authentication] = None
"""
The authentication credentials
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagedRequest(BaseRequest):
# @ApiMember(Description="The maximum number of records to be returned in one page", ParameterType="query")
page_limit: int = 0
"""
The maximum number of records to be returned in one page
"""
# @ApiMember(Description="The starting point in the list of records from where the data should be fetched. Zero based index.", ParameterType="query")
page_offset: int = 0
"""
The starting point in the list of records from where the data should be fetched. Zero based index.
"""
# @ApiMember(Description="The term to determine the order in which the data is returned", ParameterType="query")
sort: Optional[str] = None
"""
The term to determine the order in which the data is returned
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDbsSearches(PagedRequest):
# @ApiMember(Description="Filter the results to those that have a Name including the specified value", ParameterType="query")
name: Optional[str] = None
"""
Filter the results to those that have a Name including the specified value
"""
# @ApiMember(Description="Filter the results to those that were created after (or on) this date", ParameterType="query")
date_from: Optional[datetime.datetime] = None
"""
Filter the results to those that were created after (or on) this date
"""
# @ApiMember(Description="Filter the results to those that were created before this date", ParameterType="query")
date_to: Optional[datetime.datetime] = None
"""
Filter the results to those that were created before this date
"""
# @ApiMember(Description="Filter the results to those where the applicant has provided their information (true), or not (false), or either (null)", ParameterType="query")
is_applicant_info_completed: Optional[bool] = None
"""
Filter the results to those where the applicant has provided their information (true), or not (false), or either (null)
"""
# @ApiMember(Description="Filter the results to those where the ID Checker has verified the applicant's ID (true), or not (false), or either (null)", ParameterType="query")
is_id_check_completed: Optional[bool] = None
"""
Filter the results to those where the ID Checker has verified the applicant's ID (true), or not (false), or either (null)
"""
# @ApiMember(Description="Filter the results to those where the application is complete and ready to be submitted (true), or not (false), or either (null)", ParameterType="query")
is_application_completed: Optional[bool] = None
"""
Filter the results to those where the application is complete and ready to be submitted (true), or not (false), or either (null)
"""
# @ApiMember(Description="Filter the results to those where the application has been submitted (true), or not (false), or either (null)", ParameterType="query")
is_application_submitted: Optional[bool] = None
"""
Filter the results to those where the application has been submitted (true), or not (false), or either (null)
"""
# @ApiMember(Description="Filter the results to those where the application has been disclosed (true), or not (false), or either (null)", ParameterType="query")
is_application_disclosed: Optional[bool] = None
"""
Filter the results to those where the application has been disclosed (true), or not (false), or either (null)
"""
# @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")
sub_user_name: Optional[str] = None
"""
If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DbsSearchShort:
id: int = 0
date_searched: datetime.datetime = datetime.datetime(1, 1, 1)
date_updated: datetime.datetime = datetime.datetime(1, 1, 1)
status: Optional[str] = None
disclosure_status: Optional[str] = None
is_applicant_info_completed: bool = False
is_id_check_completed: bool = False
is_application_completed: bool = False
is_application_submitted: bool = False
is_application_disclosed: bool = False
disclosure_level: Optional[str] = None
name: Optional[str] = None
reference: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ArrayOfDbsSearchShort(List[DbsSearchShort]):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDbsSearchesData(PagedResponse[GetDbsSearches]):
searches: Optional[ArrayOfDbsSearchShort] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDbsSearchesResponse:
data: Optional[GetDbsSearchesData] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResponseError:
error_code: Optional[str] = None
field_name: Optional[str] = None
message: Optional[str] = None
meta: Optional[Dict[str, str]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ArrayOfResponseError(List[ResponseError]):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResponseStatus:
error_code: Optional[str] = None
message: Optional[str] = None
stack_trace: Optional[str] = None
errors: Optional[ArrayOfResponseError] = None
meta: Optional[Dict[str, str]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseResponse(IBaseDataResponse, IHasResponseStatus):
# @ApiMember(Description="The status of the response")
response_status: Optional[ResponseStatus] = None
"""
The status of the response
"""
T = TypeVar('T')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagedResponse(Generic[T], BaseResponse):
# @ApiMember(Description="The response Metadata")
meta: Optional[Meta[T]] = None
"""
The response Metadata
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Links:
# @ApiMember()
self: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MetaLinks(Links):
# @ApiMember(Description="The link to the first page of records")
first: Optional[str] = None
"""
The link to the first page of records
"""
# @ApiMember(Description="The link to the last page of records")
last: Optional[str] = None
"""
The link to the last page of records
"""
# @ApiMember(Description="The link to the next page of records, if applicable")
next: Optional[str] = None
"""
The link to the next page of records, if applicable
"""
# @ApiMember(Description="The link to the last page of records, if applicable")
prev: Optional[str] = None
"""
The link to the last page of records, if applicable
"""
T = TypeVar('T')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Meta(Generic[T]):
# @ApiMember(Description="Pagination links")
links: Optional[MetaLinks] = None
"""
Pagination links
"""
# @ApiMember(Description="The total number of records for the query")
total_count: Optional[int] = None
"""
The total number of records for the query
"""
# @ApiMember(Description="The maximum number of records to be returned in one page")
page_limit: Optional[int] = None
"""
The maximum number of records to be returned in one page
"""
# @ApiMember(Description="The starting point in the list of records from where the data should be fetched. Zero based index.")
page_offset: Optional[int] = None
"""
The starting point in the list of records from where the data should be fetched. Zero based index.
"""
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 /dbs HTTP/1.1 Host: api.sanctionssearch.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetDbsSearchesResponse 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> <Searches> <SearchRecord> <DateSearched>0001-01-01T00:00:00</DateSearched> <DateUpdated>0001-01-01T00:00:00</DateUpdated> <DisclosureLevel>String</DisclosureLevel> <DisclosureStatus>String</DisclosureStatus> <Id>0</Id> <IsApplicantInfoCompleted>false</IsApplicantInfoCompleted> <IsApplicationCompleted>false</IsApplicationCompleted> <IsApplicationDisclosed>false</IsApplicationDisclosed> <IsApplicationSubmitted>false</IsApplicationSubmitted> <IsIdCheckCompleted>false</IsIdCheckCompleted> <Name>String</Name> <Reference>String</Reference> <Status>String</Status> </SearchRecord> </Searches> </Data> </GetDbsSearchesResponse>