|
| 1 | +/* |
| 2 | + * The version of the OpenAPI document: v3 |
| 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 | + CheckTaxElectronicDeliveryConsentResponse, |
| 15 | + SetTaxElectronicDeliveryConsentRequest, |
| 16 | + ObjectSerializer |
| 17 | +} from "../../typings/legalEntityManagement/models"; |
| 18 | +import { IRequest } from "../../typings/requestOptions"; |
| 19 | +import Resource from "../resource"; |
| 20 | + |
| 21 | +export class TaxEDeliveryConsentApi extends Service { |
| 22 | + |
| 23 | + private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3"; |
| 24 | + private baseUrl: string; |
| 25 | + |
| 26 | + public constructor(client: Client){ |
| 27 | + super(client); |
| 28 | + this.baseUrl = this.createBaseUrl(this.API_BASEPATH); |
| 29 | + } |
| 30 | + |
| 31 | + /** |
| 32 | + * @summary Check the status of consent for electronic delivery of tax forms |
| 33 | + * @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. For organizations, this is the ID of the organization. |
| 34 | + * @param requestOptions {@link IRequest.Options } |
| 35 | + * @return {@link CheckTaxElectronicDeliveryConsentResponse } |
| 36 | + */ |
| 37 | + public async checkStatusOfConsentForElectronicDeliveryOfTaxForms(id: string, requestOptions?: IRequest.Options): Promise<CheckTaxElectronicDeliveryConsentResponse> { |
| 38 | + const endpoint = `${this.baseUrl}/legalEntities/{id}/checkTaxElectronicDeliveryConsent` |
| 39 | + .replace("{" + "id" + "}", encodeURIComponent(String(id))); |
| 40 | + const resource = new Resource(this, endpoint); |
| 41 | + const response = await getJsonResponse<string, CheckTaxElectronicDeliveryConsentResponse>( |
| 42 | + resource, |
| 43 | + "", |
| 44 | + { ...requestOptions, method: "POST" } |
| 45 | + ); |
| 46 | + return ObjectSerializer.deserialize(response, "CheckTaxElectronicDeliveryConsentResponse"); |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * @summary Set the consent status for electronic delivery of tax forms |
| 51 | + * @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. For organizations, this is the ID of the organization. |
| 52 | + * @param setTaxElectronicDeliveryConsentRequest {@link SetTaxElectronicDeliveryConsentRequest } |
| 53 | + * @param requestOptions {@link IRequest.Options } |
| 54 | + */ |
| 55 | + public async setConsentStatusForElectronicDeliveryOfTaxForms(id: string, setTaxElectronicDeliveryConsentRequest: SetTaxElectronicDeliveryConsentRequest, requestOptions?: IRequest.Options): Promise<void> { |
| 56 | + const endpoint = `${this.baseUrl}/legalEntities/{id}/setTaxElectronicDeliveryConsent` |
| 57 | + .replace("{" + "id" + "}", encodeURIComponent(String(id))); |
| 58 | + const resource = new Resource(this, endpoint); |
| 59 | + const request: SetTaxElectronicDeliveryConsentRequest = ObjectSerializer.serialize(setTaxElectronicDeliveryConsentRequest, "SetTaxElectronicDeliveryConsentRequest"); |
| 60 | + await getJsonResponse<SetTaxElectronicDeliveryConsentRequest, void>( |
| 61 | + resource, |
| 62 | + request, |
| 63 | + { ...requestOptions, method: "POST" } |
| 64 | + ); |
| 65 | + } |
| 66 | +} |
0 commit comments