diff --git a/Makefile b/Makefile index c6132f8..85f938f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ generator:=typescript-node -openapi-generator-cli:=docker run --user $(shell id -u):$(shell id -g) --rm -v ${PWD}:/local -w /local openapitools/openapi-generator-cli:v5.4.0 +openapi-generator-version:=5.4.0 +openapi-generator-url:=https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/$(openapi-generator-version)/openapi-generator-cli-$(openapi-generator-version).jar +openapi-generator-jar:=build/openapi-generator-cli.jar +openapi-generator-cli:=java -jar $(openapi-generator-jar) services:=balancePlatform binlookup checkout dataProtection legalEntityManagement management payments payouts platformsAccount platformsFund platformsHostedOnboardingPage platformsNotificationConfiguration recurring storedValue terminalManagement transfer # Generate models (for each service) @@ -14,6 +17,8 @@ payments: spec=PaymentService-v68 recurring: spec=RecurringService-v68 payouts: spec=PayoutService-v68 management: spec=ManagementService-v1 +managementapi: spec=ManagementService-v1 +managementapi: service=management legalEntityManagement: spec=LegalEntityService-v2 balancePlatform: spec=BalancePlatformService-v2 platformsAccount: spec=AccountService-v6 @@ -22,28 +27,48 @@ platformsNotificationConfiguration: spec=NotificationConfigurationService-v6 platformsHostedOnboardingPage: spec=HopService-v6 transfer: spec=TransferService-v3 -$(services): build/spec +$(services): build/spec $(openapi-generator-jar) rm -rf src/typings/$@ build/model $(openapi-generator-cli) generate \ -i build/spec/json/$(spec).json \ -g $(generator) \ -t templates/typescript \ -o build \ - --global-property models,supportingFiles + --global-property models,supportingFiles \ + --additional-properties=serviceName=$@ mv build/model src/typings/$@ +# Service +managementapi: build/spec $(openapi-generator-jar) + $(openapi-generator-cli) generate \ + -i build/spec/json/$(spec).json \ + -g $(generator) \ + -t templates/typescript \ + -o build \ + --api-package $(service) \ + --model-package typings/$(service) \ + --global-property apis \ + --additional-properties=serviceName=$(service) + cp build/$(service)/* src/services/$(service) + sed -i.bak '/RestServiceError/d' src/services/$(service)/* + rm src/services/$(service)/*.bak + # Checkout spec (and patch version) build/spec: git clone https://github.com/Adyen/adyen-openapi.git build/spec - sed -i 's/"openapi" : "3.[0-9].[0-9]"/"openapi" : "3.0.0"/' build/spec/json/*.json + perl -i -pe's/"openapi" : "3.[0-9].[0-9]"/"openapi" : "3.0.0"/' build/spec/json/*.json # Extract templates (copy them for modifications) -templates: +templates: $(openapi-generator-jar) $(openapi-generator-cli) author template -g $(generator) -o build/templates/typescript +# Download the generator +$(openapi-generator-jar): + wget --quiet -o /dev/null $(openapi-generator-url) -O $(openapi-generator-jar) + # Discard generated artifacts and changed models clean: - git checkout src/typings - git clean -f -d src/typings + git checkout src/typings src/services/management + git clean -f -d src/typings src/services/management .PHONY: templates models $(services) diff --git a/src/__tests__/management.spec.ts b/src/__tests__/management.spec.ts index 15ac954..713ed7f 100644 --- a/src/__tests__/management.spec.ts +++ b/src/__tests__/management.spec.ts @@ -690,4 +690,40 @@ describe("Management", (): void => { expect(response).toBeTruthy(); }); }); + + describe("AllowedOriginsMerchantLevelApi", (): void => { + test("Delete an allowed origin", async () => { + scope.delete("/merchants/foo/apiCredentials/BAR123/allowedOrigins/fishy%20one").reply(204); + + await managementService.AllowedOriginsMerchantLevelApi + .deleteAllowedOrigin("foo", "BAR123", "fishy one"); + }); + + test("Create an allowed origin", async () => { + const requestBody = { + "domain": "https://www.eu.mystore.com" + }; + scope.post("/merchants/YOUR_MERCHANT_ACCOUNT/apiCredentials/YOUR_API_CREDENTIAL/allowedOrigins", requestBody) + .reply(200, { + "id": "YOUR_ALLOWED_ORIGIN", + "data": [ + { + "domain": "https://www.eu.mystore.com", + } + ], + "_links": { + "self": { + "href": "https://management-test.adyen.com/v1/merchants/YOUR_MERCHANT_ACCOUNT/apiCredentials/YOUR_API_CREDENTIAL/allowedOrigins/YOUR_ALLOWED_ORIGIN" + } + } + }); + + const response: management.AllowedOriginsResponse = await managementService.AllowedOriginsMerchantLevelApi + .createAllowedOrigin("YOUR_MERCHANT_ACCOUNT", "YOUR_API_CREDENTIAL", { + domain: "https://www.eu.mystore.com", + }); + + expect(response.data![0].domain).toEqual("https://www.eu.mystore.com"); + }); + }); }); diff --git a/src/services/management.ts b/src/services/management.ts index 5a46e07..0e4447f 100644 --- a/src/services/management.ts +++ b/src/services/management.ts @@ -1,6 +1,7 @@ import Service from "../service"; import Client from "../client"; +// Deprecated classes import MeApi from "./management/meApi"; import MerchantAccount from "./management/merchantAccount"; import MerchantAllowedOrigins from "./management/merchantAllowedOrigins"; @@ -14,59 +15,208 @@ import MerchantTerminalSettings from "./management/merchantTerminalSettings"; import MerchantUsers from "./management/merchantUsers"; import MerchantWebhooks from "./management/merchantWebhooks"; +// Recommended classes +import APICredentialsCompanyLevelApi from './management/aPICredentialsCompanyLevelApi'; +import APICredentialsMerchantLevelApi from './management/aPICredentialsMerchantLevelApi'; +import APIKeyCompanyLevelApi from './management/aPIKeyCompanyLevelApi'; +import APIKeyMerchantLevelApi from './management/aPIKeyMerchantLevelApi'; +import AccountCompanyLevelApi from './management/accountCompanyLevelApi'; +import AccountMerchantLevelApi from './management/accountMerchantLevelApi'; +import AccountStoreLevelApi from './management/accountStoreLevelApi'; +import AllowedOriginsCompanyLevelApi from './management/allowedOriginsCompanyLevelApi'; +import AllowedOriginsMerchantLevelApi from './management/allowedOriginsMerchantLevelApi'; +import ClientKeyCompanyLevelApi from './management/clientKeyCompanyLevelApi'; +import ClientKeyMerchantLevelApi from './management/clientKeyMerchantLevelApi'; +import MyAPICredentialApi from './management/myAPICredentialApi'; +import PaymentMethodsMerchantLevelApi from './management/paymentMethodsMerchantLevelApi'; +import PayoutSettingsMerchantLevelApi from './management/payoutSettingsMerchantLevelApi'; +import TerminalActionsCompanyLevelApi from './management/terminalActionsCompanyLevelApi'; +import TerminalActionsTerminalLevelApi from './management/terminalActionsTerminalLevelApi'; +import TerminalOrdersCompanyLevelApi from './management/terminalOrdersCompanyLevelApi'; +import TerminalOrdersMerchantLevelApi from './management/terminalOrdersMerchantLevelApi'; +import TerminalSettingsCompanyLevelApi from './management/terminalSettingsCompanyLevelApi'; +import TerminalSettingsMerchantLevelApi from './management/terminalSettingsMerchantLevelApi'; +import TerminalSettingsStoreLevelApi from './management/terminalSettingsStoreLevelApi'; +import TerminalSettingsTerminalLevelApi from './management/terminalSettingsTerminalLevelApi'; +import TerminalsTerminalLevelApi from './management/terminalsTerminalLevelApi'; +import UsersCompanyLevelApi from './management/usersCompanyLevelApi'; +import UsersMerchantLevelApi from './management/usersMerchantLevelApi'; +import WebhooksCompanyLevelApi from './management/webhooksCompanyLevelApi'; +import WebhooksMerchantLevelApi from './management/webhooksMerchantLevelApi'; + class Management extends Service { public constructor(client: Client) { super(client); } + /** + * @deprecated + */ public get Me() { const meApi = new MeApi(this.client); return meApi.Me; } + /** + * @deprecated + */ public get MerchantAccount() { return new MerchantAccount(this.client); } + /** + * @deprecated + */ public get MerchantAllowedOrigins() { return new MerchantAllowedOrigins(this.client); } + /** + * @deprecated + */ public get MerchantApiCredentials() { return new MerchantApiCredentials(this.client); } + /** + * @deprecated + */ public get MerchantApiKey() { return new MerchantApiKey(this.client); } + /** + * @deprecated + */ public get MerchantClientKey() { return new MerchantClientKey(this.client); } + /** + * @deprecated + */ public get MerchantPaymentMethods() { return new MerchantPaymentMethods(this.client); } + /** + * @deprecated + */ public get MerchantPayoutSettings() { return new MerchantPayoutSettings(this.client); } + /** + * @deprecated + */ public get MerchantTerminalOrders() { return new MerchantTerminalOrders(this.client); } + /** + * @deprecated + */ public get MerchantTerminalSettings() { return new MerchantTerminalSettings(this.client); } + /** + * @deprecated + */ public get MerchantUsers() { return new MerchantUsers(this.client); } + /** + * @deprecated + */ public get MerchantWebhooks() { return new MerchantWebhooks(this.client); } + + // ## Recommended classes + + public get APICredentialsCompanyLevelApi() { + return new APICredentialsCompanyLevelApi(this.client); + } + public get APICredentialsMerchantLevelApi() { + return new APICredentialsMerchantLevelApi(this.client); + } + public get APIKeyCompanyLevelApi() { + return new APIKeyCompanyLevelApi(this.client); + } + public get APIKeyMerchantLevelApi() { + return new APIKeyMerchantLevelApi(this.client); + } + public get AccountCompanyLevelApi() { + return new AccountCompanyLevelApi(this.client); + } + public get AccountMerchantLevelApi() { + return new AccountMerchantLevelApi(this.client); + } + public get AccountStoreLevelApi() { + return new AccountStoreLevelApi(this.client); + } + public get AllowedOriginsCompanyLevelApi() { + return new AllowedOriginsCompanyLevelApi(this.client); + } + public get AllowedOriginsMerchantLevelApi() { + return new AllowedOriginsMerchantLevelApi(this.client); + } + public get ClientKeyCompanyLevelApi() { + return new ClientKeyCompanyLevelApi(this.client); + } + public get ClientKeyMerchantLevelApi() { + return new ClientKeyMerchantLevelApi(this.client); + } + public get MyAPICredentialApi() { + return new MyAPICredentialApi(this.client); + } + public get PaymentMethodsMerchantLevelApi() { + return new PaymentMethodsMerchantLevelApi(this.client); + } + public get PayoutSettingsMerchantLevelApi() { + return new PayoutSettingsMerchantLevelApi(this.client); + } + public get TerminalActionsCompanyLevelApi() { + return new TerminalActionsCompanyLevelApi(this.client); + } + public get TerminalActionsTerminalLevelApi() { + return new TerminalActionsTerminalLevelApi(this.client); + } + public get TerminalOrdersCompanyLevelApi() { + return new TerminalOrdersCompanyLevelApi(this.client); + } + public get TerminalOrdersMerchantLevelApi() { + return new TerminalOrdersMerchantLevelApi(this.client); + } + public get TerminalSettingsCompanyLevelApi() { + return new TerminalSettingsCompanyLevelApi(this.client); + } + public get TerminalSettingsMerchantLevelApi() { + return new TerminalSettingsMerchantLevelApi(this.client); + } + public get TerminalSettingsStoreLevelApi() { + return new TerminalSettingsStoreLevelApi(this.client); + } + public get TerminalSettingsTerminalLevelApi() { + return new TerminalSettingsTerminalLevelApi(this.client); + } + public get TerminalsTerminalLevelApi() { + return new TerminalsTerminalLevelApi(this.client); + } + public get UsersCompanyLevelApi() { + return new UsersCompanyLevelApi(this.client); + } + public get UsersMerchantLevelApi() { + return new UsersMerchantLevelApi(this.client); + } + public get WebhooksCompanyLevelApi() { + return new WebhooksCompanyLevelApi(this.client); + } + public get WebhooksMerchantLevelApi() { + return new WebhooksMerchantLevelApi(this.client); + } } export default Management; diff --git a/src/services/management/aPICredentialsCompanyLevelApi.ts b/src/services/management/aPICredentialsCompanyLevelApi.ts new file mode 100644 index 0000000..f88f2e7 --- /dev/null +++ b/src/services/management/aPICredentialsCompanyLevelApi.ts @@ -0,0 +1,95 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { CompanyApiCredential } from '../../typings/management/models'; +import { CreateCompanyApiCredentialRequest } from '../../typings/management/models'; +import { CreateCompanyApiCredentialResponse } from '../../typings/management/models'; +import { ListCompanyApiCredentialsResponse } from '../../typings/management/models'; +import { UpdateCompanyApiCredentialRequest } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class APICredentialsCompanyLevelApi extends Service { + /** + * @summary Get a list of API credentials + * @param companyId The unique identifier of the company account. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + */ + public async listApiCredentials(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListCompanyApiCredentialsResponse"); + } + /** + * @summary Get an API credential + * @param companyId The unique identifier of the company account. + * @param apiCredentialId Unique identifier of the API credential. + */ + public async getApiCredential(companyId: string, apiCredentialId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials/{apiCredentialId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "CompanyApiCredential"); + } + /** + * @summary Update an API credential. + * @param companyId The unique identifier of the company account. + * @param apiCredentialId Unique identifier of the API credential. + * @param updateCompanyApiCredentialRequest + */ + public async updateApiCredential(companyId: string, apiCredentialId: string, updateCompanyApiCredentialRequest: UpdateCompanyApiCredentialRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials/{apiCredentialId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdateCompanyApiCredentialRequest = ObjectSerializer.serialize(updateCompanyApiCredentialRequest, "UpdateCompanyApiCredentialRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "CompanyApiCredential"); + } + /** + * @summary Create an API credential. + * @param companyId The unique identifier of the company account. + * @param createCompanyApiCredentialRequest + */ + public async createApiCredential(companyId: string, createCompanyApiCredentialRequest: CreateCompanyApiCredentialRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const request: CreateCompanyApiCredentialRequest = ObjectSerializer.serialize(createCompanyApiCredentialRequest, "CreateCompanyApiCredentialRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "CreateCompanyApiCredentialResponse"); + } +} diff --git a/src/services/management/aPICredentialsMerchantLevelApi.ts b/src/services/management/aPICredentialsMerchantLevelApi.ts new file mode 100644 index 0000000..94e46cc --- /dev/null +++ b/src/services/management/aPICredentialsMerchantLevelApi.ts @@ -0,0 +1,95 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { ApiCredential } from '../../typings/management/models'; +import { CreateApiCredentialResponse } from '../../typings/management/models'; +import { CreateMerchantApiCredentialRequest } from '../../typings/management/models'; +import { ListMerchantApiCredentialsResponse } from '../../typings/management/models'; +import { UpdateMerchantApiCredentialRequest } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class APICredentialsMerchantLevelApi extends Service { + /** + * @summary Get a list of API credentials + * @param merchantId The unique identifier of the merchant account. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + */ + public async listApiCredentials(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListMerchantApiCredentialsResponse"); + } + /** + * @summary Get an API credential + * @param merchantId The unique identifier of the merchant account. + * @param apiCredentialId Unique identifier of the API credential. + */ + public async getApiCredential(merchantId: string, apiCredentialId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ApiCredential"); + } + /** + * @summary Update an API credential + * @param merchantId The unique identifier of the merchant account. + * @param apiCredentialId Unique identifier of the API credential. + * @param updateMerchantApiCredentialRequest + */ + public async updateApiCredential(merchantId: string, apiCredentialId: string, updateMerchantApiCredentialRequest: UpdateMerchantApiCredentialRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdateMerchantApiCredentialRequest = ObjectSerializer.serialize(updateMerchantApiCredentialRequest, "UpdateMerchantApiCredentialRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "ApiCredential"); + } + /** + * @summary Create an API credential + * @param merchantId The unique identifier of the merchant account. + * @param createMerchantApiCredentialRequest + */ + public async createApiCredential(merchantId: string, createMerchantApiCredentialRequest: CreateMerchantApiCredentialRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: CreateMerchantApiCredentialRequest = ObjectSerializer.serialize(createMerchantApiCredentialRequest, "CreateMerchantApiCredentialRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "CreateApiCredentialResponse"); + } +} diff --git a/src/services/management/aPIKeyCompanyLevelApi.ts b/src/services/management/aPIKeyCompanyLevelApi.ts new file mode 100644 index 0000000..f4faaa1 --- /dev/null +++ b/src/services/management/aPIKeyCompanyLevelApi.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { GenerateApiKeyResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class APIKeyCompanyLevelApi extends Service { + /** + * @summary Generate new API key + * @param companyId The unique identifier of the company account. + * @param apiCredentialId Unique identifier of the API credential. + */ + public async generateNewApiKey(companyId: string, apiCredentialId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "GenerateApiKeyResponse"); + } +} diff --git a/src/services/management/aPIKeyMerchantLevelApi.ts b/src/services/management/aPIKeyMerchantLevelApi.ts new file mode 100644 index 0000000..960cdb9 --- /dev/null +++ b/src/services/management/aPIKeyMerchantLevelApi.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { GenerateApiKeyResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class APIKeyMerchantLevelApi extends Service { + /** + * @summary Generate new API key + * @param merchantId The unique identifier of the merchant account. + * @param apiCredentialId Unique identifier of the API credential. + */ + public async generateNewApiKey(merchantId: string, apiCredentialId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "GenerateApiKeyResponse"); + } +} diff --git a/src/services/management/accountCompanyLevelApi.ts b/src/services/management/accountCompanyLevelApi.ts new file mode 100644 index 0000000..440b491 --- /dev/null +++ b/src/services/management/accountCompanyLevelApi.ts @@ -0,0 +1,70 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { Company } from '../../typings/management/models'; +import { ListCompanyResponse } from '../../typings/management/models'; +import { ListMerchantResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class AccountCompanyLevelApi extends Service { + /** + * @summary Get a list of company accounts + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + */ + public async listCompanyAccounts(requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies"; + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListCompanyResponse"); + } + /** + * @summary Get a company account + * @param companyId The unique identifier of the company account. + */ + public async getCompanyAccount(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Company"); + } + /** + * @summary Get a list of merchant accounts + * @param companyId The unique identifier of the company account. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + */ + public async listMerchantAccounts(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/merchants" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListMerchantResponse"); + } +} diff --git a/src/services/management/accountMerchantLevelApi.ts b/src/services/management/accountMerchantLevelApi.ts new file mode 100644 index 0000000..0756aff --- /dev/null +++ b/src/services/management/accountMerchantLevelApi.ts @@ -0,0 +1,85 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { CreateMerchantRequest } from '../../typings/management/models'; +import { CreateMerchantResponse } from '../../typings/management/models'; +import { ListMerchantResponse } from '../../typings/management/models'; +import { Merchant } from '../../typings/management/models'; +import { RequestActivationResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class AccountMerchantLevelApi extends Service { + /** + * @summary Get a list of merchant accounts + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + */ + public async listMerchantAccounts(requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants"; + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListMerchantResponse"); + } + /** + * @summary Get a merchant account + * @param merchantId The unique identifier of the merchant account. + */ + public async getMerchantAccount(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Merchant"); + } + /** + * @summary Create a merchant account + * @param createMerchantRequest + */ + public async createMerchantAccount(createMerchantRequest: CreateMerchantRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants"; + const resource = new ManagementResource(this, localVarPath); + const request: CreateMerchantRequest = ObjectSerializer.serialize(createMerchantRequest, "CreateMerchantRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "CreateMerchantResponse"); + } + /** + * @summary Request to activate a merchant account + * @param merchantId The unique identifier of the merchant account. + */ + public async requestToActivateMerchantAccount(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/activate" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "RequestActivationResponse"); + } +} diff --git a/src/services/management/accountStoreLevelApi.ts b/src/services/management/accountStoreLevelApi.ts new file mode 100644 index 0000000..bb6cd84 --- /dev/null +++ b/src/services/management/accountStoreLevelApi.ts @@ -0,0 +1,160 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { ListStoresResponse } from '../../typings/management/models'; +import { Store } from '../../typings/management/models'; +import { StoreCreationRequest } from '../../typings/management/models'; +import { StoreCreationWithMerchantCodeRequest } from '../../typings/management/models'; +import { UpdateStoreRequest } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class AccountStoreLevelApi extends Service { + /** + * @summary Get a list of stores + * @param merchantId The unique identifier of the merchant account. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + * @param reference The reference of the store. + */ + public async listStoresByMerchantId(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/stores" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListStoresResponse"); + } + /** + * @summary Get a store + * @param merchantId The unique identifier of the merchant account. + * @param storeId The unique identifier of the store. + */ + public async getStore(merchantId: string, storeId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/stores/{storeId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'storeId' + '}', encodeURIComponent(String(storeId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Store"); + } + /** + * @summary Get a list of stores + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + * @param reference The reference of the store. + * @param merchantId The unique identifier of the merchant account. + */ + public async listStores(requestOptions?: IRequest.Options): Promise { + const localVarPath = "/stores"; + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListStoresResponse"); + } + /** + * @summary Get a store + * @param storeId The unique identifier of the store. + */ + public async getStoreById(storeId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/stores/{storeId}" + .replace('{' + 'storeId' + '}', encodeURIComponent(String(storeId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Store"); + } + /** + * @summary Update a store + * @param merchantId The unique identifier of the merchant account. + * @param storeId The unique identifier of the store. + * @param updateStoreRequest + */ + public async updateStore(merchantId: string, storeId: string, updateStoreRequest: UpdateStoreRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/stores/{storeId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'storeId' + '}', encodeURIComponent(String(storeId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdateStoreRequest = ObjectSerializer.serialize(updateStoreRequest, "UpdateStoreRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Store"); + } + /** + * @summary Update a store + * @param storeId The unique identifier of the store. + * @param updateStoreRequest + */ + public async updateStoreById(storeId: string, updateStoreRequest: UpdateStoreRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/stores/{storeId}" + .replace('{' + 'storeId' + '}', encodeURIComponent(String(storeId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdateStoreRequest = ObjectSerializer.serialize(updateStoreRequest, "UpdateStoreRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Store"); + } + /** + * @summary Create a store + * @param merchantId The unique identifier of the merchant account. + * @param storeCreationRequest + */ + public async createStoreByMerchantId(merchantId: string, storeCreationRequest: StoreCreationRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/stores" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: StoreCreationRequest = ObjectSerializer.serialize(storeCreationRequest, "StoreCreationRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "Store"); + } + /** + * @summary Create a store + * @param storeCreationWithMerchantCodeRequest + */ + public async createStore(storeCreationWithMerchantCodeRequest: StoreCreationWithMerchantCodeRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/stores"; + const resource = new ManagementResource(this, localVarPath); + const request: StoreCreationWithMerchantCodeRequest = ObjectSerializer.serialize(storeCreationWithMerchantCodeRequest, "StoreCreationWithMerchantCodeRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "Store"); + } +} diff --git a/src/services/management/allowedOriginsCompanyLevelApi.ts b/src/services/management/allowedOriginsCompanyLevelApi.ts new file mode 100644 index 0000000..047f18f --- /dev/null +++ b/src/services/management/allowedOriginsCompanyLevelApi.ts @@ -0,0 +1,95 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { AllowedOrigin } from '../../typings/management/models'; +import { AllowedOriginsResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class AllowedOriginsCompanyLevelApi extends Service { + /** + * @summary Delete an allowed origin + * @param companyId The unique identifier of the company account. + * @param apiCredentialId Unique identifier of the API credential. + * @param originId Unique identifier of the allowed origin. + */ + public async deleteAllowedOrigin(companyId: string, apiCredentialId: string, originId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))) + .replace('{' + 'originId' + '}', encodeURIComponent(String(originId))); + const resource = new ManagementResource(this, localVarPath); + await getJsonResponse( + resource, + "", + { ...requestOptions, method: "DELETE" } + ); + } + /** + * @summary Get a list of allowed origins + * @param companyId The unique identifier of the company account. + * @param apiCredentialId Unique identifier of the API credential. + */ + public async listAllowedOrigins(companyId: string, apiCredentialId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AllowedOriginsResponse"); + } + /** + * @summary Get an allowed origin + * @param companyId The unique identifier of the company account. + * @param apiCredentialId Unique identifier of the API credential. + * @param originId Unique identifier of the allowed origin. + */ + public async getAllowedOrigin(companyId: string, apiCredentialId: string, originId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))) + .replace('{' + 'originId' + '}', encodeURIComponent(String(originId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AllowedOrigin"); + } + /** + * @summary Create an allowed origin + * @param companyId The unique identifier of the company account. + * @param apiCredentialId Unique identifier of the API credential. + * @param allowedOrigin + */ + public async createAllowedOrigin(companyId: string, apiCredentialId: string, allowedOrigin: AllowedOrigin, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const request: AllowedOrigin = ObjectSerializer.serialize(allowedOrigin, "AllowedOrigin"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "AllowedOriginsResponse"); + } +} diff --git a/src/services/management/allowedOriginsMerchantLevelApi.ts b/src/services/management/allowedOriginsMerchantLevelApi.ts new file mode 100644 index 0000000..6d7c53f --- /dev/null +++ b/src/services/management/allowedOriginsMerchantLevelApi.ts @@ -0,0 +1,95 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { AllowedOrigin } from '../../typings/management/models'; +import { AllowedOriginsResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class AllowedOriginsMerchantLevelApi extends Service { + /** + * @summary Delete an allowed origin + * @param merchantId The unique identifier of the merchant account. + * @param apiCredentialId Unique identifier of the API credential. + * @param originId Unique identifier of the allowed origin. + */ + public async deleteAllowedOrigin(merchantId: string, apiCredentialId: string, originId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))) + .replace('{' + 'originId' + '}', encodeURIComponent(String(originId))); + const resource = new ManagementResource(this, localVarPath); + await getJsonResponse( + resource, + "", + { ...requestOptions, method: "DELETE" } + ); + } + /** + * @summary Get a list of allowed origins + * @param merchantId The unique identifier of the merchant account. + * @param apiCredentialId Unique identifier of the API credential. + */ + public async listAllowedOrigins(merchantId: string, apiCredentialId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AllowedOriginsResponse"); + } + /** + * @summary Get an allowed origin + * @param merchantId The unique identifier of the merchant account. + * @param apiCredentialId Unique identifier of the API credential. + * @param originId Unique identifier of the allowed origin. + */ + public async getAllowedOrigin(merchantId: string, apiCredentialId: string, originId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))) + .replace('{' + 'originId' + '}', encodeURIComponent(String(originId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AllowedOrigin"); + } + /** + * @summary Create an allowed origin + * @param merchantId The unique identifier of the merchant account. + * @param apiCredentialId Unique identifier of the API credential. + * @param allowedOrigin + */ + public async createAllowedOrigin(merchantId: string, apiCredentialId: string, allowedOrigin: AllowedOrigin, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const request: AllowedOrigin = ObjectSerializer.serialize(allowedOrigin, "AllowedOrigin"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "AllowedOriginsResponse"); + } +} diff --git a/src/services/management/clientKeyCompanyLevelApi.ts b/src/services/management/clientKeyCompanyLevelApi.ts new file mode 100644 index 0000000..1bd9089 --- /dev/null +++ b/src/services/management/clientKeyCompanyLevelApi.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { GenerateClientKeyResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class ClientKeyCompanyLevelApi extends Service { + /** + * @summary Generate new client key + * @param companyId The unique identifier of the company account. + * @param apiCredentialId Unique identifier of the API credential. + */ + public async generateNewClientKey(companyId: string, apiCredentialId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "GenerateClientKeyResponse"); + } +} diff --git a/src/services/management/clientKeyMerchantLevelApi.ts b/src/services/management/clientKeyMerchantLevelApi.ts new file mode 100644 index 0000000..af57b89 --- /dev/null +++ b/src/services/management/clientKeyMerchantLevelApi.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { GenerateClientKeyResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class ClientKeyMerchantLevelApi extends Service { + /** + * @summary Generate new client key + * @param merchantId The unique identifier of the merchant account. + * @param apiCredentialId Unique identifier of the API credential. + */ + public async generateNewClientKey(merchantId: string, apiCredentialId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'apiCredentialId' + '}', encodeURIComponent(String(apiCredentialId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "GenerateClientKeyResponse"); + } +} diff --git a/src/services/management/myAPICredentialApi.ts b/src/services/management/myAPICredentialApi.ts new file mode 100644 index 0000000..7edb681 --- /dev/null +++ b/src/services/management/myAPICredentialApi.ts @@ -0,0 +1,94 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { AllowedOrigin } from '../../typings/management/models'; +import { AllowedOriginsResponse } from '../../typings/management/models'; +import { CreateAllowedOriginRequest } from '../../typings/management/models'; +import { MeApiCredential } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class MyAPICredentialApi extends Service { + /** + * @summary Remove allowed origin + * @param originId Unique identifier of the allowed origin. + */ + public async removeAllowedOrigin(originId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/me/allowedOrigins/{originId}" + .replace('{' + 'originId' + '}', encodeURIComponent(String(originId))); + const resource = new ManagementResource(this, localVarPath); + await getJsonResponse( + resource, + "", + { ...requestOptions, method: "DELETE" } + ); + } + /** + * @summary Get API credential details + */ + public async getApiCredentialDetails(requestOptions?: IRequest.Options): Promise { + const localVarPath = "/me"; + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "MeApiCredential"); + } + /** + * @summary Get allowed origins + */ + public async getAllowedOrigins(requestOptions?: IRequest.Options): Promise { + const localVarPath = "/me/allowedOrigins"; + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AllowedOriginsResponse"); + } + /** + * @summary Get allowed origin details + * @param originId Unique identifier of the allowed origin. + */ + public async getAllowedOriginDetails(originId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/me/allowedOrigins/{originId}" + .replace('{' + 'originId' + '}', encodeURIComponent(String(originId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AllowedOrigin"); + } + /** + * @summary Add allowed origin + * @param createAllowedOriginRequest + */ + public async addAllowedOrigin(createAllowedOriginRequest: CreateAllowedOriginRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/me/allowedOrigins"; + const resource = new ManagementResource(this, localVarPath); + const request: CreateAllowedOriginRequest = ObjectSerializer.serialize(createAllowedOriginRequest, "CreateAllowedOriginRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "AllowedOriginsResponse"); + } +} diff --git a/src/services/management/paymentMethodsMerchantLevelApi.ts b/src/services/management/paymentMethodsMerchantLevelApi.ts new file mode 100644 index 0000000..a9e45c1 --- /dev/null +++ b/src/services/management/paymentMethodsMerchantLevelApi.ts @@ -0,0 +1,132 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { ApplePayInfo } from '../../typings/management/models'; +import { PaymentMethod } from '../../typings/management/models'; +import { PaymentMethodResponse } from '../../typings/management/models'; +import { PaymentMethodSetupInfo } from '../../typings/management/models'; +import { UpdatePaymentMethodInfo } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class PaymentMethodsMerchantLevelApi extends Service { + /** + * @summary Get all payment methods + * @param merchantId The unique identifier of the merchant account. + * @param storeId The unique identifier of the store for which to return the payment methods. + * @param businessLineId The unique identifier of the Business Line for which to return the payment methods. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + * @param pageNumber The number of the page to fetch. + */ + public async getAllPaymentMethods(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/paymentMethodSettings" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PaymentMethodResponse"); + } + /** + * @summary Get payment method details + * @param merchantId The unique identifier of the merchant account. + * @param paymentMethodId The unique identifier of the payment method. + */ + public async getPaymentMethodDetails(merchantId: string, paymentMethodId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'paymentMethodId' + '}', encodeURIComponent(String(paymentMethodId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PaymentMethod"); + } + /** + * @summary Get Apple Pay domains + * @param merchantId The unique identifier of the merchant account. + * @param paymentMethodId The unique identifier of the payment method. + */ + public async getApplePayDomains(merchantId: string, paymentMethodId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'paymentMethodId' + '}', encodeURIComponent(String(paymentMethodId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ApplePayInfo"); + } + /** + * @summary Update a payment method + * @param merchantId The unique identifier of the merchant account. + * @param paymentMethodId The unique identifier of the payment method. + * @param updatePaymentMethodInfo + */ + public async updatePaymentMethod(merchantId: string, paymentMethodId: string, updatePaymentMethodInfo: UpdatePaymentMethodInfo, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'paymentMethodId' + '}', encodeURIComponent(String(paymentMethodId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdatePaymentMethodInfo = ObjectSerializer.serialize(updatePaymentMethodInfo, "UpdatePaymentMethodInfo"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "PaymentMethod"); + } + /** + * @summary Request a payment method + * @param merchantId The unique identifier of the merchant account. + * @param paymentMethodSetupInfo + */ + public async requestPaymentMethod(merchantId: string, paymentMethodSetupInfo: PaymentMethodSetupInfo, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/paymentMethodSettings" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: PaymentMethodSetupInfo = ObjectSerializer.serialize(paymentMethodSetupInfo, "PaymentMethodSetupInfo"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "PaymentMethod"); + } + /** + * @summary Add an Apple Pay domain + * @param merchantId The unique identifier of the merchant account. + * @param paymentMethodId The unique identifier of the payment method. + * @param applePayInfo + */ + public async addApplePayDomain(merchantId: string, paymentMethodId: string, applePayInfo: ApplePayInfo, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'paymentMethodId' + '}', encodeURIComponent(String(paymentMethodId))); + const resource = new ManagementResource(this, localVarPath); + const request: ApplePayInfo = ObjectSerializer.serialize(applePayInfo, "ApplePayInfo"); + await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + } +} diff --git a/src/services/management/payoutSettingsMerchantLevelApi.ts b/src/services/management/payoutSettingsMerchantLevelApi.ts new file mode 100644 index 0000000..6819c39 --- /dev/null +++ b/src/services/management/payoutSettingsMerchantLevelApi.ts @@ -0,0 +1,108 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { PayoutSettings } from '../../typings/management/models'; +import { PayoutSettingsRequest } from '../../typings/management/models'; +import { PayoutSettingsResponse } from '../../typings/management/models'; +import { UpdatePayoutSettingsRequest } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class PayoutSettingsMerchantLevelApi extends Service { + /** + * @summary Delete a payout setting + * @param merchantId The unique identifier of the merchant account. + * @param payoutSettingsId The unique identifier of the payout setting. + */ + public async deletePayoutSetting(merchantId: string, payoutSettingsId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'payoutSettingsId' + '}', encodeURIComponent(String(payoutSettingsId))); + const resource = new ManagementResource(this, localVarPath); + await getJsonResponse( + resource, + "", + { ...requestOptions, method: "DELETE" } + ); + } + /** + * @summary Get a list of payout settings + * @param merchantId The unique identifier of the merchant account. + */ + public async listPayoutSettings(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/payoutSettings" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PayoutSettingsResponse"); + } + /** + * @summary Get a payout setting + * @param merchantId The unique identifier of the merchant account. + * @param payoutSettingsId The unique identifier of the payout setting. + */ + public async getPayoutSetting(merchantId: string, payoutSettingsId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'payoutSettingsId' + '}', encodeURIComponent(String(payoutSettingsId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PayoutSettings"); + } + /** + * @summary Update a payout setting + * @param merchantId The unique identifier of the merchant account. + * @param payoutSettingsId The unique identifier of the payout setting. + * @param updatePayoutSettingsRequest + */ + public async updatePayoutSetting(merchantId: string, payoutSettingsId: string, updatePayoutSettingsRequest: UpdatePayoutSettingsRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'payoutSettingsId' + '}', encodeURIComponent(String(payoutSettingsId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdatePayoutSettingsRequest = ObjectSerializer.serialize(updatePayoutSettingsRequest, "UpdatePayoutSettingsRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "PayoutSettings"); + } + /** + * @summary Add a payout setting + * @param merchantId The unique identifier of the merchant account. + * @param payoutSettingsRequest + */ + public async addPayoutSetting(merchantId: string, payoutSettingsRequest: PayoutSettingsRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/payoutSettings" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: PayoutSettingsRequest = ObjectSerializer.serialize(payoutSettingsRequest, "PayoutSettingsRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "PayoutSettings"); + } +} diff --git a/src/services/management/terminalActionsCompanyLevelApi.ts b/src/services/management/terminalActionsCompanyLevelApi.ts new file mode 100644 index 0000000..47ab390 --- /dev/null +++ b/src/services/management/terminalActionsCompanyLevelApi.ts @@ -0,0 +1,94 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { AndroidAppsResponse } from '../../typings/management/models'; +import { AndroidCertificatesResponse } from '../../typings/management/models'; +import { ExternalTerminalAction } from '../../typings/management/models'; +import { ListExternalTerminalActionsResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalActionsCompanyLevelApi extends Service { + /** + * @summary Get a list of Android apps + * @param companyId The unique identifier of the company account. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 20 items on a page. + */ + public async listAndroidApps(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/androidApps" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AndroidAppsResponse"); + } + /** + * @summary Get a list of Android certificates + * @param companyId The unique identifier of the company account. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 20 items on a page. + */ + public async listAndroidCertificates(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/androidCertificates" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AndroidCertificatesResponse"); + } + /** + * @summary Get a list of terminal actions + * @param companyId The unique identifier of the company account. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 20 items on a page. + * @param status Returns terminal actions with the specified status. Allowed values: **pending**, **successful**, **failed**, **cancelled**, **tryLater**. + * @param type Returns terminal actions of the specified type. Allowed values: **InstallAndroidApp**, **UninstallAndroidApp**, **InstallAndroidCertificate**, **UninstallAndroidCertificate**. + */ + public async listTerminalActions(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalActions" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListExternalTerminalActionsResponse"); + } + /** + * @summary Get terminal action + * @param companyId The unique identifier of the company account. + * @param actionId The unique identifier of the terminal action. + */ + public async getTerminalAction(companyId: string, actionId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalActions/{actionId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'actionId' + '}', encodeURIComponent(String(actionId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ExternalTerminalAction"); + } +} diff --git a/src/services/management/terminalActionsTerminalLevelApi.ts b/src/services/management/terminalActionsTerminalLevelApi.ts new file mode 100644 index 0000000..c87ca13 --- /dev/null +++ b/src/services/management/terminalActionsTerminalLevelApi.ts @@ -0,0 +1,37 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { ScheduleTerminalActionsRequest } from '../../typings/management/models'; +import { ScheduleTerminalActionsResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalActionsTerminalLevelApi extends Service { + /** + * @summary Create a terminal action + * @param scheduleTerminalActionsRequest + */ + public async createTerminalAction(scheduleTerminalActionsRequest: ScheduleTerminalActionsRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/terminals/scheduleActions"; + const resource = new ManagementResource(this, localVarPath); + const request: ScheduleTerminalActionsRequest = ObjectSerializer.serialize(scheduleTerminalActionsRequest, "ScheduleTerminalActionsRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "ScheduleTerminalActionsResponse"); + } +} diff --git a/src/services/management/terminalOrdersCompanyLevelApi.ts b/src/services/management/terminalOrdersCompanyLevelApi.ts new file mode 100644 index 0000000..543ec61 --- /dev/null +++ b/src/services/management/terminalOrdersCompanyLevelApi.ts @@ -0,0 +1,202 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { BillingEntitiesResponse } from '../../typings/management/models'; +import { ShippingLocation } from '../../typings/management/models'; +import { ShippingLocationsResponse } from '../../typings/management/models'; +import { TerminalModelsResponse } from '../../typings/management/models'; +import { TerminalOrder } from '../../typings/management/models'; +import { TerminalOrderRequest } from '../../typings/management/models'; +import { TerminalOrdersResponse } from '../../typings/management/models'; +import { TerminalProductsResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalOrdersCompanyLevelApi extends Service { + /** + * @summary Get a list of billing entities + * @param companyId The unique identifier of the company account. + * @param name The name of the billing entity. + */ + public async listBillingEntities(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/billingEntities" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "BillingEntitiesResponse"); + } + /** + * @summary Get a list of shipping locations + * @param companyId The unique identifier of the company account. + * @param name The name of the shipping location. + * @param offset The number of locations to skip. + * @param limit The number of locations to return. + */ + public async listShippingLocations(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/shippingLocations" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ShippingLocationsResponse"); + } + /** + * @summary Get a list of terminal models + * @param companyId The unique identifier of the company account. + */ + public async listTerminalModels(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalModels" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalModelsResponse"); + } + /** + * @summary Get a list of orders + * @param companyId The unique identifier of the company account. + * @param customerOrderReference Your purchase order number. + * @param status The order status. Possible values (not case-sensitive): Placed, Confirmed, Cancelled, Shipped, Delivered. + * @param offset The number of orders to skip. + * @param limit The number of orders to return. + */ + public async listOrders(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalOrders" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrdersResponse"); + } + /** + * @summary Get an order + * @param companyId The unique identifier of the company account. + * @param orderId The unique identifier of the order. + */ + public async getOrder(companyId: string, orderId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalOrders/{orderId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrder"); + } + /** + * @summary Get a list of terminal products + * @param companyId The unique identifier of the company account. + * @param country The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** + * @param terminalModelId The terminal model to return products for. Use the ID returned in the [GET `/terminalModels`](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/terminalModels) response. For example, **Verifone.M400** + * @param offset The number of products to skip. + * @param limit The number of products to return. + */ + public async listTerminalProducts(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalProducts" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalProductsResponse"); + } + /** + * @summary Update an order + * @param companyId The unique identifier of the company account. + * @param orderId The unique identifier of the order. + * @param terminalOrderRequest + */ + public async updateOrder(companyId: string, orderId: string, terminalOrderRequest: TerminalOrderRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalOrders/{orderId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalOrderRequest = ObjectSerializer.serialize(terminalOrderRequest, "TerminalOrderRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrder"); + } + /** + * @summary Create a shipping location + * @param companyId The unique identifier of the company account. + * @param shippingLocation + */ + public async createShippingLocation(companyId: string, shippingLocation: ShippingLocation, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/shippingLocations" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const request: ShippingLocation = ObjectSerializer.serialize(shippingLocation, "ShippingLocation"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "ShippingLocation"); + } + /** + * @summary Create an order + * @param companyId The unique identifier of the company account. + * @param terminalOrderRequest + */ + public async createOrder(companyId: string, terminalOrderRequest: TerminalOrderRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalOrders" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalOrderRequest = ObjectSerializer.serialize(terminalOrderRequest, "TerminalOrderRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrder"); + } + /** + * @summary Cancel an order + * @param companyId The unique identifier of the company account. + * @param orderId The unique identifier of the order. + */ + public async cancelOrder(companyId: string, orderId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalOrders/{orderId}/cancel" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrder"); + } +} diff --git a/src/services/management/terminalOrdersMerchantLevelApi.ts b/src/services/management/terminalOrdersMerchantLevelApi.ts new file mode 100644 index 0000000..aa67766 --- /dev/null +++ b/src/services/management/terminalOrdersMerchantLevelApi.ts @@ -0,0 +1,202 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { BillingEntitiesResponse } from '../../typings/management/models'; +import { ShippingLocation } from '../../typings/management/models'; +import { ShippingLocationsResponse } from '../../typings/management/models'; +import { TerminalModelsResponse } from '../../typings/management/models'; +import { TerminalOrder } from '../../typings/management/models'; +import { TerminalOrderRequest } from '../../typings/management/models'; +import { TerminalOrdersResponse } from '../../typings/management/models'; +import { TerminalProductsResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalOrdersMerchantLevelApi extends Service { + /** + * @summary Get a list of billing entities + * @param merchantId The unique identifier of the merchant account. + * @param name The name of the billing entity. + */ + public async listBillingEntities(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/billingEntities" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "BillingEntitiesResponse"); + } + /** + * @summary Get a list of shipping locations + * @param merchantId The unique identifier of the merchant account. + * @param name The name of the shipping location. + * @param offset The number of locations to skip. + * @param limit The number of locations to return. + */ + public async listShippingLocations(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/shippingLocations" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ShippingLocationsResponse"); + } + /** + * @summary Get a list of terminal models + * @param merchantId The unique identifier of the merchant account. + */ + public async listTerminalModels(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalModels" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalModelsResponse"); + } + /** + * @summary Get a list of orders + * @param merchantId + * @param customerOrderReference Your purchase order number. + * @param status The order status. Possible values (not case-sensitive): Placed, Confirmed, Cancelled, Shipped, Delivered. + * @param offset The number of orders to skip. + * @param limit The number of orders to return. + */ + public async listOrders(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalOrders" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrdersResponse"); + } + /** + * @summary Get an order + * @param merchantId The unique identifier of the merchant account. + * @param orderId The unique identifier of the order. + */ + public async getOrder(merchantId: string, orderId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalOrders/{orderId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrder"); + } + /** + * @summary Get a list of terminal products + * @param merchantId The unique identifier of the merchant account. + * @param country The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** + * @param terminalModelId The terminal model to return products for. Use the ID returned in the [GET `/terminalModels`](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/terminalModels) response. For example, **Verifone.M400** + * @param offset The number of products to skip. + * @param limit The number of products to return. + */ + public async listTerminalProducts(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalProducts" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalProductsResponse"); + } + /** + * @summary Update an order + * @param merchantId The unique identifier of the merchant account. + * @param orderId The unique identifier of the order. + * @param terminalOrderRequest + */ + public async updateOrder(merchantId: string, orderId: string, terminalOrderRequest: TerminalOrderRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalOrders/{orderId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalOrderRequest = ObjectSerializer.serialize(terminalOrderRequest, "TerminalOrderRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrder"); + } + /** + * @summary Create a shipping location + * @param merchantId The unique identifier of the merchant account. + * @param shippingLocation + */ + public async createShippingLocation(merchantId: string, shippingLocation: ShippingLocation, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/shippingLocations" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: ShippingLocation = ObjectSerializer.serialize(shippingLocation, "ShippingLocation"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "ShippingLocation"); + } + /** + * @summary Create an order + * @param merchantId The unique identifier of the merchant account. + * @param terminalOrderRequest + */ + public async createOrder(merchantId: string, terminalOrderRequest: TerminalOrderRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalOrders" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalOrderRequest = ObjectSerializer.serialize(terminalOrderRequest, "TerminalOrderRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrder"); + } + /** + * @summary Cancel an order + * @param merchantId The unique identifier of the merchant account. + * @param orderId The unique identifier of the order. + */ + public async cancelOrder(merchantId: string, orderId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalOrders/{orderId}/cancel" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "TerminalOrder"); + } +} diff --git a/src/services/management/terminalSettingsCompanyLevelApi.ts b/src/services/management/terminalSettingsCompanyLevelApi.ts new file mode 100644 index 0000000..0832434 --- /dev/null +++ b/src/services/management/terminalSettingsCompanyLevelApi.ts @@ -0,0 +1,88 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { Logo } from '../../typings/management/models'; +import { TerminalSettings } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalSettingsCompanyLevelApi extends Service { + /** + * @summary Get the terminal logo + * @param companyId The unique identifier of the company account. + * @param model The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. + */ + public async getTerminalLogo(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalLogos" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Get terminal settings + * @param companyId The unique identifier of the company account. + */ + public async getTerminalSettings(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalSettings" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } + /** + * @summary Update the terminal logo + * @param companyId The unique identifier of the company account. + * @param model The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. + * @param logo + */ + public async updateTerminalLogo(companyId: string, logo: Logo, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalLogos" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const request: Logo = ObjectSerializer.serialize(logo, "Logo"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Update terminal settings + * @param companyId The unique identifier of the company account. + * @param terminalSettings + */ + public async updateTerminalSettings(companyId: string, terminalSettings: TerminalSettings, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/terminalSettings" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalSettings = ObjectSerializer.serialize(terminalSettings, "TerminalSettings"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } +} diff --git a/src/services/management/terminalSettingsMerchantLevelApi.ts b/src/services/management/terminalSettingsMerchantLevelApi.ts new file mode 100644 index 0000000..22b391c --- /dev/null +++ b/src/services/management/terminalSettingsMerchantLevelApi.ts @@ -0,0 +1,88 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { Logo } from '../../typings/management/models'; +import { TerminalSettings } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalSettingsMerchantLevelApi extends Service { + /** + * @summary Get the terminal logo + * @param merchantId The unique identifier of the merchant account. + * @param model The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. + */ + public async getTerminalLogo(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalLogos" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Get terminal settings + * @param merchantId The unique identifier of the merchant account. + */ + public async getTerminalSettings(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalSettings" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } + /** + * @summary Update the terminal logo + * @param merchantId The unique identifier of the merchant account. + * @param model The terminal model. Allowed values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. + * @param logo + */ + public async updateTerminalLogo(merchantId: string, logo: Logo, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalLogos" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: Logo = ObjectSerializer.serialize(logo, "Logo"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Update terminal settings + * @param merchantId The unique identifier of the merchant account. + * @param terminalSettings + */ + public async updateTerminalSettings(merchantId: string, terminalSettings: TerminalSettings, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/terminalSettings" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalSettings = ObjectSerializer.serialize(terminalSettings, "TerminalSettings"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } +} diff --git a/src/services/management/terminalSettingsStoreLevelApi.ts b/src/services/management/terminalSettingsStoreLevelApi.ts new file mode 100644 index 0000000..a0084a5 --- /dev/null +++ b/src/services/management/terminalSettingsStoreLevelApi.ts @@ -0,0 +1,162 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { Logo } from '../../typings/management/models'; +import { TerminalSettings } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalSettingsStoreLevelApi extends Service { + /** + * @summary Get the terminal logo + * @param merchantId The unique identifier of the merchant account. + * @param reference The reference that identifies the store. + * @param model The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. + */ + public async getTerminalLogo(merchantId: string, reference: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/stores/{reference}/terminalLogos" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'reference' + '}', encodeURIComponent(String(reference))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Get terminal settings + * @param merchantId The unique identifier of the merchant account. + * @param reference The reference that identifies the store. + */ + public async getTerminalSettings(merchantId: string, reference: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/stores/{reference}/terminalSettings" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'reference' + '}', encodeURIComponent(String(reference))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } + /** + * @summary Get the terminal logo + * @param storeId The unique identifier of the store. + * @param model The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. + */ + public async getTerminalLogoByStoreId(storeId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/stores/{storeId}/terminalLogos" + .replace('{' + 'storeId' + '}', encodeURIComponent(String(storeId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Get terminal settings + * @param storeId The unique identifier of the store. + */ + public async getTerminalSettingsByStoreId(storeId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/stores/{storeId}/terminalSettings" + .replace('{' + 'storeId' + '}', encodeURIComponent(String(storeId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } + /** + * @summary Update the terminal logo + * @param merchantId The unique identifier of the merchant account. + * @param reference The reference that identifies the store. + * @param model The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T + * @param logo + */ + public async updateTerminalLogo(merchantId: string, reference: string, logo: Logo, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/stores/{reference}/terminalLogos" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'reference' + '}', encodeURIComponent(String(reference))); + const resource = new ManagementResource(this, localVarPath); + const request: Logo = ObjectSerializer.serialize(logo, "Logo"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Update terminal settings + * @param merchantId The unique identifier of the merchant account. + * @param reference The reference that identifies the store. + * @param terminalSettings + */ + public async updateTerminalSettings(merchantId: string, reference: string, terminalSettings: TerminalSettings, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/stores/{reference}/terminalSettings" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'reference' + '}', encodeURIComponent(String(reference))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalSettings = ObjectSerializer.serialize(terminalSettings, "TerminalSettings"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } + /** + * @summary Update the terminal logo + * @param storeId The unique identifier of the store. + * @param model The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. + * @param logo + */ + public async updateTerminalLogoByStoreId(storeId: string, logo: Logo, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/stores/{storeId}/terminalLogos" + .replace('{' + 'storeId' + '}', encodeURIComponent(String(storeId))); + const resource = new ManagementResource(this, localVarPath); + const request: Logo = ObjectSerializer.serialize(logo, "Logo"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Update terminal settings + * @param storeId The unique identifier of the store. + * @param terminalSettings + */ + public async updateTerminalSettingsByStoreId(storeId: string, terminalSettings: TerminalSettings, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/stores/{storeId}/terminalSettings" + .replace('{' + 'storeId' + '}', encodeURIComponent(String(storeId))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalSettings = ObjectSerializer.serialize(terminalSettings, "TerminalSettings"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } +} diff --git a/src/services/management/terminalSettingsTerminalLevelApi.ts b/src/services/management/terminalSettingsTerminalLevelApi.ts new file mode 100644 index 0000000..f078d0f --- /dev/null +++ b/src/services/management/terminalSettingsTerminalLevelApi.ts @@ -0,0 +1,86 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { Logo } from '../../typings/management/models'; +import { TerminalSettings } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalSettingsTerminalLevelApi extends Service { + /** + * @summary Get the terminal logo + * @param terminalId The unique identifier of the payment terminal. + */ + public async getTerminalLogo(terminalId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/terminals/{terminalId}/terminalLogos" + .replace('{' + 'terminalId' + '}', encodeURIComponent(String(terminalId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Get terminal settings + * @param terminalId The unique identifier of the payment terminal. + */ + public async getTerminalSettings(terminalId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/terminals/{terminalId}/terminalSettings" + .replace('{' + 'terminalId' + '}', encodeURIComponent(String(terminalId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } + /** + * @summary Update the logo + * @param terminalId The unique identifier of the payment terminal. + * @param logo + */ + public async updateLogo(terminalId: string, logo: Logo, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/terminals/{terminalId}/terminalLogos" + .replace('{' + 'terminalId' + '}', encodeURIComponent(String(terminalId))); + const resource = new ManagementResource(this, localVarPath); + const request: Logo = ObjectSerializer.serialize(logo, "Logo"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Logo"); + } + /** + * @summary Update terminal settings + * @param terminalId The unique identifier of the payment terminal. + * @param terminalSettings + */ + public async updateTerminalSettings(terminalId: string, terminalSettings: TerminalSettings, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/terminals/{terminalId}/terminalSettings" + .replace('{' + 'terminalId' + '}', encodeURIComponent(String(terminalId))); + const resource = new ManagementResource(this, localVarPath); + const request: TerminalSettings = ObjectSerializer.serialize(terminalSettings, "TerminalSettings"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "TerminalSettings"); + } +} diff --git a/src/services/management/terminalsTerminalLevelApi.ts b/src/services/management/terminalsTerminalLevelApi.ts new file mode 100644 index 0000000..7099565 --- /dev/null +++ b/src/services/management/terminalsTerminalLevelApi.ts @@ -0,0 +1,41 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { ListTerminalsResponse } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class TerminalsTerminalLevelApi extends Service { + /** + * @summary Get a list of terminals + * @param searchQuery Returns terminals with an ID that contains the specified string. If present, other query parameters are ignored. + * @param countries Returns terminals located in the countries specified by their [two-letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + * @param merchantIds Returns terminals that belong to the merchant accounts specified by their unique merchant account ID. + * @param storeIds Returns terminals that are assigned to the [stores](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/stores) specified by their unique store ID. + * @param brandModels Returns terminals of the [models](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/companies/{companyId}/terminalModels) specified in the format *brand.model*. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 20 items on a page. + */ + public async listTerminals(requestOptions?: IRequest.Options): Promise { + const localVarPath = "/terminals"; + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListTerminalsResponse"); + } +} diff --git a/src/services/management/usersCompanyLevelApi.ts b/src/services/management/usersCompanyLevelApi.ts new file mode 100644 index 0000000..e39e493 --- /dev/null +++ b/src/services/management/usersCompanyLevelApi.ts @@ -0,0 +1,95 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { CompanyUser } from '../../typings/management/models'; +import { CreateCompanyUserRequest } from '../../typings/management/models'; +import { CreateCompanyUserResponse } from '../../typings/management/models'; +import { ListCompanyUsersResponse } from '../../typings/management/models'; +import { UpdateCompanyUserRequest } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class UsersCompanyLevelApi extends Service { + /** + * @summary Get a list of users + * @param companyId The unique identifier of the company account. + * @param pageNumber The number of the page to return. + * @param pageSize The number of items to have on a page. Maximum value is **100**. The default is **10** items on a page. + */ + public async listUsers(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/users" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListCompanyUsersResponse"); + } + /** + * @summary Get user details + * @param companyId The unique identifier of the company account. + * @param userId The unique identifier of the user. + */ + public async getUserDetails(companyId: string, userId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/users/{userId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'userId' + '}', encodeURIComponent(String(userId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "CompanyUser"); + } + /** + * @summary Update user details + * @param companyId The unique identifier of the company account. + * @param userId The unique identifier of the user. + * @param updateCompanyUserRequest + */ + public async updateUserDetails(companyId: string, userId: string, updateCompanyUserRequest: UpdateCompanyUserRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/users/{userId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'userId' + '}', encodeURIComponent(String(userId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdateCompanyUserRequest = ObjectSerializer.serialize(updateCompanyUserRequest, "UpdateCompanyUserRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "CompanyUser"); + } + /** + * @summary Create a new user + * @param companyId The unique identifier of the company account. + * @param createCompanyUserRequest + */ + public async createNewUser(companyId: string, createCompanyUserRequest: CreateCompanyUserRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/users" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const request: CreateCompanyUserRequest = ObjectSerializer.serialize(createCompanyUserRequest, "CreateCompanyUserRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "CreateCompanyUserResponse"); + } +} diff --git a/src/services/management/usersMerchantLevelApi.ts b/src/services/management/usersMerchantLevelApi.ts new file mode 100644 index 0000000..7a70240 --- /dev/null +++ b/src/services/management/usersMerchantLevelApi.ts @@ -0,0 +1,95 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { CreateMerchantUserRequest } from '../../typings/management/models'; +import { CreateUserResponse } from '../../typings/management/models'; +import { ListMerchantUsersResponse } from '../../typings/management/models'; +import { UpdateMerchantUserRequest } from '../../typings/management/models'; +import { User } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class UsersMerchantLevelApi extends Service { + /** + * @summary Get a list of users + * @param merchantId Unique identifier of the merchant. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page. Maximum value is **100**. The default is **10** items on a page. + */ + public async listUsers(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/users" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListMerchantUsersResponse"); + } + /** + * @summary Get user details + * @param merchantId Unique identifier of the merchant. + * @param userId Unique identifier of the user. + */ + public async getUserDetails(merchantId: string, userId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/users/{userId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'userId' + '}', encodeURIComponent(String(userId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "User"); + } + /** + * @summary Update a user + * @param merchantId Unique identifier of the merchant. + * @param userId Unique identifier of the user. + * @param updateMerchantUserRequest + */ + public async updateUser(merchantId: string, userId: string, updateMerchantUserRequest: UpdateMerchantUserRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/users/{userId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'userId' + '}', encodeURIComponent(String(userId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdateMerchantUserRequest = ObjectSerializer.serialize(updateMerchantUserRequest, "UpdateMerchantUserRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "User"); + } + /** + * @summary Create a new user + * @param merchantId Unique identifier of the merchant. + * @param createMerchantUserRequest + */ + public async createNewUser(merchantId: string, createMerchantUserRequest: CreateMerchantUserRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/users" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: CreateMerchantUserRequest = ObjectSerializer.serialize(createMerchantUserRequest, "CreateMerchantUserRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "CreateUserResponse"); + } +} diff --git a/src/services/management/webhooksCompanyLevelApi.ts b/src/services/management/webhooksCompanyLevelApi.ts new file mode 100644 index 0000000..a6a99dd --- /dev/null +++ b/src/services/management/webhooksCompanyLevelApi.ts @@ -0,0 +1,149 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { CreateCompanyWebhookRequest } from '../../typings/management/models'; +import { GenerateHmacKeyResponse } from '../../typings/management/models'; +import { ListWebhooksResponse } from '../../typings/management/models'; +import { TestCompanyWebhookRequest } from '../../typings/management/models'; +import { TestWebhookResponse } from '../../typings/management/models'; +import { UpdateCompanyWebhookRequest } from '../../typings/management/models'; +import { Webhook } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class WebhooksCompanyLevelApi extends Service { + /** + * @summary Remove a webhook + * @param companyId The unique identifier of the company account. + * @param webhookId Unique identifier of the webhook configuration. + */ + public async removeWebhook(companyId: string, webhookId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/webhooks/{webhookId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + await getJsonResponse( + resource, + "", + { ...requestOptions, method: "DELETE" } + ); + } + /** + * @summary List all webhooks + * @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + */ + public async listAllWebhooks(companyId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/webhooks" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListWebhooksResponse"); + } + /** + * @summary Get a webhook + * @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). + * @param webhookId Unique identifier of the webhook configuration. + */ + public async getWebhook(companyId: string, webhookId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/webhooks/{webhookId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Webhook"); + } + /** + * @summary Update a webhook + * @param companyId The unique identifier of the company account. + * @param webhookId Unique identifier of the webhook configuration. + * @param updateCompanyWebhookRequest + */ + public async updateWebhook(companyId: string, webhookId: string, updateCompanyWebhookRequest: UpdateCompanyWebhookRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/webhooks/{webhookId}" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdateCompanyWebhookRequest = ObjectSerializer.serialize(updateCompanyWebhookRequest, "UpdateCompanyWebhookRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Webhook"); + } + /** + * @summary Set up a webhook + * @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). + * @param createCompanyWebhookRequest + */ + public async setUpWebhook(companyId: string, createCompanyWebhookRequest: CreateCompanyWebhookRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/webhooks" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))); + const resource = new ManagementResource(this, localVarPath); + const request: CreateCompanyWebhookRequest = ObjectSerializer.serialize(createCompanyWebhookRequest, "CreateCompanyWebhookRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "Webhook"); + } + /** + * @summary Generate an HMAC key + * @param companyId The unique identifier of the company account. + * @param webhookId Unique identifier of the webhook configuration. + */ + public async generateHmacKey(companyId: string, webhookId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/webhooks/{webhookId}/generateHmac" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "GenerateHmacKeyResponse"); + } + /** + * @summary Test a webhook + * @param companyId The unique identifier of the company account. + * @param webhookId Unique identifier of the webhook configuration. + * @param testCompanyWebhookRequest + */ + public async testWebhook(companyId: string, webhookId: string, testCompanyWebhookRequest: TestCompanyWebhookRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/companies/{companyId}/webhooks/{webhookId}/test" + .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + const request: TestCompanyWebhookRequest = ObjectSerializer.serialize(testCompanyWebhookRequest, "TestCompanyWebhookRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "TestWebhookResponse"); + } +} diff --git a/src/services/management/webhooksMerchantLevelApi.ts b/src/services/management/webhooksMerchantLevelApi.ts new file mode 100644 index 0000000..c7cc7e8 --- /dev/null +++ b/src/services/management/webhooksMerchantLevelApi.ts @@ -0,0 +1,149 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +import { CreateMerchantWebhookRequest } from '../../typings/management/models'; +import { GenerateHmacKeyResponse } from '../../typings/management/models'; +import { ListWebhooksResponse } from '../../typings/management/models'; +import { TestWebhookRequest } from '../../typings/management/models'; +import { TestWebhookResponse } from '../../typings/management/models'; +import { UpdateMerchantWebhookRequest } from '../../typings/management/models'; +import { Webhook } from '../../typings/management/models'; +import { IRequest } from "../../typings/requestOptions"; +import ManagementResource from "../resource/management/managementResource"; +import { ObjectSerializer } from "../../typings/management/models"; + + +export default class WebhooksMerchantLevelApi extends Service { + /** + * @summary Remove a webhook + * @param merchantId The unique identifier of the merchant account. + * @param webhookId Unique identifier of the webhook configuration. + */ + public async removeWebhook(merchantId: string, webhookId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/webhooks/{webhookId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + await getJsonResponse( + resource, + "", + { ...requestOptions, method: "DELETE" } + ); + } + /** + * @summary List all webhooks + * @param merchantId The unique identifier of the merchant account. + * @param pageNumber The number of the page to fetch. + * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page. + */ + public async listAllWebhooks(merchantId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/webhooks" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "ListWebhooksResponse"); + } + /** + * @summary Get a webhook + * @param merchantId The unique identifier of the merchant account. + * @param webhookId Unique identifier of the webhook configuration. + */ + public async getWebhook(merchantId: string, webhookId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/webhooks/{webhookId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "Webhook"); + } + /** + * @summary Update a webhook + * @param merchantId The unique identifier of the merchant account. + * @param webhookId Unique identifier of the webhook configuration. + * @param updateMerchantWebhookRequest + */ + public async updateWebhook(merchantId: string, webhookId: string, updateMerchantWebhookRequest: UpdateMerchantWebhookRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/webhooks/{webhookId}" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + const request: UpdateMerchantWebhookRequest = ObjectSerializer.serialize(updateMerchantWebhookRequest, "UpdateMerchantWebhookRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "Webhook"); + } + /** + * @summary Set up a webhook + * @param merchantId The unique identifier of the merchant account. + * @param createMerchantWebhookRequest + */ + public async setUpWebhook(merchantId: string, createMerchantWebhookRequest: CreateMerchantWebhookRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/webhooks" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))); + const resource = new ManagementResource(this, localVarPath); + const request: CreateMerchantWebhookRequest = ObjectSerializer.serialize(createMerchantWebhookRequest, "CreateMerchantWebhookRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "Webhook"); + } + /** + * @summary Generate an HMAC key + * @param merchantId The unique identifier of the merchant account. + * @param webhookId + */ + public async generateHmacKey(merchantId: string, webhookId: string, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/webhooks/{webhookId}/generateHmac" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "GenerateHmacKeyResponse"); + } + /** + * @summary Test a webhook + * @param merchantId The unique identifier of the merchant account. + * @param webhookId Unique identifier of the webhook configuration. + * @param testWebhookRequest + */ + public async testWebhook(merchantId: string, webhookId: string, testWebhookRequest: TestWebhookRequest, requestOptions?: IRequest.Options): Promise { + const localVarPath = "/merchants/{merchantId}/webhooks/{webhookId}/test" + .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId))) + .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); + const resource = new ManagementResource(this, localVarPath); + const request: TestWebhookRequest = ObjectSerializer.serialize(testWebhookRequest, "TestWebhookRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "TestWebhookResponse"); + } +} diff --git a/src/typings/management/applePayInfo.ts b/src/typings/management/applePayInfo.ts index 9bd89b6..fc38ff9 100644 --- a/src/typings/management/applePayInfo.ts +++ b/src/typings/management/applePayInfo.ts @@ -10,9 +10,9 @@ export class ApplePayInfo { /** - * The list of merchant domains. For more information, see [Apple Pay documentation](https://docs.adyen.com/payment-methods/apple-pay/enable-apple-pay#register-merchant-domain). + * The list of merchant domains. Maximum: 99 domains per request. For more information, see [Apple Pay documentation](https://docs.adyen.com/payment-methods/apple-pay/web-drop-in?tab=adyen-certificate-live_1#going-live). */ - 'domains': Array; + 'domains'?: Array; static discriminator: string | undefined = undefined; diff --git a/src/typings/management/companyUser.ts b/src/typings/management/companyUser.ts index 5807652..e7a2f62 100644 --- a/src/typings/management/companyUser.ts +++ b/src/typings/management/companyUser.ts @@ -44,7 +44,7 @@ export class CompanyUser { /** * The username for this user. */ - 'username': string; + 'username'?: string; static discriminator: string | undefined = undefined; diff --git a/src/typings/management/configuration.ts b/src/typings/management/configuration.ts index 6eef6a9..01461d5 100644 --- a/src/typings/management/configuration.ts +++ b/src/typings/management/configuration.ts @@ -21,7 +21,7 @@ export class Configuration { /** * Funding source. Possible values: * **Credit** * **Debit** */ - 'sources'?: Configuration.SourcesEnum; + 'sources'?: Array; static discriminator: string | undefined = undefined; @@ -39,7 +39,7 @@ export class Configuration { { "name": "sources", "baseName": "sources", - "type": "Configuration.SourcesEnum" + "type": "Array" } ]; static getAttributeTypeMap() { @@ -47,7 +47,3 @@ export class Configuration { } } -export namespace Configuration { - export enum SourcesEnum { - } -} diff --git a/src/typings/management/createCompanyUserRequest.ts b/src/typings/management/createCompanyUserRequest.ts index ba24cb5..772403f 100644 --- a/src/typings/management/createCompanyUserRequest.ts +++ b/src/typings/management/createCompanyUserRequest.ts @@ -21,8 +21,8 @@ export class CreateCompanyUserRequest { /** * The email address of the user. */ - 'email': string; - 'name': Name; + 'email'?: string; + 'name'?: Name; /** * The list of [roles](https://docs.adyen.com/account/user-roles) for this user. */ @@ -34,7 +34,7 @@ export class CreateCompanyUserRequest { /** * The username for this user. Allowed length: 255 alphanumeric characters. */ - 'username': string; + 'username'?: string; static discriminator: string | undefined = undefined; diff --git a/src/typings/management/createCompanyUserResponse.ts b/src/typings/management/createCompanyUserResponse.ts index a1d8108..c0ad79f 100644 --- a/src/typings/management/createCompanyUserResponse.ts +++ b/src/typings/management/createCompanyUserResponse.ts @@ -44,7 +44,7 @@ export class CreateCompanyUserResponse { /** * The username for this user. */ - 'username': string; + 'username'?: string; static discriminator: string | undefined = undefined; diff --git a/src/typings/management/createMerchantRequest.ts b/src/typings/management/createMerchantRequest.ts index 6366ccd..3de6f5b 100644 --- a/src/typings/management/createMerchantRequest.ts +++ b/src/typings/management/createMerchantRequest.ts @@ -33,6 +33,10 @@ export class CreateMerchantRequest { * Your reference for the merchant account. To make this reference the unique identifier of the merchant account, your Adyen contact can set up a template on your company account. The template can have 6 to 255 characters with upper- and lower-case letters, underscores, and numbers. When your company account has a template, then the `reference` is required and must be unique within the company account. */ 'reference'?: string; + /** + * List of sales channels that the merchant will process payments with + */ + 'salesChannels'?: Array; static discriminator: string | undefined = undefined; @@ -66,6 +70,11 @@ export class CreateMerchantRequest { "name": "reference", "baseName": "reference", "type": "string" + }, + { + "name": "salesChannels", + "baseName": "salesChannels", + "type": "Array" } ]; static getAttributeTypeMap() { diff --git a/src/typings/management/createMerchantUserRequest.ts b/src/typings/management/createMerchantUserRequest.ts index ff4f783..1e95318 100644 --- a/src/typings/management/createMerchantUserRequest.ts +++ b/src/typings/management/createMerchantUserRequest.ts @@ -17,8 +17,8 @@ export class CreateMerchantUserRequest { /** * The email address of the user. */ - 'email': string; - 'name': Name; + 'email'?: string; + 'name'?: Name; /** * The list of [roles](https://docs.adyen.com/account/user-roles) for this user. */ @@ -30,7 +30,7 @@ export class CreateMerchantUserRequest { /** * The username for this user. Allowed length: 255 alphanumeric characters. */ - 'username': string; + 'username'?: string; static discriminator: string | undefined = undefined; diff --git a/src/typings/management/createUserResponse.ts b/src/typings/management/createUserResponse.ts index 58601c6..3696d6c 100644 --- a/src/typings/management/createUserResponse.ts +++ b/src/typings/management/createUserResponse.ts @@ -40,7 +40,7 @@ export class CreateUserResponse { /** * The username for this user. */ - 'username': string; + 'username'?: string; static discriminator: string | undefined = undefined; diff --git a/src/typings/management/googlePayInfo.ts b/src/typings/management/googlePayInfo.ts new file mode 100644 index 0000000..e8a6477 --- /dev/null +++ b/src/typings/management/googlePayInfo.ts @@ -0,0 +1,30 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class GooglePayInfo { + /** + * Google Pay [Merchant ID](https://support.google.com/paymentscenter/answer/7163092?hl=en). Character length and limitations: 16 alphanumeric characters or 20 numeric characters. + */ + 'merchantId'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "merchantId", + "baseName": "merchantId", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return GooglePayInfo.attributeTypeMap; + } +} + diff --git a/src/typings/management/key.ts b/src/typings/management/key.ts new file mode 100644 index 0000000..51cef23 --- /dev/null +++ b/src/typings/management/key.ts @@ -0,0 +1,48 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Key { + /** + * Identifier + */ + 'identifier'?: string; + /** + * Passphrase + */ + 'passphrase'?: string; + /** + * Version number + */ + 'version'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "identifier", + "baseName": "identifier", + "type": "string" + }, + { + "name": "passphrase", + "baseName": "passphrase", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return Key.attributeTypeMap; + } +} + diff --git a/src/typings/management/klarnaInfo.ts b/src/typings/management/klarnaInfo.ts index 94a3b7e..1a58f2a 100644 --- a/src/typings/management/klarnaInfo.ts +++ b/src/typings/management/klarnaInfo.ts @@ -20,7 +20,7 @@ export class KlarnaInfo { /** * The region of operation. For example, **NA**, **EU**, **CH**, **AU**. */ - 'region': KlarnaInfo.RegionEnum; + 'region'?: KlarnaInfo.RegionEnum; /** * The email address of merchant support. */ diff --git a/src/typings/management/mealVoucherFRInfo.ts b/src/typings/management/mealVoucherFRInfo.ts new file mode 100644 index 0000000..76ed0af --- /dev/null +++ b/src/typings/management/mealVoucherFRInfo.ts @@ -0,0 +1,52 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class MealVoucherFRInfo { + /** + * Meal Voucher conecsId. Format: digits only + */ + 'conecsId': string; + /** + * Meal Voucher siret. Format: 14 digits. + */ + 'siret': string; + /** + * The list of additional payment methods + */ + 'subTypes'?: MealVoucherFRInfo.SubTypesEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "conecsId", + "baseName": "conecsId", + "type": "string" + }, + { + "name": "siret", + "baseName": "siret", + "type": "string" + }, + { + "name": "subTypes", + "baseName": "subTypes", + "type": "MealVoucherFRInfo.SubTypesEnum" + } ]; + + static getAttributeTypeMap() { + return MealVoucherFRInfo.attributeTypeMap; + } +} + +export namespace MealVoucherFRInfo { + export enum SubTypesEnum { + } +} diff --git a/src/typings/management/models.ts b/src/typings/management/models.ts index 0474b7c..ad75652 100644 --- a/src/typings/management/models.ts +++ b/src/typings/management/models.ts @@ -57,6 +57,7 @@ export * from './generateApiKeyResponse'; export * from './generateClientKeyResponse'; export * from './generateHmacKeyResponse'; export * from './giroPayInfo'; +export * from './googlePayInfo'; export * from './gratuity'; export * from './hardware'; export * from './idName'; @@ -65,6 +66,7 @@ export * from './installAndroidCertificateDetails'; export * from './invalidField'; export * from './jSONObject'; export * from './jSONPath'; +export * from './key'; export * from './klarnaInfo'; export * from './links'; export * from './linksElement'; @@ -80,6 +82,7 @@ export * from './listTerminalsResponse'; export * from './listWebhooksResponse'; export * from './logo'; export * from './meApiCredential'; +export * from './mealVoucherFRInfo'; export * from './merchant'; export * from './merchantLinks'; export * from './minorUnitsMonetaryValue'; @@ -87,10 +90,12 @@ export * from './modelFile'; export * from './name'; export * from './name2'; export * from './nexo'; +export * from './notificationUrl'; export * from './offlineProcessing'; export * from './opi'; export * from './orderItem'; export * from './paginationLinks'; +export * from './passcodes'; export * from './payPalInfo'; export * from './paymentMethod'; export * from './paymentMethodResponse'; @@ -112,6 +117,7 @@ export * from './shippingLocationsResponse'; export * from './shopperStatement'; export * from './signature'; export * from './sofortInfo'; +export * from './standalone'; export * from './store'; export * from './storeCreationRequest'; export * from './storeCreationWithMerchantCodeRequest'; @@ -200,6 +206,7 @@ import { GenerateApiKeyResponse } from './generateApiKeyResponse'; import { GenerateClientKeyResponse } from './generateClientKeyResponse'; import { GenerateHmacKeyResponse } from './generateHmacKeyResponse'; import { GiroPayInfo } from './giroPayInfo'; +import { GooglePayInfo } from './googlePayInfo'; import { Gratuity } from './gratuity'; import { Hardware } from './hardware'; import { IdName } from './idName'; @@ -208,6 +215,7 @@ import { InstallAndroidCertificateDetails } from './installAndroidCertificateDet import { InvalidField } from './invalidField'; import { JSONObject } from './jSONObject'; import { JSONPath } from './jSONPath'; +import { Key } from './key'; import { KlarnaInfo } from './klarnaInfo'; import { Links } from './links'; import { LinksElement } from './linksElement'; @@ -223,6 +231,7 @@ import { ListTerminalsResponse } from './listTerminalsResponse'; import { ListWebhooksResponse } from './listWebhooksResponse'; import { Logo } from './logo'; import { MeApiCredential } from './meApiCredential'; +import { MealVoucherFRInfo } from './mealVoucherFRInfo'; import { Merchant } from './merchant'; import { MerchantLinks } from './merchantLinks'; import { MinorUnitsMonetaryValue } from './minorUnitsMonetaryValue'; @@ -230,10 +239,12 @@ import { ModelFile } from './modelFile'; import { Name } from './name'; import { Name2 } from './name2'; import { Nexo } from './nexo'; +import { NotificationUrl } from './notificationUrl'; import { OfflineProcessing } from './offlineProcessing'; import { Opi } from './opi'; import { OrderItem } from './orderItem'; import { PaginationLinks } from './paginationLinks'; +import { Passcodes } from './passcodes'; import { PayPalInfo } from './payPalInfo'; import { PaymentMethod } from './paymentMethod'; import { PaymentMethodResponse } from './paymentMethodResponse'; @@ -255,6 +266,7 @@ import { ShippingLocationsResponse } from './shippingLocationsResponse'; import { ShopperStatement } from './shopperStatement'; import { Signature } from './signature'; import { SofortInfo } from './sofortInfo'; +import { Standalone } from './standalone'; import { Store } from './store'; import { StoreCreationRequest } from './storeCreationRequest'; import { StoreCreationWithMerchantCodeRequest } from './storeCreationWithMerchantCodeRequest'; @@ -306,7 +318,6 @@ let primitives = [ ]; let enumsMap: {[index: string]: any} = { - "Configuration.SourcesEnum": Configuration.SourcesEnum, "Connectivity.SimcardStatusEnum": Connectivity.SimcardStatusEnum, "CreateCompanyWebhookRequest.CommunicationFormatEnum": CreateCompanyWebhookRequest.CommunicationFormatEnum, "CreateCompanyWebhookRequest.FilterMerchantAccountTypeEnum": CreateCompanyWebhookRequest.FilterMerchantAccountTypeEnum, @@ -318,7 +329,9 @@ let enumsMap: {[index: string]: any} = { "InstallAndroidAppDetails.TypeEnum": InstallAndroidAppDetails.TypeEnum, "InstallAndroidCertificateDetails.TypeEnum": InstallAndroidCertificateDetails.TypeEnum, "KlarnaInfo.RegionEnum": KlarnaInfo.RegionEnum, + "MealVoucherFRInfo.SubTypesEnum": MealVoucherFRInfo.SubTypesEnum, "PaymentMethod.VerificationStatusEnum": PaymentMethod.VerificationStatusEnum, + "PaymentMethodResponse.TypesWithErrorsEnum": PaymentMethodResponse.TypesWithErrorsEnum, "PaymentMethodSetupInfo.ShopperInteractionEnum": PaymentMethodSetupInfo.ShopperInteractionEnum, "PaymentMethodSetupInfo.TypeEnum": PaymentMethodSetupInfo.TypeEnum, "PayoutSettings.PriorityEnum": PayoutSettings.PriorityEnum, @@ -392,6 +405,7 @@ let typeMap: {[index: string]: any} = { "GenerateClientKeyResponse": GenerateClientKeyResponse, "GenerateHmacKeyResponse": GenerateHmacKeyResponse, "GiroPayInfo": GiroPayInfo, + "GooglePayInfo": GooglePayInfo, "Gratuity": Gratuity, "Hardware": Hardware, "IdName": IdName, @@ -400,6 +414,7 @@ let typeMap: {[index: string]: any} = { "InvalidField": InvalidField, "JSONObject": JSONObject, "JSONPath": JSONPath, + "Key": Key, "KlarnaInfo": KlarnaInfo, "Links": Links, "LinksElement": LinksElement, @@ -415,6 +430,7 @@ let typeMap: {[index: string]: any} = { "ListWebhooksResponse": ListWebhooksResponse, "Logo": Logo, "MeApiCredential": MeApiCredential, + "MealVoucherFRInfo": MealVoucherFRInfo, "Merchant": Merchant, "MerchantLinks": MerchantLinks, "MinorUnitsMonetaryValue": MinorUnitsMonetaryValue, @@ -422,10 +438,12 @@ let typeMap: {[index: string]: any} = { "Name": Name, "Name2": Name2, "Nexo": Nexo, + "NotificationUrl": NotificationUrl, "OfflineProcessing": OfflineProcessing, "Opi": Opi, "OrderItem": OrderItem, "PaginationLinks": PaginationLinks, + "Passcodes": Passcodes, "PayPalInfo": PayPalInfo, "PaymentMethod": PaymentMethod, "PaymentMethodResponse": PaymentMethodResponse, @@ -447,6 +465,7 @@ let typeMap: {[index: string]: any} = { "ShopperStatement": ShopperStatement, "Signature": Signature, "SofortInfo": SofortInfo, + "Standalone": Standalone, "Store": Store, "StoreCreationRequest": StoreCreationRequest, "StoreCreationWithMerchantCodeRequest": StoreCreationWithMerchantCodeRequest, diff --git a/src/typings/management/nexo.ts b/src/typings/management/nexo.ts index 53b406e..baf89f9 100644 --- a/src/typings/management/nexo.ts +++ b/src/typings/management/nexo.ts @@ -8,8 +8,12 @@ */ import { EventUrl } from './eventUrl'; +import { Key } from './key'; +import { NotificationUrl } from './notificationUrl'; export class Nexo { + 'displayUrls'?: NotificationUrl; + 'encryptionKey'?: Key; 'eventUrls'?: EventUrl; /** * @deprecated One or more URLs to send event messages to when using Terminal API. @@ -19,6 +23,16 @@ export class Nexo { static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "displayUrls", + "baseName": "displayUrls", + "type": "NotificationUrl" + }, + { + "name": "encryptionKey", + "baseName": "encryptionKey", + "type": "Key" + }, { "name": "eventUrls", "baseName": "eventUrls", diff --git a/src/typings/management/notificationUrl.ts b/src/typings/management/notificationUrl.ts new file mode 100644 index 0000000..9026bc2 --- /dev/null +++ b/src/typings/management/notificationUrl.ts @@ -0,0 +1,40 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Url } from './url'; + +export class NotificationUrl { + /** + * One or more local URLs to send notifications to when using Terminal API. + */ + 'localUrls'?: Array; + /** + * One or more public URLs to send notifications to when using Terminal API. + */ + 'publicUrls'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "localUrls", + "baseName": "localUrls", + "type": "Array" + }, + { + "name": "publicUrls", + "baseName": "publicUrls", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return NotificationUrl.attributeTypeMap; + } +} + diff --git a/src/typings/management/passcodes.ts b/src/typings/management/passcodes.ts new file mode 100644 index 0000000..221027c --- /dev/null +++ b/src/typings/management/passcodes.ts @@ -0,0 +1,57 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Passcodes { + /** + * The pin code used to enter the admin menu + */ + 'adminMenuPin'?: string; + /** + * Allows merchant to create a dedicated PIN for standalone refund functionality + */ + 'refundPin'?: string; + /** + * Passcode to unlock screen after sleep + */ + 'screenLockPin'?: string; + /** + * The PIN code used to enter the transaction menu + */ + 'txMenuPin'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "adminMenuPin", + "baseName": "adminMenuPin", + "type": "string" + }, + { + "name": "refundPin", + "baseName": "refundPin", + "type": "string" + }, + { + "name": "screenLockPin", + "baseName": "screenLockPin", + "type": "string" + }, + { + "name": "txMenuPin", + "baseName": "txMenuPin", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Passcodes.attributeTypeMap; + } +} + diff --git a/src/typings/management/paymentMethod.ts b/src/typings/management/paymentMethod.ts index ea57118..d16cc38 100644 --- a/src/typings/management/paymentMethod.ts +++ b/src/typings/management/paymentMethod.ts @@ -11,7 +11,9 @@ import { ApplePayInfo } from './applePayInfo'; import { BcmcInfo } from './bcmcInfo'; import { CartesBancairesInfo } from './cartesBancairesInfo'; import { GiroPayInfo } from './giroPayInfo'; +import { GooglePayInfo } from './googlePayInfo'; import { KlarnaInfo } from './klarnaInfo'; +import { MealVoucherFRInfo } from './mealVoucherFRInfo'; import { PayPalInfo } from './payPalInfo'; import { SofortInfo } from './sofortInfo'; import { SwishInfo } from './swishInfo'; @@ -37,17 +39,27 @@ export class PaymentMethod { */ 'currencies'?: Array; /** + * The list of custom routing flags to route payment to the intended acquirer. + */ + 'customRoutingFlags'?: Array; + /** * Indicates whether the payment method is enabled (**true**) or disabled (**false**). */ 'enabled'?: boolean; 'giroPay'?: GiroPayInfo; + 'googlePay'?: GooglePayInfo; /** * The identifier of the resource. */ 'id': string; 'klarna'?: KlarnaInfo; + 'mealVoucherFR'?: MealVoucherFRInfo; 'paypal'?: PayPalInfo; /** + * Your reference for the payment method. Supported characters a-z, A-Z, 0-9. + */ + 'reference'?: string; + /** * The sales channel. */ 'shopperInteraction'?: string; @@ -104,6 +116,11 @@ export class PaymentMethod { "baseName": "currencies", "type": "Array" }, + { + "name": "customRoutingFlags", + "baseName": "customRoutingFlags", + "type": "Array" + }, { "name": "enabled", "baseName": "enabled", @@ -114,6 +131,11 @@ export class PaymentMethod { "baseName": "giroPay", "type": "GiroPayInfo" }, + { + "name": "googlePay", + "baseName": "googlePay", + "type": "GooglePayInfo" + }, { "name": "id", "baseName": "id", @@ -124,11 +146,21 @@ export class PaymentMethod { "baseName": "klarna", "type": "KlarnaInfo" }, + { + "name": "mealVoucherFR", + "baseName": "mealVoucher_FR", + "type": "MealVoucherFRInfo" + }, { "name": "paypal", "baseName": "paypal", "type": "PayPalInfo" }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, { "name": "shopperInteraction", "baseName": "shopperInteraction", diff --git a/src/typings/management/paymentMethodResponse.ts b/src/typings/management/paymentMethodResponse.ts index 1e747a0..787fab0 100644 --- a/src/typings/management/paymentMethodResponse.ts +++ b/src/typings/management/paymentMethodResponse.ts @@ -24,6 +24,10 @@ export class PaymentMethodResponse { * Total number of pages. */ 'pagesTotal': number; + /** + * Payment method types with errors. + */ + 'typesWithErrors'?: Array; static discriminator: string | undefined = undefined; @@ -47,6 +51,11 @@ export class PaymentMethodResponse { "name": "pagesTotal", "baseName": "pagesTotal", "type": "number" + }, + { + "name": "typesWithErrors", + "baseName": "typesWithErrors", + "type": "Array" } ]; static getAttributeTypeMap() { @@ -54,3 +63,50 @@ export class PaymentMethodResponse { } } +export namespace PaymentMethodResponse { + export enum TypesWithErrorsEnum { + Alipay = 'alipay', + Amex = 'amex', + Applepay = 'applepay', + Bcmc = 'bcmc', + Blik = 'blik', + Cartebancaire = 'cartebancaire', + Cup = 'cup', + Diners = 'diners', + DirectEbanking = 'directEbanking', + DirectdebitGb = 'directdebit_GB', + Discover = 'discover', + EbankingFi = 'ebanking_FI', + EftposAustralia = 'eftpos_australia', + Elo = 'elo', + Elocredit = 'elocredit', + Elodebit = 'elodebit', + Girocard = 'girocard', + Giropay = 'giropay', + Googlepay = 'googlepay', + Hiper = 'hiper', + Hipercard = 'hipercard', + Ideal = 'ideal', + InteracCard = 'interac_card', + Jcb = 'jcb', + Klarna = 'klarna', + KlarnaAccount = 'klarna_account', + KlarnaPaynow = 'klarna_paynow', + Maestro = 'maestro', + Mbway = 'mbway', + Mc = 'mc', + Mcdebit = 'mcdebit', + MealVoucherFr = 'mealVoucher_FR', + Mobilepay = 'mobilepay', + Multibanco = 'multibanco', + Paypal = 'paypal', + Payshop = 'payshop', + Swish = 'swish', + Trustly = 'trustly', + Visa = 'visa', + Visadebit = 'visadebit', + Vpay = 'vpay', + Wechatpay = 'wechatpay', + WechatpayPos = 'wechatpay_pos' + } +} diff --git a/src/typings/management/paymentMethodSetupInfo.ts b/src/typings/management/paymentMethodSetupInfo.ts index 97e840a..8b7046c 100644 --- a/src/typings/management/paymentMethodSetupInfo.ts +++ b/src/typings/management/paymentMethodSetupInfo.ts @@ -11,7 +11,9 @@ import { ApplePayInfo } from './applePayInfo'; import { BcmcInfo } from './bcmcInfo'; import { CartesBancairesInfo } from './cartesBancairesInfo'; import { GiroPayInfo } from './giroPayInfo'; +import { GooglePayInfo } from './googlePayInfo'; import { KlarnaInfo } from './klarnaInfo'; +import { MealVoucherFRInfo } from './mealVoucherFRInfo'; import { PayPalInfo } from './payPalInfo'; import { SofortInfo } from './sofortInfo'; import { SwishInfo } from './swishInfo'; @@ -32,10 +34,20 @@ export class PaymentMethodSetupInfo { * The list of currencies that a payment method supports. By default, all currencies supported by the payment method. */ 'currencies'?: Array; + /** + * The list of custom routing flags to route payment to the intended acquirer. + */ + 'customRoutingFlags'?: Array; 'giroPay'?: GiroPayInfo; + 'googlePay'?: GooglePayInfo; 'klarna'?: KlarnaInfo; + 'mealVoucherFR'?: MealVoucherFRInfo; 'paypal'?: PayPalInfo; /** + * Your reference for the payment method. Supported characters a-z, A-Z, 0-9. + */ + 'reference'?: string; + /** * The sales channel. Required if the merchant account does not have a sales channel. When you provide this field, it overrides the default sales channel set on the merchant account. Possible values: **eCommerce**, **pos**, **contAuth**, and **moto**. */ 'shopperInteraction'?: PaymentMethodSetupInfo.ShopperInteractionEnum; @@ -48,7 +60,7 @@ export class PaymentMethodSetupInfo { /** * Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). */ - 'type': PaymentMethodSetupInfo.TypeEnum; + 'type'?: PaymentMethodSetupInfo.TypeEnum; static discriminator: string | undefined = undefined; @@ -83,21 +95,41 @@ export class PaymentMethodSetupInfo { "baseName": "currencies", "type": "Array" }, + { + "name": "customRoutingFlags", + "baseName": "customRoutingFlags", + "type": "Array" + }, { "name": "giroPay", "baseName": "giroPay", "type": "GiroPayInfo" }, + { + "name": "googlePay", + "baseName": "googlePay", + "type": "GooglePayInfo" + }, { "name": "klarna", "baseName": "klarna", "type": "KlarnaInfo" }, + { + "name": "mealVoucherFR", + "baseName": "mealVoucher_FR", + "type": "MealVoucherFRInfo" + }, { "name": "paypal", "baseName": "paypal", "type": "PayPalInfo" }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, { "name": "shopperInteraction", "baseName": "shopperInteraction", @@ -150,8 +182,14 @@ export namespace PaymentMethodSetupInfo { Discover = 'discover', EbankingFi = 'ebanking_FI', EftposAustralia = 'eftpos_australia', + Elo = 'elo', + Elocredit = 'elocredit', + Elodebit = 'elodebit', Girocard = 'girocard', Giropay = 'giropay', + Googlepay = 'googlepay', + Hiper = 'hiper', + Hipercard = 'hipercard', Ideal = 'ideal', InteracCard = 'interac_card', Jcb = 'jcb', @@ -161,6 +199,8 @@ export namespace PaymentMethodSetupInfo { Maestro = 'maestro', Mbway = 'mbway', Mc = 'mc', + Mcdebit = 'mcdebit', + MealVoucherFr = 'mealVoucher_FR', Mobilepay = 'mobilepay', Multibanco = 'multibanco', Paypal = 'paypal', @@ -168,6 +208,8 @@ export namespace PaymentMethodSetupInfo { Swish = 'swish', Trustly = 'trustly', Visa = 'visa', + Visadebit = 'visadebit', + Vpay = 'vpay', Wechatpay = 'wechatpay', WechatpayPos = 'wechatpay_pos' } diff --git a/src/typings/management/shopperStatement.ts b/src/typings/management/shopperStatement.ts index 6a5cb4e..235f52d 100644 --- a/src/typings/management/shopperStatement.ts +++ b/src/typings/management/shopperStatement.ts @@ -12,7 +12,7 @@ export class ShopperStatement { /** * The name you want to be shown on the shopper\'s bank or credit card statement. Maximum length: 22 characters; can\'t be all numbers. */ - 'doingBusinessAsName': string; + 'doingBusinessAsName'?: string; /** * The type of shopperstatement you want to use: fixed, append or dynamic */ diff --git a/src/typings/management/signature.ts b/src/typings/management/signature.ts index 06fd335..b5679e7 100644 --- a/src/typings/management/signature.ts +++ b/src/typings/management/signature.ts @@ -18,6 +18,10 @@ export class Signature { */ 'deviceName'?: string; /** + * Slogan shown on the start screen of the device. + */ + 'deviceSlogan'?: string; + /** * Skip asking for a signature. This is possible because all global card schemes (American Express, Diners, Discover, JCB, MasterCard, VISA, and UnionPay) regard a signature as optional. */ 'skipSignature'?: boolean; @@ -35,6 +39,11 @@ export class Signature { "baseName": "deviceName", "type": "string" }, + { + "name": "deviceSlogan", + "baseName": "deviceSlogan", + "type": "string" + }, { "name": "skipSignature", "baseName": "skipSignature", diff --git a/src/typings/management/standalone.ts b/src/typings/management/standalone.ts new file mode 100644 index 0000000..3a4385b --- /dev/null +++ b/src/typings/management/standalone.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Standalone { + /** + * The default currency that will be used when the device is in standalone mode (ISO 4217 - 3 letter code). + */ + 'currencyCode'?: string; + /** + * Enable standalone mode. + */ + 'enableStandalone'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "currencyCode", + "baseName": "currencyCode", + "type": "string" + }, + { + "name": "enableStandalone", + "baseName": "enableStandalone", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return Standalone.attributeTypeMap; + } +} + diff --git a/src/typings/management/swishInfo.ts b/src/typings/management/swishInfo.ts index efb5187..e8e5b50 100644 --- a/src/typings/management/swishInfo.ts +++ b/src/typings/management/swishInfo.ts @@ -12,7 +12,7 @@ export class SwishInfo { /** * Swish number. Format: 10 digits without spaces. For example, **1231111111**. */ - 'swishNumber': string; + 'swishNumber'?: string; static discriminator: string | undefined = undefined; diff --git a/src/typings/management/terminalSettings.ts b/src/typings/management/terminalSettings.ts index 5858250..d91dd14 100644 --- a/src/typings/management/terminalSettings.ts +++ b/src/typings/management/terminalSettings.ts @@ -14,9 +14,11 @@ import { Hardware } from './hardware'; import { Nexo } from './nexo'; import { OfflineProcessing } from './offlineProcessing'; import { Opi } from './opi'; +import { Passcodes } from './passcodes'; import { ReceiptOptions } from './receiptOptions'; import { ReceiptPrinting } from './receiptPrinting'; import { Signature } from './signature'; +import { Standalone } from './standalone'; import { Surcharge } from './surcharge'; import { Timeouts } from './timeouts'; import { WifiProfiles } from './wifiProfiles'; @@ -32,9 +34,11 @@ export class TerminalSettings { 'nexo'?: Nexo; 'offlineProcessing'?: OfflineProcessing; 'opi'?: Opi; + 'passcodes'?: Passcodes; 'receiptOptions'?: ReceiptOptions; 'receiptPrinting'?: ReceiptPrinting; 'signature'?: Signature; + 'standalone'?: Standalone; 'surcharge'?: Surcharge; 'timeouts'?: Timeouts; 'wifiProfiles'?: WifiProfiles; @@ -77,6 +81,11 @@ export class TerminalSettings { "baseName": "opi", "type": "Opi" }, + { + "name": "passcodes", + "baseName": "passcodes", + "type": "Passcodes" + }, { "name": "receiptOptions", "baseName": "receiptOptions", @@ -92,6 +101,11 @@ export class TerminalSettings { "baseName": "signature", "type": "Signature" }, + { + "name": "standalone", + "baseName": "standalone", + "type": "Standalone" + }, { "name": "surcharge", "baseName": "surcharge", diff --git a/src/typings/management/updatePaymentMethodInfo.ts b/src/typings/management/updatePaymentMethodInfo.ts index c2f8587..06a7845 100644 --- a/src/typings/management/updatePaymentMethodInfo.ts +++ b/src/typings/management/updatePaymentMethodInfo.ts @@ -19,6 +19,10 @@ export class UpdatePaymentMethodInfo { */ 'currencies'?: Array; /** + * Custom routing flags for acquirer routing. + */ + 'customRoutingFlags'?: Array; + /** * Indicates whether the payment method is enabled (**true**) or disabled (**false**). */ 'enabled'?: boolean; @@ -37,6 +41,11 @@ export class UpdatePaymentMethodInfo { "baseName": "currencies", "type": "Array" }, + { + "name": "customRoutingFlags", + "baseName": "customRoutingFlags", + "type": "Array" + }, { "name": "enabled", "baseName": "enabled", diff --git a/src/typings/management/user.ts b/src/typings/management/user.ts index e694b80..1dcf122 100644 --- a/src/typings/management/user.ts +++ b/src/typings/management/user.ts @@ -40,7 +40,7 @@ export class User { /** * The username for this user. */ - 'username': string; + 'username'?: string; static discriminator: string | undefined = undefined; diff --git a/templates/typescript/api-all.mustache b/templates/typescript/api-all.mustache new file mode 100644 index 0000000..2e8d1aa --- /dev/null +++ b/templates/typescript/api-all.mustache @@ -0,0 +1,25 @@ +{{>licenseInfo}} + +{{#apiInfo}} +import Service from "../service"; +import Client from "../client"; + +{{#apis}} +{{#operations}} +import {{ classname }} from './{{serviceName}}/{{ classFilename }}'; +{{/operations}} +{{/apis}} + +export default class {{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}} extends Service { + public constructor(client: Client) { + super(client); + } +{{#apis}} + {{#operations}} + public get {{ classname }}() { + return new {{ classname }}(this.client); + } + {{/operations}} +{{/apis}} +} +{{/apiInfo}} \ No newline at end of file diff --git a/templates/typescript/api-single.mustache b/templates/typescript/api-single.mustache new file mode 100644 index 0000000..52aa697 --- /dev/null +++ b/templates/typescript/api-single.mustache @@ -0,0 +1,43 @@ +{{>licenseInfo}} + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +/* tslint:disable:no-unused-locals */ +{{#imports}} +import { {{classname}} } from '../../typings/{{serviceName}}/models'; +{{/imports}} +import { IRequest } from "../../typings/requestOptions"; +import {{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}Resource from "../resource/{{serviceName}}/{{serviceName}}Resource"; +import { ObjectSerializer } from "../../typings/{{serviceName}}/models"; + +{{#operations}} + +export default class {{classname}} extends Service { +{{#operation}} + /** + {{#summary}} + * @summary {{&summary}} + {{/summary}} + {{#allParams}} + * @param {{paramName}} {{description}} + {{/allParams}} + */ + public async {{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{nickname}}{{/vendorExtensions.x-methodName}}({{#pathParams}}{{paramName}}: {{{dataType}}}, {{/pathParams}}{{#bodyParams}}{{paramName}}: {{{dataType}}}, {{/bodyParams}}requestOptions?: IRequest.Options): Promise<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { + const localVarPath = "{{{path}}}"{{#pathParams}} + .replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; + const resource = new {{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}Resource(this, localVarPath); +{{#bodyParam}} + const request: {{{dataType}}} = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"); +{{/bodyParam}} + {{#returnType}}const response = {{/returnType}}await getJsonResponse<{{#bodyParam}}{{{dataType}}}{{/bodyParam}}{{^bodyParam}}string{{/bodyParam}}, {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}}>( + resource, + {{#bodyParam}}request{{/bodyParam}}{{^bodyParam}}""{{/bodyParam}}, + { ...requestOptions, method: "{{httpMethod}}" } + ); + {{#returnType}} + return ObjectSerializer.deserialize(response, "{{{.}}}"); + {{/returnType}} + } +{{/operation}} +} +{{/operations}}