|
| 1 | +/* |
| 2 | + * The version of the OpenAPI document: v2 |
| 3 | + * |
| 4 | + * |
| 5 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 6 | + * https://openapi-generator.tech |
| 7 | + * Do not edit this class manually. |
| 8 | + */ |
| 9 | + |
| 10 | +import getJsonResponse from "../../helpers/getJsonResponse"; |
| 11 | +import Service from "../../service"; |
| 12 | +import Client from "../../client"; |
| 13 | +import { |
| 14 | + BalanceWebhookSettingsRequest, |
| 15 | + DefaultErrorResponseEntity, |
| 16 | + PatchableBalanceWebhookSettingsRequest, |
| 17 | + WebhookSettingResponse, |
| 18 | + ObjectSerializer |
| 19 | +} from "../../typings/balancePlatform/models"; |
| 20 | +import { IRequest } from "../../typings/requestOptions"; |
| 21 | +import Resource from "../resource"; |
| 22 | + |
| 23 | +export class BalancesApi extends Service { |
| 24 | + |
| 25 | + private readonly API_BASEPATH: string = "https://balanceplatform-api-test.adyen.com/bcl/v2"; |
| 26 | + private baseUrl: string; |
| 27 | + |
| 28 | + public constructor(client: Client){ |
| 29 | + super(client); |
| 30 | + this.baseUrl = this.createBaseUrl(this.API_BASEPATH); |
| 31 | + } |
| 32 | + |
| 33 | + /** |
| 34 | + * @summary Get webhook settings |
| 35 | + * @param balancePlatformId {@link string } The unique identifier of the balance platform. |
| 36 | + * @param webhookId {@link string } The unique identifier of the balance webhook. |
| 37 | + * @param requestOptions {@link IRequest.Options } |
| 38 | + * @return {@link Array<WebhookSettingResponse> } |
| 39 | + */ |
| 40 | + public async _null(balancePlatformId: string, webhookId: string, requestOptions?: IRequest.Options): Promise<Array<WebhookSettingResponse>> { |
| 41 | + const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings` |
| 42 | + .replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId))) |
| 43 | + .replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId))); |
| 44 | + const resource = new Resource(this, endpoint); |
| 45 | + const response = await getJsonResponse<string, Array<WebhookSettingResponse>>( |
| 46 | + resource, |
| 47 | + "", |
| 48 | + { ...requestOptions, method: "GET" } |
| 49 | + ); |
| 50 | + return ObjectSerializer.deserialize(response, "Array<WebhookSettingResponse>"); |
| 51 | + } |
| 52 | + |
| 53 | + /** |
| 54 | + * @summary Create a balance webhook setting |
| 55 | + * @param balancePlatformId {@link string } The unique identifier of the balance platform. |
| 56 | + * @param webhookId {@link string } The unique identifier of the balance webhook. |
| 57 | + * @param balanceWebhookSettingsRequest {@link BalanceWebhookSettingsRequest } |
| 58 | + * @param requestOptions {@link IRequest.Options } |
| 59 | + * @return {@link WebhookSettingResponse } |
| 60 | + */ |
| 61 | + public async _null_1(balancePlatformId: string, webhookId: string, balanceWebhookSettingsRequest: BalanceWebhookSettingsRequest, requestOptions?: IRequest.Options): Promise<WebhookSettingResponse> { |
| 62 | + const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings` |
| 63 | + .replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId))) |
| 64 | + .replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId))); |
| 65 | + const resource = new Resource(this, endpoint); |
| 66 | + const request: BalanceWebhookSettingsRequest = ObjectSerializer.serialize(balanceWebhookSettingsRequest, "BalanceWebhookSettingsRequest"); |
| 67 | + const response = await getJsonResponse<BalanceWebhookSettingsRequest, WebhookSettingResponse>( |
| 68 | + resource, |
| 69 | + request, |
| 70 | + { ...requestOptions, method: "POST" } |
| 71 | + ); |
| 72 | + return ObjectSerializer.deserialize(response, "WebhookSettingResponse"); |
| 73 | + } |
| 74 | + |
| 75 | + /** |
| 76 | + * @summary Get a webhook setting |
| 77 | + * @param balancePlatformId {@link string } The unique identifier of the balance platform. |
| 78 | + * @param webhookId {@link string } The unique identifier of the balance webhook. |
| 79 | + * @param settingId {@link string } The unique identifier of the balance webhook setting. |
| 80 | + * @param requestOptions {@link IRequest.Options } |
| 81 | + * @return {@link WebhookSettingResponse } |
| 82 | + */ |
| 83 | + public async _null_2(balancePlatformId: string, webhookId: string, settingId: string, requestOptions?: IRequest.Options): Promise<WebhookSettingResponse> { |
| 84 | + const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}` |
| 85 | + .replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId))) |
| 86 | + .replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId))) |
| 87 | + .replace("{" + "settingId" + "}", encodeURIComponent(String(settingId))); |
| 88 | + const resource = new Resource(this, endpoint); |
| 89 | + const response = await getJsonResponse<string, WebhookSettingResponse>( |
| 90 | + resource, |
| 91 | + "", |
| 92 | + { ...requestOptions, method: "GET" } |
| 93 | + ); |
| 94 | + return ObjectSerializer.deserialize(response, "WebhookSettingResponse"); |
| 95 | + } |
| 96 | + |
| 97 | + /** |
| 98 | + * @summary Delete a webhook setting |
| 99 | + * @param balancePlatformId {@link string } The unique identifier of the balance platform. |
| 100 | + * @param webhookId {@link string } The unique identifier of the balance webhook. |
| 101 | + * @param settingId {@link string } The unique identifier of the balance webhook setting. |
| 102 | + * @param requestOptions {@link IRequest.Options } |
| 103 | + */ |
| 104 | + public async _null_3(balancePlatformId: string, webhookId: string, settingId: string, requestOptions?: IRequest.Options): Promise<void> { |
| 105 | + const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}` |
| 106 | + .replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId))) |
| 107 | + .replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId))) |
| 108 | + .replace("{" + "settingId" + "}", encodeURIComponent(String(settingId))); |
| 109 | + const resource = new Resource(this, endpoint); |
| 110 | + await getJsonResponse<string, void>( |
| 111 | + resource, |
| 112 | + "", |
| 113 | + { ...requestOptions, method: "DELETE" } |
| 114 | + ); |
| 115 | + } |
| 116 | + |
| 117 | + /** |
| 118 | + * @summary Update a webhook setting |
| 119 | + * @param balancePlatformId {@link string } The unique identifier of the balance platform. |
| 120 | + * @param webhookId {@link string } The unique identifier of the balance webhook. |
| 121 | + * @param settingId {@link string } The unique identifier of the balance webhook setting. |
| 122 | + * @param patchableBalanceWebhookSettingsRequest {@link PatchableBalanceWebhookSettingsRequest } |
| 123 | + * @param requestOptions {@link IRequest.Options } |
| 124 | + * @return {@link WebhookSettingResponse } |
| 125 | + */ |
| 126 | + public async _null_4(balancePlatformId: string, webhookId: string, settingId: string, patchableBalanceWebhookSettingsRequest: PatchableBalanceWebhookSettingsRequest, requestOptions?: IRequest.Options): Promise<WebhookSettingResponse> { |
| 127 | + const endpoint = `${this.baseUrl}/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}` |
| 128 | + .replace("{" + "balancePlatformId" + "}", encodeURIComponent(String(balancePlatformId))) |
| 129 | + .replace("{" + "webhookId" + "}", encodeURIComponent(String(webhookId))) |
| 130 | + .replace("{" + "settingId" + "}", encodeURIComponent(String(settingId))); |
| 131 | + const resource = new Resource(this, endpoint); |
| 132 | + const request: PatchableBalanceWebhookSettingsRequest = ObjectSerializer.serialize(patchableBalanceWebhookSettingsRequest, "PatchableBalanceWebhookSettingsRequest"); |
| 133 | + const response = await getJsonResponse<PatchableBalanceWebhookSettingsRequest, WebhookSettingResponse>( |
| 134 | + resource, |
| 135 | + request, |
| 136 | + { ...requestOptions, method: "PATCH" } |
| 137 | + ); |
| 138 | + return ObjectSerializer.deserialize(response, "WebhookSettingResponse"); |
| 139 | + } |
| 140 | +} |
0 commit comments