api/subscriptions-api.ts
/* tslint:disable */
/* eslint-disable */
/**
* Conekta API
* Conekta sdk
*
* The version of the OpenAPI document: 2.1.0
* Contact: engineering@conekta.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { ModelError } from '../model';
// @ts-ignore
import { SubscriptionEventsResponse } from '../model';
// @ts-ignore
import { SubscriptionRequest } from '../model';
// @ts-ignore
import { SubscriptionResponse } from '../model';
// @ts-ignore
import { SubscriptionUpdateRequest } from '../model';
/**
* SubscriptionsApi - axios parameter creator
* @export
*/
export const SubscriptionsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* You can cancel the subscription to stop the plans that your customers consume
* @summary Cancel Subscription
* @param {string} id Identifier of the resource
* @param {CancelSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cancelSubscription: async (id: string, acceptLanguage?: CancelSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('cancelSubscription', 'id', id)
const localVarPath = `/customers/{id}/subscription/cancel`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* You can create the subscription to include the plans that your customers consume
* @summary Create Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionRequest} subscriptionRequest requested field for subscriptions
* @param {CreateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createSubscription: async (id: string, subscriptionRequest: SubscriptionRequest, acceptLanguage?: CreateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('createSubscription', 'id', id)
// verify required parameter 'subscriptionRequest' is not null or undefined
assertParamExists('createSubscription', 'subscriptionRequest', subscriptionRequest)
const localVarPath = `/customers/{id}/subscription`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(subscriptionRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* You can get the events of the subscription(s) of a client, with the customer id
* @summary Get Events By Subscription
* @param {string} id Identifier of the resource
* @param {GetAllEventsFromSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllEventsFromSubscription: async (id: string, acceptLanguage?: GetAllEventsFromSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('getAllEventsFromSubscription', 'id', id)
const localVarPath = `/customers/{id}/subscription/events`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get Subscription
* @param {string} id Identifier of the resource
* @param {GetSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSubscription: async (id: string, acceptLanguage?: GetSubscriptionAcceptLanguageEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('getSubscription', 'id', id)
const localVarPath = `/customers/{id}/subscription`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* You can pause the subscription to stop the plans that your customers consume
* @summary Pause Subscription
* @param {string} id Identifier of the resource
* @param {PauseSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
pauseSubscription: async (id: string, acceptLanguage?: PauseSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('pauseSubscription', 'id', id)
const localVarPath = `/customers/{id}/subscription/pause`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* You can resume the subscription to start the plans that your customers consume
* @summary Resume Subscription
* @param {string} id Identifier of the resource
* @param {ResumeSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resumeSubscription: async (id: string, acceptLanguage?: ResumeSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('resumeSubscription', 'id', id)
const localVarPath = `/customers/{id}/subscription/resume`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* You can modify the subscription to change the plans that your customers consume
* @summary Update Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionUpdateRequest} subscriptionUpdateRequest requested field for update a subscription
* @param {UpdateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSubscription: async (id: string, subscriptionUpdateRequest: SubscriptionUpdateRequest, acceptLanguage?: UpdateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('updateSubscription', 'id', id)
// verify required parameter 'subscriptionUpdateRequest' is not null or undefined
assertParamExists('updateSubscription', 'subscriptionUpdateRequest', subscriptionUpdateRequest)
const localVarPath = `/customers/{id}/subscription`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(subscriptionUpdateRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* SubscriptionsApi - functional programming interface
* @export
*/
export const SubscriptionsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = SubscriptionsApiAxiosParamCreator(configuration)
return {
/**
* You can cancel the subscription to stop the plans that your customers consume
* @summary Cancel Subscription
* @param {string} id Identifier of the resource
* @param {CancelSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async cancelSubscription(id: string, acceptLanguage?: CancelSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.cancelSubscription(id, acceptLanguage, xChildCompanyId, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['SubscriptionsApi.cancelSubscription']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
* You can create the subscription to include the plans that your customers consume
* @summary Create Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionRequest} subscriptionRequest requested field for subscriptions
* @param {CreateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createSubscription(id: string, subscriptionRequest: SubscriptionRequest, acceptLanguage?: CreateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createSubscription(id, subscriptionRequest, acceptLanguage, xChildCompanyId, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['SubscriptionsApi.createSubscription']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
* You can get the events of the subscription(s) of a client, with the customer id
* @summary Get Events By Subscription
* @param {string} id Identifier of the resource
* @param {GetAllEventsFromSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllEventsFromSubscription(id: string, acceptLanguage?: GetAllEventsFromSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionEventsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllEventsFromSubscription(id, acceptLanguage, xChildCompanyId, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['SubscriptionsApi.getAllEventsFromSubscription']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @summary Get Subscription
* @param {string} id Identifier of the resource
* @param {GetSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSubscription(id: string, acceptLanguage?: GetSubscriptionAcceptLanguageEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getSubscription(id, acceptLanguage, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['SubscriptionsApi.getSubscription']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
* You can pause the subscription to stop the plans that your customers consume
* @summary Pause Subscription
* @param {string} id Identifier of the resource
* @param {PauseSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async pauseSubscription(id: string, acceptLanguage?: PauseSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.pauseSubscription(id, acceptLanguage, xChildCompanyId, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['SubscriptionsApi.pauseSubscription']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
* You can resume the subscription to start the plans that your customers consume
* @summary Resume Subscription
* @param {string} id Identifier of the resource
* @param {ResumeSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async resumeSubscription(id: string, acceptLanguage?: ResumeSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.resumeSubscription(id, acceptLanguage, xChildCompanyId, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['SubscriptionsApi.resumeSubscription']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
* You can modify the subscription to change the plans that your customers consume
* @summary Update Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionUpdateRequest} subscriptionUpdateRequest requested field for update a subscription
* @param {UpdateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateSubscription(id: string, subscriptionUpdateRequest: SubscriptionUpdateRequest, acceptLanguage?: UpdateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateSubscription(id, subscriptionUpdateRequest, acceptLanguage, xChildCompanyId, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['SubscriptionsApi.updateSubscription']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
}
};
/**
* SubscriptionsApi - factory interface
* @export
*/
export const SubscriptionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = SubscriptionsApiFp(configuration)
return {
/**
* You can cancel the subscription to stop the plans that your customers consume
* @summary Cancel Subscription
* @param {string} id Identifier of the resource
* @param {CancelSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cancelSubscription(id: string, acceptLanguage?: CancelSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<SubscriptionResponse> {
return localVarFp.cancelSubscription(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
},
/**
* You can create the subscription to include the plans that your customers consume
* @summary Create Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionRequest} subscriptionRequest requested field for subscriptions
* @param {CreateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createSubscription(id: string, subscriptionRequest: SubscriptionRequest, acceptLanguage?: CreateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<SubscriptionResponse> {
return localVarFp.createSubscription(id, subscriptionRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
},
/**
* You can get the events of the subscription(s) of a client, with the customer id
* @summary Get Events By Subscription
* @param {string} id Identifier of the resource
* @param {GetAllEventsFromSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllEventsFromSubscription(id: string, acceptLanguage?: GetAllEventsFromSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<SubscriptionEventsResponse> {
return localVarFp.getAllEventsFromSubscription(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Get Subscription
* @param {string} id Identifier of the resource
* @param {GetSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSubscription(id: string, acceptLanguage?: GetSubscriptionAcceptLanguageEnum, options?: any): AxiosPromise<SubscriptionResponse> {
return localVarFp.getSubscription(id, acceptLanguage, options).then((request) => request(axios, basePath));
},
/**
* You can pause the subscription to stop the plans that your customers consume
* @summary Pause Subscription
* @param {string} id Identifier of the resource
* @param {PauseSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
pauseSubscription(id: string, acceptLanguage?: PauseSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<SubscriptionResponse> {
return localVarFp.pauseSubscription(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
},
/**
* You can resume the subscription to start the plans that your customers consume
* @summary Resume Subscription
* @param {string} id Identifier of the resource
* @param {ResumeSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resumeSubscription(id: string, acceptLanguage?: ResumeSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<SubscriptionResponse> {
return localVarFp.resumeSubscription(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
},
/**
* You can modify the subscription to change the plans that your customers consume
* @summary Update Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionUpdateRequest} subscriptionUpdateRequest requested field for update a subscription
* @param {UpdateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSubscription(id: string, subscriptionUpdateRequest: SubscriptionUpdateRequest, acceptLanguage?: UpdateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<SubscriptionResponse> {
return localVarFp.updateSubscription(id, subscriptionUpdateRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
},
};
};
/**
* SubscriptionsApi - interface
* @export
* @interface SubscriptionsApi
*/
export interface SubscriptionsApiInterface {
/**
* You can cancel the subscription to stop the plans that your customers consume
* @summary Cancel Subscription
* @param {string} id Identifier of the resource
* @param {CancelSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApiInterface
*/
cancelSubscription(id: string, acceptLanguage?: CancelSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionResponse>;
/**
* You can create the subscription to include the plans that your customers consume
* @summary Create Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionRequest} subscriptionRequest requested field for subscriptions
* @param {CreateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApiInterface
*/
createSubscription(id: string, subscriptionRequest: SubscriptionRequest, acceptLanguage?: CreateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionResponse>;
/**
* You can get the events of the subscription(s) of a client, with the customer id
* @summary Get Events By Subscription
* @param {string} id Identifier of the resource
* @param {GetAllEventsFromSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApiInterface
*/
getAllEventsFromSubscription(id: string, acceptLanguage?: GetAllEventsFromSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionEventsResponse>;
/**
*
* @summary Get Subscription
* @param {string} id Identifier of the resource
* @param {GetSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApiInterface
*/
getSubscription(id: string, acceptLanguage?: GetSubscriptionAcceptLanguageEnum, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionResponse>;
/**
* You can pause the subscription to stop the plans that your customers consume
* @summary Pause Subscription
* @param {string} id Identifier of the resource
* @param {PauseSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApiInterface
*/
pauseSubscription(id: string, acceptLanguage?: PauseSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionResponse>;
/**
* You can resume the subscription to start the plans that your customers consume
* @summary Resume Subscription
* @param {string} id Identifier of the resource
* @param {ResumeSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApiInterface
*/
resumeSubscription(id: string, acceptLanguage?: ResumeSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionResponse>;
/**
* You can modify the subscription to change the plans that your customers consume
* @summary Update Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionUpdateRequest} subscriptionUpdateRequest requested field for update a subscription
* @param {UpdateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApiInterface
*/
updateSubscription(id: string, subscriptionUpdateRequest: SubscriptionUpdateRequest, acceptLanguage?: UpdateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionResponse>;
}
/**
* SubscriptionsApi - object-oriented interface
* @export
* @class SubscriptionsApi
* @extends {BaseAPI}
*/
export class SubscriptionsApi extends BaseAPI implements SubscriptionsApiInterface {
/**
* You can cancel the subscription to stop the plans that your customers consume
* @summary Cancel Subscription
* @param {string} id Identifier of the resource
* @param {CancelSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApi
*/
public cancelSubscription(id: string, acceptLanguage?: CancelSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
return SubscriptionsApiFp(this.configuration).cancelSubscription(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
}
/**
* You can create the subscription to include the plans that your customers consume
* @summary Create Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionRequest} subscriptionRequest requested field for subscriptions
* @param {CreateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApi
*/
public createSubscription(id: string, subscriptionRequest: SubscriptionRequest, acceptLanguage?: CreateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
return SubscriptionsApiFp(this.configuration).createSubscription(id, subscriptionRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
}
/**
* You can get the events of the subscription(s) of a client, with the customer id
* @summary Get Events By Subscription
* @param {string} id Identifier of the resource
* @param {GetAllEventsFromSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApi
*/
public getAllEventsFromSubscription(id: string, acceptLanguage?: GetAllEventsFromSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
return SubscriptionsApiFp(this.configuration).getAllEventsFromSubscription(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get Subscription
* @param {string} id Identifier of the resource
* @param {GetSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApi
*/
public getSubscription(id: string, acceptLanguage?: GetSubscriptionAcceptLanguageEnum, options?: RawAxiosRequestConfig) {
return SubscriptionsApiFp(this.configuration).getSubscription(id, acceptLanguage, options).then((request) => request(this.axios, this.basePath));
}
/**
* You can pause the subscription to stop the plans that your customers consume
* @summary Pause Subscription
* @param {string} id Identifier of the resource
* @param {PauseSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApi
*/
public pauseSubscription(id: string, acceptLanguage?: PauseSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
return SubscriptionsApiFp(this.configuration).pauseSubscription(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
}
/**
* You can resume the subscription to start the plans that your customers consume
* @summary Resume Subscription
* @param {string} id Identifier of the resource
* @param {ResumeSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApi
*/
public resumeSubscription(id: string, acceptLanguage?: ResumeSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
return SubscriptionsApiFp(this.configuration).resumeSubscription(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
}
/**
* You can modify the subscription to change the plans that your customers consume
* @summary Update Subscription
* @param {string} id Identifier of the resource
* @param {SubscriptionUpdateRequest} subscriptionUpdateRequest requested field for update a subscription
* @param {UpdateSubscriptionAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscriptionsApi
*/
public updateSubscription(id: string, subscriptionUpdateRequest: SubscriptionUpdateRequest, acceptLanguage?: UpdateSubscriptionAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
return SubscriptionsApiFp(this.configuration).updateSubscription(id, subscriptionUpdateRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* @export
*/
export const CancelSubscriptionAcceptLanguageEnum = {
es: 'es',
en: 'en'
} as const;
export type CancelSubscriptionAcceptLanguageEnum = typeof CancelSubscriptionAcceptLanguageEnum[keyof typeof CancelSubscriptionAcceptLanguageEnum];
/**
* @export
*/
export const CreateSubscriptionAcceptLanguageEnum = {
es: 'es',
en: 'en'
} as const;
export type CreateSubscriptionAcceptLanguageEnum = typeof CreateSubscriptionAcceptLanguageEnum[keyof typeof CreateSubscriptionAcceptLanguageEnum];
/**
* @export
*/
export const GetAllEventsFromSubscriptionAcceptLanguageEnum = {
es: 'es',
en: 'en'
} as const;
export type GetAllEventsFromSubscriptionAcceptLanguageEnum = typeof GetAllEventsFromSubscriptionAcceptLanguageEnum[keyof typeof GetAllEventsFromSubscriptionAcceptLanguageEnum];
/**
* @export
*/
export const GetSubscriptionAcceptLanguageEnum = {
es: 'es',
en: 'en'
} as const;
export type GetSubscriptionAcceptLanguageEnum = typeof GetSubscriptionAcceptLanguageEnum[keyof typeof GetSubscriptionAcceptLanguageEnum];
/**
* @export
*/
export const PauseSubscriptionAcceptLanguageEnum = {
es: 'es',
en: 'en'
} as const;
export type PauseSubscriptionAcceptLanguageEnum = typeof PauseSubscriptionAcceptLanguageEnum[keyof typeof PauseSubscriptionAcceptLanguageEnum];
/**
* @export
*/
export const ResumeSubscriptionAcceptLanguageEnum = {
es: 'es',
en: 'en'
} as const;
export type ResumeSubscriptionAcceptLanguageEnum = typeof ResumeSubscriptionAcceptLanguageEnum[keyof typeof ResumeSubscriptionAcceptLanguageEnum];
/**
* @export
*/
export const UpdateSubscriptionAcceptLanguageEnum = {
es: 'es',
en: 'en'
} as const;
export type UpdateSubscriptionAcceptLanguageEnum = typeof UpdateSubscriptionAcceptLanguageEnum[keyof typeof UpdateSubscriptionAcceptLanguageEnum];