/* Options: Date: 2025-03-15 05:24:40 SwiftVersion: 5.0 Version: 8.30 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.sanctionssearch.com/v2 //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: GetDbsSearches.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/dbs", "GET") // @DataContract public class GetDbsSearches : PagedRequest, IReturn { public typealias Return = GetDbsSearchesResponse /** * 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 var name:String /** * 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 var dateFrom:Date? /** * 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 var dateTo:Date? /** * Filter the results to those where the applicant has provided their information (true), or not (false), or either (null) */ // @DataMember // @ApiMember(Description="Filter the results to those where the applicant has provided their information (true), or not (false), or either (null)", ParameterType="query") public var isApplicantInfoCompleted:Bool? /** * Filter the results to those where the ID Checker has verified the applicant's ID (true), or not (false), or either (null) */ // @DataMember // @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") public var isIdCheckCompleted:Bool? /** * Filter the results to those where the application is complete and ready to be submitted (true), or not (false), or either (null) */ // @DataMember // @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") public var isApplicationCompleted:Bool? /** * Filter the results to those where the application has been submitted (true), or not (false), or either (null) */ // @DataMember // @ApiMember(Description="Filter the results to those where the application has been submitted (true), or not (false), or either (null)", ParameterType="query") public var isApplicationSubmitted:Bool? /** * Filter the results to those where the application has been disclosed (true), or not (false), or either (null) */ // @DataMember // @ApiMember(Description="Filter the results to those where the application has been disclosed (true), or not (false), or either (null)", ParameterType="query") public var isApplicationDisclosed:Bool? /** * 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 var subUserName:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case name case dateFrom case dateTo case isApplicantInfoCompleted case isIdCheckCompleted case isApplicationCompleted case isApplicationSubmitted case isApplicationDisclosed case subUserName } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decodeIfPresent(String.self, forKey: .name) dateFrom = try container.decodeIfPresent(Date.self, forKey: .dateFrom) dateTo = try container.decodeIfPresent(Date.self, forKey: .dateTo) isApplicantInfoCompleted = try container.decodeIfPresent(Bool.self, forKey: .isApplicantInfoCompleted) isIdCheckCompleted = try container.decodeIfPresent(Bool.self, forKey: .isIdCheckCompleted) isApplicationCompleted = try container.decodeIfPresent(Bool.self, forKey: .isApplicationCompleted) isApplicationSubmitted = try container.decodeIfPresent(Bool.self, forKey: .isApplicationSubmitted) isApplicationDisclosed = try container.decodeIfPresent(Bool.self, forKey: .isApplicationDisclosed) 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 name != nil { try container.encode(name, forKey: .name) } if dateFrom != nil { try container.encode(dateFrom, forKey: .dateFrom) } if dateTo != nil { try container.encode(dateTo, forKey: .dateTo) } if isApplicantInfoCompleted != nil { try container.encode(isApplicantInfoCompleted, forKey: .isApplicantInfoCompleted) } if isIdCheckCompleted != nil { try container.encode(isIdCheckCompleted, forKey: .isIdCheckCompleted) } if isApplicationCompleted != nil { try container.encode(isApplicationCompleted, forKey: .isApplicationCompleted) } if isApplicationSubmitted != nil { try container.encode(isApplicationSubmitted, forKey: .isApplicationSubmitted) } if isApplicationDisclosed != nil { try container.encode(isApplicationDisclosed, forKey: .isApplicationDisclosed) } if subUserName != nil { try container.encode(subUserName, forKey: .subUserName) } } } // @DataContract public class GetDbsSearchesResponse : Codable { // @DataMember public var data:GetDbsSearchesData 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 BaseRequest : IBaseRequest, Codable { /** * The authentication credentials */ // @DataMember // @ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body") public var authentication:Authentication required public init(){} } public protocol IBaseRequest { var authentication:Authentication { get set } } // @DataContract public class PagedRequest : BaseRequest { /** * The maximum number of records to be returned in one page */ // @DataMember(Name="page[limit]") // @ApiMember(Description="The maximum number of records to be returned in one page", ParameterType="query") public var page_limit_:Int /** * The starting point in the list of records from where the data should be fetched. Zero based index. */ // @DataMember(Name="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 var page_offset_:Int /** * 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 var sort:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case page_limit_ case page_offset_ case sort } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) page_limit_ = try container.decodeIfPresent(Int.self, forKey: .page_limit_) page_offset_ = try container.decodeIfPresent(Int.self, forKey: .page_offset_) sort = try container.decodeIfPresent(String.self, forKey: .sort) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if page_limit_ != nil { try container.encode(page_limit_, forKey: .page_limit_) } if page_offset_ != nil { try container.encode(page_offset_, forKey: .page_offset_) } if sort != nil { try container.encode(sort, forKey: .sort) } } } public class GetDbsSearchesData : PagedResponse { public var searches:ArrayOfDbsSearchShort required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case searches } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) searches = try container.decodeIfPresent(ArrayOfDbsSearchShort.self, forKey: .searches) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if searches != nil { try container.encode(searches, forKey: .searches) } } } 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 protocol IBaseDataResponse { var responseStatus:ResponseStatus { get set } } public protocol IHasResponseStatus { var responseStatus:ResponseStatus { get set } } public class Meta : Codable { /** * Pagination links */ // @ApiMember(Description="Pagination links") public var links:MetaLinks /** * The total number of records for the query */ // @ApiMember(Description="The total number of records for the query") public var totalCount:Int? /** * 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 var pageLimit:Int? /** * 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 var pageOffset:Int? required public init(){} } public class PagedResponse : BaseResponse { /** * The response Metadata */ // @ApiMember(Description="The response Metadata") public var meta:Meta required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case meta } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) meta = try container.decodeIfPresent(Meta.self, forKey: .meta) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if meta != nil { try container.encode(meta, forKey: .meta) } } } public class ArrayOfDbsSearchShort : List { 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 ArrayOfResponseError : List { 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 MetaLinks : Links { /** * The link to the first page of records */ // @ApiMember(Description="The link to the first page of records") public var first:String /** * The link to the last page of records */ // @ApiMember(Description="The link to the last page of records") public var last:String /** * The link to the next page of records, if applicable */ // @ApiMember(Description="The link to the next page of records, if applicable") public var next:String /** * The link to the last page of records, if applicable */ // @ApiMember(Description="The link to the last page of records, if applicable") public var prev:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case first case last case next case prev } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) first = try container.decodeIfPresent(String.self, forKey: .first) last = try container.decodeIfPresent(String.self, forKey: .last) next = try container.decodeIfPresent(String.self, forKey: .next) prev = try container.decodeIfPresent(String.self, forKey: .prev) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if first != nil { try container.encode(first, forKey: .first) } if last != nil { try container.encode(last, forKey: .last) } if next != nil { try container.encode(next, forKey: .next) } if prev != nil { try container.encode(prev, forKey: .prev) } } } public class DbsSearchShort : Codable { public var id:Int public var dateSearched:Date public var dateUpdated:Date public var status:String public var disclosureStatus:String public var isApplicantInfoCompleted:Bool public var isIdCheckCompleted:Bool public var isApplicationCompleted:Bool public var isApplicationSubmitted:Bool public var isApplicationDisclosed:Bool public var disclosureLevel:String public var name:String public var reference:String required public init(){} } public class Links : Codable { // @ApiMember() public var `self`:String required public init(){} }