""" Options: Date: 2025-03-15 04:23:36 Version: 8.30 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://api.sanctionssearch.com/v2 #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: GetClients.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ 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 """ class IBaseRequest: authentication: Optional[Authentication] = None class ClientState(str, Enum): UNDEFINED = 'Undefined' PENDING_COMPLETION = 'PendingCompletion' PENDING_OCR = 'PendingOcr' PENDING_VERIFICATION = 'PendingVerification' VERIFIED = 'Verified' @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 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 Image: id: int = 0 name: Optional[str] = None ocr_id: Optional[int] = None url: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ClientShort: id: int = 0 date_created: datetime.datetime = datetime.datetime(1, 1, 1) name: Optional[str] = None reference: Optional[str] = None is_validate_me: bool = False state: Optional[ClientState] = None links: Optional[Links] = None num_of_documents: int = 0 photo: Optional[Image] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ArrayOfClientShort(List[ClientShort]): pass @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class GetClientsData(PagedResponse[GetClients]): clients: Optional[ArrayOfClientShort] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class GetClientsResponse: data: Optional[GetClientsData] = None # @Route("/clients", "GET") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class GetClients(PagedRequest, IReturn[GetClientsResponse]): # @ApiMember(Description="Filter the results to those that have a State matching the state specified", ParameterType="query") state: Optional[ClientState] = None """ Filter the results to those that have a State matching the state specified """ # @ApiMember(Description="Filter the results to those that have a IsValidateMe flag matching the specified value", ParameterType="query") is_validate_me: Optional[bool] = None """ Filter the results to those that have a IsValidateMe flag matching the specified value """ # @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: datetime.datetime = datetime.datetime(1, 1, 1) """ 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: datetime.datetime = datetime.datetime(1, 1, 1) """ Filter the results to those that were created before this date """ # @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 """ class IBaseDataResponse: response_status: Optional[ResponseStatus] = None class IHasResponseStatus: response_status: Optional[ResponseStatus] = 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. """