import * as url from 'url'; declare namespace io.apibuilder.common.v0.enums { type MembershipRole = 'member' | 'admin'; } declare namespace io.apibuilder.common.v0.models { interface Audit { readonly 'created_at': string; readonly 'created_by': io.apibuilder.common.v0.models.ReferenceGuid; readonly 'updated_at': string; readonly 'updated_by': io.apibuilder.common.v0.models.ReferenceGuid; } interface Healthcheck { readonly 'status': string; } interface Reference { readonly 'guid': string; readonly 'key': string; } interface ReferenceGuid { readonly 'guid': string; } } declare namespace io.apibuilder.spec.v0.enums { type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE'; type ParameterLocation = 'Path' | 'Query' | 'Form' | 'Header'; type ResponseCodeOption = 'Default'; } declare namespace io.apibuilder.spec.v0.models { interface Annotation { readonly 'name': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; } interface Apidoc { readonly 'version': string; } interface Application { readonly 'key': string; } interface Attribute { readonly 'name': string; readonly 'value': any/*object*/; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; } interface Body { readonly 'type': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface Contact { readonly 'name'?: string; readonly 'url'?: string; readonly 'email'?: string; } interface Deprecation { readonly 'description'?: string; } interface Enum { readonly 'name': string; readonly 'plural': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'values': io.apibuilder.spec.v0.models.EnumValue[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface EnumValue { readonly 'name': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'value'?: string; } interface Field { readonly 'name': string; readonly 'type': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'default'?: string; readonly 'required': boolean; readonly 'minimum'?: number; readonly 'maximum'?: number; readonly 'example'?: string; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'annotations': string[]; } interface Header { readonly 'name': string; readonly 'type': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'required': boolean; readonly 'default'?: string; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface Import { readonly 'uri': string; readonly 'namespace': string; readonly 'organization': io.apibuilder.spec.v0.models.Organization; readonly 'application': io.apibuilder.spec.v0.models.Application; readonly 'version': string; readonly 'enums': string[]; readonly 'interfaces': string[]; readonly 'unions': string[]; readonly 'models': string[]; readonly 'annotations': io.apibuilder.spec.v0.models.Annotation[]; } interface Info { readonly 'license'?: io.apibuilder.spec.v0.models.License; readonly 'contact'?: io.apibuilder.spec.v0.models.Contact; } interface Interface { readonly 'name': string; readonly 'plural': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'fields': io.apibuilder.spec.v0.models.Field[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface License { readonly 'name': string; readonly 'url'?: string; } interface Model { readonly 'name': string; readonly 'plural': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'fields': io.apibuilder.spec.v0.models.Field[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'interfaces': string[]; } interface Operation { readonly 'method': io.apibuilder.spec.v0.enums.Method; readonly 'path': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'body'?: io.apibuilder.spec.v0.models.Body; readonly 'parameters': io.apibuilder.spec.v0.models.Parameter[]; readonly 'responses': io.apibuilder.spec.v0.models.Response[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface Organization { readonly 'key': string; } interface Parameter { readonly 'name': string; readonly 'type': string; readonly 'location': io.apibuilder.spec.v0.enums.ParameterLocation; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'required': boolean; readonly 'default'?: string; readonly 'minimum'?: number; readonly 'maximum'?: number; readonly 'example'?: string; readonly 'attributes'?: io.apibuilder.spec.v0.models.Attribute[]; } interface Resource { readonly 'type': string; readonly 'plural': string; readonly 'path'?: string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'operations': io.apibuilder.spec.v0.models.Operation[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; } interface Response { readonly 'code': io.apibuilder.spec.v0.unions.ResponseCode; readonly 'type': string; readonly 'headers'?: io.apibuilder.spec.v0.models.Header[]; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'attributes'?: io.apibuilder.spec.v0.models.Attribute[]; } interface Service { readonly 'apidoc'?: io.apibuilder.spec.v0.models.Apidoc; readonly 'name': string; readonly 'organization': io.apibuilder.spec.v0.models.Organization; readonly 'application': io.apibuilder.spec.v0.models.Application; readonly 'namespace': string; readonly 'version': string; readonly 'base_url'?: string; readonly 'description'?: string; readonly 'info': io.apibuilder.spec.v0.models.Info; readonly 'headers': io.apibuilder.spec.v0.models.Header[]; readonly 'imports': io.apibuilder.spec.v0.models.Import[]; readonly 'enums': io.apibuilder.spec.v0.models.Enum[]; readonly 'interfaces': io.apibuilder.spec.v0.models.Interface[]; readonly 'unions': io.apibuilder.spec.v0.models.Union[]; readonly 'models': io.apibuilder.spec.v0.models.Model[]; readonly 'resources': io.apibuilder.spec.v0.models.Resource[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'annotations': io.apibuilder.spec.v0.models.Annotation[]; } interface Union { readonly 'name': string; readonly 'plural': string; readonly 'discriminator'?: string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'types': io.apibuilder.spec.v0.models.UnionType[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'interfaces': string[]; } interface UnionType { readonly 'type': string; readonly 'description'?: string; readonly 'deprecation'?: io.apibuilder.spec.v0.models.Deprecation; readonly 'fields'?: io.apibuilder.spec.v0.models.Field[]; readonly 'attributes': io.apibuilder.spec.v0.models.Attribute[]; readonly 'default'?: boolean; readonly 'discriminator_value'?: string; } } declare namespace io.apibuilder.spec.v0.unions { type ResponseCode = ({ discriminator: 'integer', value: number } | { discriminator: 'response_code_option', value: io.apibuilder.spec.v0.enums.ResponseCodeOption }); } declare namespace io.apibuilder.generator.v0.enums { type FileFlag = 'scaffolding'; } declare namespace io.apibuilder.generator.v0.models { interface Attribute { readonly 'name': string; readonly 'value': string; } interface Error { readonly 'code': string; readonly 'message': string; } interface File { readonly 'name': string; readonly 'dir'?: string; readonly 'contents': string; readonly 'flags'?: io.apibuilder.generator.v0.enums.FileFlag[]; } interface Generator { readonly 'key': string; readonly 'name': string; readonly 'language'?: string; readonly 'description'?: string; readonly 'attributes': string[]; } interface Healthcheck { readonly 'status': string; } interface Invocation { readonly 'source': string; readonly 'files': io.apibuilder.generator.v0.models.File[]; } interface InvocationForm { readonly 'service': io.apibuilder.spec.v0.models.Service; readonly 'attributes': io.apibuilder.generator.v0.models.Attribute[]; readonly 'user_agent'?: string; readonly 'imported_services'?: io.apibuilder.spec.v0.models.Service[]; } } declare namespace payp.mard2p.api.v0.enums { type AppSortBy = 'created' | 'edited'; type OriginalType = 'api_json'; type Publication = 'membership_requests.create' | 'memberships.create' | 'applications.create' | 'versions.create'; type SortOrder = 'asc' | 'desc'; type Visibility = 'public'; } declare namespace payp.mard2p.api.v0.models { interface Account { readonly 'accountid': number; readonly 'ownerid': string; readonly 'total_amount': number; readonly 'currency': string; readonly 'sold': number; readonly 'debit': number; } interface AccountForm { readonly 'accountid': number; readonly 'ownerid': string; readonly 'total_amount'?: number; readonly 'sold': number; readonly 'debit'?: number; readonly 'currency': string; } interface Deposit { readonly 'depid': number; readonly 'paymentid': number; } interface Payment { readonly 'payid': number; readonly 'actorid': string; readonly 'amount': number; readonly 'ref_accountid': number; readonly 'payment_method': string; readonly 'operatorid': string; readonly 'phone': number; readonly 'pin': number; readonly 'currency': string; readonly 'payment_context': string; } interface PaymentForm { readonly 'payid': number; readonly 'actorid': string; readonly 'amount': number; readonly 'ref_accountid': number; readonly 'payment_method': string; readonly 'operatorid': string; readonly 'phone': number; readonly 'pin': number; readonly 'currency': string; readonly 'payment_context': string; } interface Transfer { readonly 'transferid': number; readonly 'senderid': string; readonly 'amount': number; readonly 'ref_accountid_receiver': number; readonly 'ref_accountid_sender': number; readonly 'currency': string; } interface TransferForm { readonly 'transferid': number; readonly 'senderid': string; readonly 'amount': number; readonly 'ref_accountid_receiver': number; readonly 'ref_accountid_sender': number; readonly 'currency': string; } interface Validation { readonly 'valid': boolean; readonly 'errors': string[]; } interface Withdraw { readonly 'wdwid': number; readonly 'paymentid': number; } } export type Account = payp.mard2p.api.v0.models.Account; export type AccountForm = payp.mard2p.api.v0.models.AccountForm; export type AppSortBy = payp.mard2p.api.v0.enums.AppSortBy; export type Deposit = payp.mard2p.api.v0.models.Deposit; export type OriginalType = payp.mard2p.api.v0.enums.OriginalType; export type Payment = payp.mard2p.api.v0.models.Payment; export type PaymentForm = payp.mard2p.api.v0.models.PaymentForm; export type Publication = payp.mard2p.api.v0.enums.Publication; export type SortOrder = payp.mard2p.api.v0.enums.SortOrder; export type Transfer = payp.mard2p.api.v0.models.Transfer; export type TransferForm = payp.mard2p.api.v0.models.TransferForm; export type Validation = payp.mard2p.api.v0.models.Validation; export type Visibility = payp.mard2p.api.v0.enums.Visibility; export type Withdraw = payp.mard2p.api.v0.models.Withdraw; export interface $FetchOptions { body?: string; headers?: $HttpHeaders; method?: $HttpMethod; } export type $FetchFunction = (url: string, options?: $FetchOptions) => Promise; export interface $HttpHeaders { [key: string]: string; } export type $HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE'; export interface $HttpQuery { [key: string]: string | number | boolean | string[] | number[] | boolean[] | undefined | null; } export interface $HttpRequest { body?: any; url: string; headers: $HttpHeaders; method: $HttpMethod; } export interface $HttpRequestOptions { body?: any; endpoint: string; headers?: $HttpHeaders; method: $HttpMethod; query?: $HttpQuery; } export interface $HttpResponse { body: B; headers: $HttpHeaders; ok: O; request: $HttpRequest; status: S; statusText: string; } export type $HttpContinue = $HttpResponse; export type $HttpSwitchingProtocol = $HttpResponse; export type $HttpProcessing = $HttpResponse; export type $HttpOk = $HttpResponse; export type $HttpCreated = $HttpResponse; export type $HttpAccepted = $HttpResponse; export type $HttpNonAuthoritativeInformation = $HttpResponse; export type $HttpNoContent = $HttpResponse; export type $HttpResetContent = $HttpResponse; export type $HttpPartialContent = $HttpResponse; export type $HttpMultiStatus = $HttpResponse; export type $HttpAlreadyReported = $HttpResponse; export type $HttpImUsed = $HttpResponse; export type $HttpMultipleChoices = $HttpResponse; export type $HttpMovedPermanently = $HttpResponse; export type $HttpFound = $HttpResponse; export type $HttpSeeOther = $HttpResponse; export type $HttpNotModified = $HttpResponse; export type $HttpUseProxy = $HttpResponse; export type $HttpTemporaryRedirect = $HttpResponse; export type $HttpPermanentRedirect = $HttpResponse; export type $HttpBadRequest = $HttpResponse; export type $HttpUnauthorized = $HttpResponse; export type $HttpPaymentRequired = $HttpResponse; export type $HttpForbidden = $HttpResponse; export type $HttpNotFound = $HttpResponse; export type $HttpMethodNotAllowed = $HttpResponse; export type $HttpNotAcceptable = $HttpResponse; export type $HttpProxyAuthenticationRequired = $HttpResponse; export type $HttpRequestTimeout = $HttpResponse; export type $HttpConflict = $HttpResponse; export type $HttpGone = $HttpResponse; export type $HttpLengthRequired = $HttpResponse; export type $HttpPreconditionFailed = $HttpResponse; export type $HttpRequestEntityTooLarge = $HttpResponse; export type $HttpRequestUriTooLong = $HttpResponse; export type $HttpUnsupportedMediaType = $HttpResponse; export type $HttpRequestedRangeNotSatisfiable = $HttpResponse; export type $HttpExpectationFailed = $HttpResponse; export type $HttpMisdirectedRequest = $HttpResponse; export type $HttpUnprocessableEntity = $HttpResponse; export type $HttpLocked = $HttpResponse; export type $HttpFailedDependency = $HttpResponse; export type $HttpUpgradeRequired = $HttpResponse; export type $HttpPreconditionRequired = $HttpResponse; export type $HttpTooManyRequests = $HttpResponse; export type $HttpRequestHeaderFieldsTooLarge = $HttpResponse; export type $HttpNoResponse = $HttpResponse; export type $HttpRetryWith = $HttpResponse; export type $HttpBlockedByWindowsParentalControls = $HttpResponse; export type $HttpUnavailableForLegalReasons = $HttpResponse; export type $HttpClientClosedRequest = $HttpResponse; export type $HttpInternalServerError = $HttpResponse; export type $HttpNotImplemented = $HttpResponse; export type $HttpBadGateway = $HttpResponse; export type $HttpServiceUnavailable = $HttpResponse; export type $HttpGatewayTimeout = $HttpResponse; export type $HttpHttpVersionNotSupported = $HttpResponse; export type $HttpInsufficientStorage = $HttpResponse; export type $HttpLoopDetected = $HttpResponse; export type $HttpBandwidthLimitExceeded = $HttpResponse; export type $HttpNotExtended = $HttpResponse; export type $HttpNetworkAuthenticationRequired = $HttpResponse; export type $HttpNetworkReadTimeoutError = $HttpResponse; export type $HttpNetworkConnectTimeoutError = $HttpResponse; export interface $HttpClientOptions { fetch: $FetchFunction; } export function isResponseEmpty(response: Response): boolean { const contentLength = response.headers.get('Content-Length'); return response.status === 204 || contentLength != null && Number.parseInt(contentLength, 10) === 0; } export function isResponseJson(response: Response): boolean { const contentType = response.headers.get('Content-Type'); return contentType != null && contentType.indexOf('json') >= 0; } export function parseJson(response: Response): Promise { return !isResponseEmpty(response) && isResponseJson(response) ? response.json() : Promise.resolve(); } export function parseHeaders(response: Response): Record { const headers: Record = {}; response.headers.forEach((value, key) => { headers[key.toLowerCase()] = value; }); return headers; } export function stripQuery(query: $HttpQuery = {}): $HttpQuery { const initialValue: $HttpQuery = {}; return Object.keys(query).reduce((previousValue, key) => { const value = query[key]; if (value != null) previousValue[key] = value; return previousValue; }, initialValue); } export class $HttpClient { private options: $HttpClientOptions; constructor(options: $HttpClientOptions) { this.options = options; } public request(options: $HttpRequestOptions): Promise<$HttpResponse> { const finalUrl: string = url.format({ hostname: 'api.apibuilder.io', pathname: options.endpoint, protocol: 'https:', query: stripQuery(options.query), }); const finalHeaders: $HttpHeaders = { accept: 'application/json', 'content-type': 'application/json', ...options.headers, }; const request: $HttpRequest = { body: options.body, headers: finalHeaders, method: options.method, url: finalUrl, }; return this.options.fetch(request.url, { body: JSON.stringify(request.body), headers: request.headers, method: request.method, }).then((response) => { return parseJson(response).then((json) => { return { body: json, headers: parseHeaders(response), ok: response.ok, request, status: response.status, statusText: response.statusText, }; }); }); } } export class $Resource { protected client: $HttpClient; constructor(options: $HttpClientOptions) { this.client = new $HttpClient(options); } } export interface AccountsPostCreateParameters { headers?: $HttpHeaders; accountid: number; ownerid: string; total_amount: number; sold: number; debit: number; currency: string; } export interface AccountsPutUpdateByAccountidParameters { headers?: $HttpHeaders; accountid: number; ownerid: string; total_amount: number; currency: string; sold: number; debit: number; } export interface AccountsDeleteDeleteByAccountidParameters { headers?: $HttpHeaders; accountid: number; } export interface AccountsGetByAccountidParameters { headers?: $HttpHeaders; accountid: number; ownerid: string; total_amount: number; sold: number; debit: number; currency: string; } export interface AccountsGetListParameters { headers?: $HttpHeaders; accountid: number; ownerid: string; total_amount: number; currency: string; sold: number; debit: number; } export interface DepositsDeleteDeleteByDepidParameters { headers?: $HttpHeaders; depid: number; } export interface DepositsGetByDepidParameters { headers?: $HttpHeaders; depid: number; payment_method: string; actorid: string; ref_accountid: number; operatorid: string; amount: number; phone: number; pin: number; currency: string; payment_context: string; } export interface DepositsGetListParameters { headers?: $HttpHeaders; payid: number; payment_method: string; actorid: string; ref_accountid: number; operatorid: string; amount: number; phone: number; pin: number; currency: string; payment_context: string; } export interface PaymentsPostCreateParameters { headers?: $HttpHeaders; payid: number; payment_method: string; actorid: string; ref_accountid: number; operatorid: string; amount: number; currency: string; phone: number; pin: number; payment_context: string; } export interface PaymentsPutUpdateByPayidParameters { headers?: $HttpHeaders; payid: number; payment_method: string; actorid: string; ref_accountid: number; operatorid: string; amount: number; phone: number; pin: number; currency: string; payment_context: string; } export interface PaymentsDeleteDeleteByPayidParameters { headers?: $HttpHeaders; payid: number; } export interface PaymentsGetByPayidParameters { headers?: $HttpHeaders; payid: number; payment_method: string; actorid: string; ref_accountid: number; operatorid: string; amount: number; phone: number; pin: number; currency: string; payment_context: string; } export interface PaymentsGetByRefAccountidParameters { headers?: $HttpHeaders; ref_accountid: number; payid: number; payment_method: string; actorid: string; operatorid: string; amount: number; phone: number; pin: number; currency: string; payment_context: string; } export interface PaymentsGetListParameters { headers?: $HttpHeaders; payid: number; payment_method: string; actorid: string; ref_accountid: number; operatorid: string; amount: number; phone: number; pin: number; currency: string; payment_context: string; } export interface TransfersPostCreateParameters { headers?: $HttpHeaders; transferid: number; senderid: string; amount: number; currency: string; ref_accountid_receiver: number; ref_accountid_sender: number; } export interface TransfersPutUpdateByTransferidParameters { headers?: $HttpHeaders; transferid: number; senderid: string; amount: number; currency: string; ref_accountid_receiver: number; ref_accountid_sender: number; } export interface TransfersDeleteDeleteByTransferidParameters { headers?: $HttpHeaders; transferid: number; } export interface TransfersGetByTransferidParameters { headers?: $HttpHeaders; transferid: number; senderid: string; amount: number; currency: string; ref_accountid_receiver: number; ref_accountid_sender: number; } export interface TransfersGetListParameters { headers?: $HttpHeaders; transferid: number; senderid: string; amount: number; currency: string; ref_accountid_receiver: number; ref_accountid_sender: number; } export interface ValidationsPostParameters { body: string; headers?: $HttpHeaders; } export interface WithdrawsDeleteDeleteByWdwidParameters { headers?: $HttpHeaders; wdwid: number; } export interface WithdrawsGetByWdwidParameters { headers?: $HttpHeaders; wdwid: number; depid: number; payment_method: string; actorid: string; ref_accountid: number; operatorid: string; amount: number; phone: number; pin: number; currency: string; payment_context: string; } export interface WithdrawsGetListParameters { headers?: $HttpHeaders; payid: number; payment_method: string; actorid: string; ref_accountid: number; operatorid: string; amount: number; phone: number; pin: number; currency: string; payment_context: string; } export type AccountsPostCreateResponse = $HttpOk | $HttpConflict; export type AccountsPutUpdateByAccountidResponse = $HttpOk | $HttpConflict; export type AccountsDeleteDeleteByAccountidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type AccountsGetByAccountidResponse = $HttpOk | $HttpNotFound; export type AccountsGetListResponse = $HttpOk | $HttpNotFound; export type DepositsDeleteDeleteByDepidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type DepositsGetByDepidResponse = $HttpOk | $HttpNotFound; export type DepositsGetListResponse = $HttpOk | $HttpNotFound; export type PaymentsPostCreateResponse = $HttpOk | $HttpConflict; export type PaymentsPutUpdateByPayidResponse = $HttpOk | $HttpConflict; export type PaymentsDeleteDeleteByPayidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type PaymentsGetByPayidResponse = $HttpOk | $HttpNotFound; export type PaymentsGetByRefAccountidResponse = $HttpOk | $HttpNotFound; export type PaymentsGetListResponse = $HttpOk | $HttpNotFound; export type TransfersPostCreateResponse = $HttpOk | $HttpConflict; export type TransfersPutUpdateByTransferidResponse = $HttpOk | $HttpConflict; export type TransfersDeleteDeleteByTransferidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type TransfersGetByTransferidResponse = $HttpOk | $HttpNotFound; export type TransfersGetListResponse = $HttpOk | $HttpNotFound; export type ValidationsPostResponse = $HttpOk; export type WithdrawsDeleteDeleteByWdwidResponse = $HttpNoContent | $HttpUnauthorized | $HttpNotFound; export type WithdrawsGetByWdwidResponse = $HttpOk | $HttpNotFound; export type WithdrawsGetListResponse = $HttpOk | $HttpNotFound; export class AccountsResource extends $Resource { /*Used to create an account.*/ public postCreate(params: AccountsPostCreateParameters): Promise { return this.client.request({ endpoint: '/accounts/create', headers: params.headers, method: 'POST', }); } /*Used to update an account.*/ public putUpdateByAccountid(params: AccountsPutUpdateByAccountidParameters): Promise { return this.client.request({ endpoint: `/accounts/update/${encodeURIComponent(params.accountid)}`, headers: params.headers, method: 'PUT', }); } /*Delete some account.*/ public deleteDeleteByAccountid(params: AccountsDeleteDeleteByAccountidParameters): Promise { return this.client.request({ endpoint: `/accounts/delete/${encodeURIComponent(params.accountid)}`, headers: params.headers, method: 'DELETE', }); } /*Find account by its id*/ public getByAccountid(params: AccountsGetByAccountidParameters): Promise { return this.client.request({ endpoint: `/accounts/${encodeURIComponent(params.accountid)}`, headers: params.headers, method: 'GET', query: { currency: params.currency, debit: params.debit, ownerid: params.ownerid, sold: params.sold, total_amount: params.total_amount, }, }); } /*Find all the accounts.*/ public getList(params: AccountsGetListParameters): Promise { return this.client.request({ endpoint: '/accounts/list', headers: params.headers, method: 'GET', query: { accountid: params.accountid, currency: params.currency, debit: params.debit, ownerid: params.ownerid, sold: params.sold, total_amount: params.total_amount, }, }); } } export class DepositsResource extends $Resource { /*Delete some deposit.*/ public deleteDeleteByDepid(params: DepositsDeleteDeleteByDepidParameters): Promise { return this.client.request({ endpoint: `/deposits/delete/${encodeURIComponent(params.depid)}`, headers: params.headers, method: 'DELETE', }); } /*Find deposit by its id.*/ public getByDepid(params: DepositsGetByDepidParameters): Promise { return this.client.request({ endpoint: `/deposits/${encodeURIComponent(params.depid)}`, headers: params.headers, method: 'GET', query: { actorid: params.actorid, amount: params.amount, currency: params.currency, operatorid: params.operatorid, payment_context: params.payment_context, payment_method: params.payment_method, phone: params.phone, pin: params.pin, ref_accountid: params.ref_accountid, }, }); } /*List all the deposits*/ public getList(params: DepositsGetListParameters): Promise { return this.client.request({ endpoint: '/deposits/list', headers: params.headers, method: 'GET', query: { actorid: params.actorid, amount: params.amount, currency: params.currency, operatorid: params.operatorid, payid: params.payid, payment_context: params.payment_context, payment_method: params.payment_method, phone: params.phone, pin: params.pin, ref_accountid: params.ref_accountid, }, }); } } export class PaymentsResource extends $Resource { /*Used to create a payment.*/ public postCreate(params: PaymentsPostCreateParameters): Promise { return this.client.request({ endpoint: '/payments/create', headers: params.headers, method: 'POST', }); } /*Used to update a payment.*/ public putUpdateByPayid(params: PaymentsPutUpdateByPayidParameters): Promise { return this.client.request({ endpoint: `/payments/update/${encodeURIComponent(params.payid)}`, headers: params.headers, method: 'PUT', }); } /*Delete some payment.*/ public deleteDeleteByPayid(params: PaymentsDeleteDeleteByPayidParameters): Promise { return this.client.request({ endpoint: `/payments/delete/${encodeURIComponent(params.payid)}`, headers: params.headers, method: 'DELETE', }); } /*Find payment by its id.*/ public getByPayid(params: PaymentsGetByPayidParameters): Promise { return this.client.request({ endpoint: `/payments/${encodeURIComponent(params.payid)}`, headers: params.headers, method: 'GET', query: { actorid: params.actorid, amount: params.amount, currency: params.currency, operatorid: params.operatorid, payment_context: params.payment_context, payment_method: params.payment_method, phone: params.phone, pin: params.pin, ref_accountid: params.ref_accountid, }, }); } /*Find payment by id accountid*/ public getByRefAccountid(params: PaymentsGetByRefAccountidParameters): Promise { return this.client.request({ endpoint: `/payments/${encodeURIComponent(params.ref_accountid)}`, headers: params.headers, method: 'GET', query: { actorid: params.actorid, amount: params.amount, currency: params.currency, operatorid: params.operatorid, payid: params.payid, payment_context: params.payment_context, payment_method: params.payment_method, phone: params.phone, pin: params.pin, }, }); } /*List all the payments*/ public getList(params: PaymentsGetListParameters): Promise { return this.client.request({ endpoint: '/payments/list', headers: params.headers, method: 'GET', query: { actorid: params.actorid, amount: params.amount, currency: params.currency, operatorid: params.operatorid, payid: params.payid, payment_context: params.payment_context, payment_method: params.payment_method, phone: params.phone, pin: params.pin, ref_accountid: params.ref_accountid, }, }); } } export class TransfersResource extends $Resource { /*Used to create a transfer resource.*/ public postCreate(params: TransfersPostCreateParameters): Promise { return this.client.request({ endpoint: '/transfers/create', headers: params.headers, method: 'POST', }); } /*Used to update a transfer resource.*/ public putUpdateByTransferid(params: TransfersPutUpdateByTransferidParameters): Promise { return this.client.request({ endpoint: `/transfers/update/${encodeURIComponent(params.transferid)}`, headers: params.headers, method: 'PUT', }); } /*Delete some transfer.*/ public deleteDeleteByTransferid(params: TransfersDeleteDeleteByTransferidParameters): Promise { return this.client.request({ endpoint: `/transfers/delete/${encodeURIComponent(params.transferid)}`, headers: params.headers, method: 'DELETE', }); } /*Find transfer by its id*/ public getByTransferid(params: TransfersGetByTransferidParameters): Promise { return this.client.request({ endpoint: `/transfers/${encodeURIComponent(params.transferid)}`, headers: params.headers, method: 'GET', query: { amount: params.amount, currency: params.currency, ref_accountid_receiver: params.ref_accountid_receiver, ref_accountid_sender: params.ref_accountid_sender, senderid: params.senderid, }, }); } /*Find all the transfers.*/ public getList(params: TransfersGetListParameters): Promise { return this.client.request({ endpoint: '/transfers/list', headers: params.headers, method: 'GET', query: { amount: params.amount, currency: params.currency, ref_accountid_receiver: params.ref_accountid_receiver, ref_accountid_sender: params.ref_accountid_sender, senderid: params.senderid, transferid: params.transferid, }, }); } } export class ValidationsResource extends $Resource { public post(params: ValidationsPostParameters): Promise { return this.client.request({ body: params.body, endpoint: '/validations', headers: params.headers, method: 'POST', }); } } export class WithdrawsResource extends $Resource { /*Delete some withdraw.*/ public deleteDeleteByWdwid(params: WithdrawsDeleteDeleteByWdwidParameters): Promise { return this.client.request({ endpoint: `/withdraws/delete/${encodeURIComponent(params.wdwid)}`, headers: params.headers, method: 'DELETE', }); } /*Find withdraw by its id.*/ public getByWdwid(params: WithdrawsGetByWdwidParameters): Promise { return this.client.request({ endpoint: `/withdraws/${encodeURIComponent(params.wdwid)}`, headers: params.headers, method: 'GET', query: { actorid: params.actorid, amount: params.amount, currency: params.currency, depid: params.depid, operatorid: params.operatorid, payment_context: params.payment_context, payment_method: params.payment_method, phone: params.phone, pin: params.pin, ref_accountid: params.ref_accountid, }, }); } /*List all the withdraws*/ public getList(params: WithdrawsGetListParameters): Promise { return this.client.request({ endpoint: '/withdraws/list', headers: params.headers, method: 'GET', query: { actorid: params.actorid, amount: params.amount, currency: params.currency, operatorid: params.operatorid, payid: params.payid, payment_context: params.payment_context, payment_method: params.payment_method, phone: params.phone, pin: params.pin, ref_accountid: params.ref_accountid, }, }); } } export interface ClientInstance { accounts: AccountsResource; deposits: DepositsResource; payments: PaymentsResource; transfers: TransfersResource; validations: ValidationsResource; withdraws: WithdrawsResource; } export function createClient(options: $HttpClientOptions): ClientInstance { return { accounts: new AccountsResource(options), deposits: new DepositsResource(options), payments: new PaymentsResource(options), transfers: new TransfersResource(options), validations: new ValidationsResource(options), withdraws: new WithdrawsResource(options), }; }