mirror of
https://github.com/jlengrand/adyen-node-api-library.git
synced 2026-03-10 08:01:20 +00:00
* PW-7514: Update models * PW-7514: Switch to JAR based installation * PW-7514: Default API template * PW-7514: Customize API template * PW-7514: Serialize request * PW-7514: Query string * PW-7514: Fix version patch * PW-7514: Client generated * PW-7514: Export class by default * PW-7514: Make path and body params required * PW-7514: Dynamic service name * PW-7514: Link all classes into one parent * PW-7514: Dynamic method names * PW-7514: Fix merge issues * PW-7514: Generate using latest specs Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com>
96 lines
4.9 KiB
TypeScript
96 lines
4.9 KiB
TypeScript
/*
|
|
* 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<void> {
|
|
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<string, void>(
|
|
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<AllowedOriginsResponse> {
|
|
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<string, AllowedOriginsResponse>(
|
|
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<AllowedOrigin> {
|
|
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<string, AllowedOrigin>(
|
|
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<AllowedOriginsResponse> {
|
|
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<AllowedOrigin, AllowedOriginsResponse>(
|
|
resource,
|
|
request,
|
|
{ ...requestOptions, method: "POST" }
|
|
);
|
|
return ObjectSerializer.deserialize(response, "AllowedOriginsResponse");
|
|
}
|
|
}
|