/* tslint:disable */ /* eslint-disable */ /** * Credify external API doc * API documentations. * * The version of the OpenAPI document: 1.0.0-oas3 * Contact: dev@credify.one * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // 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 } from '../base'; // @ts-ignore import { CampaignStatusQueryParam } from '../model'; // @ts-ignore import { CampaignsListResponse } from '../model'; // @ts-ignore import { CommonResponse } from '../model'; // @ts-ignore import { OIDCUserInfoResponse } from '../model'; // @ts-ignore import { OfferDetailResponse } from '../model'; // @ts-ignore import { OfferStatus } from '../model'; // @ts-ignore import { OfferTransactionStatusUpdateRequest } from '../model'; // @ts-ignore import { TokenResponse } from '../model'; /** * OIDCClientApi - axios parameter creator * @export */ export const OIDCClientApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This manages token usage of OIDC. * @summary OIDC token endpoint * @param {string} [code] * @param {'authozation_code' | 'password' | 'client_credentials' | 'refresh_token'} [grantType] * @param {string} [password] * @param {string} [redirectUri] * @param {string} [refreshToken] * @param {string} [scope] * @param {string} [username] * @param {string} [clientId] * @param {string} [clientSecret] * @param {*} [options] Override http request option. * @throws {RequiredError} */ generateToken: async (code?: string, grantType?: 'authozation_code' | 'password' | 'client_credentials' | 'refresh_token', password?: string, redirectUri?: string, refreshToken?: string, scope?: string, username?: string, clientId?: string, clientSecret?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/oauth2/token`; // 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 (code !== undefined) { localVarQueryParameter['code'] = code; } if (grantType !== undefined) { localVarQueryParameter['grant_type'] = grantType; } if (password !== undefined) { localVarQueryParameter['password'] = password; } if (redirectUri !== undefined) { localVarQueryParameter['redirect_uri'] = redirectUri; } if (refreshToken !== undefined) { localVarQueryParameter['refresh_token'] = refreshToken; } if (scope !== undefined) { localVarQueryParameter['scope'] = scope; } if (username !== undefined) { localVarQueryParameter['username'] = username; } if (clientId !== undefined) { localVarQueryParameter['client_id'] = clientId; } if (clientSecret !== undefined) { localVarQueryParameter['client_secret'] = clientSecret; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches a list of campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCampaignList: async (page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/oidc-clients/campaigns`; // 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 (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (campaignStatus !== undefined) { localVarQueryParameter['campaign_status'] = campaignStatus; } if (offerStatus !== undefined) { localVarQueryParameter['offer_status'] = offerStatus; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches a detail data of a specified offer. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferDetail: async (offerCode: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'offerCode' is not null or undefined assertParamExists('getOfferDetail', 'offerCode', offerCode) const localVarPath = `/v1/oidc-clients/offers/{offer_code}` .replace(`{${"offer_code"}}`, encodeURIComponent(String(offerCode))); // 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) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation requests to fetch encrypted scope values shared by users with an OIDC client. The OIDC client needs to use an ephemeral private key generated in the OIDC flow to decrypt the values. The response body will contain encrypted custom claim values as well as the standard claims. * @summary Encrypted scope values shared by users * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserInfo: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/userinfo`; // 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) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation updates onboarding status of an offer approval. This needs `oidc_client:write_transactions` scope. `code` and `description` are needed only when the status will be `FAILED`. * @summary Updates a status of offer redemption * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOnboardingStatus: async (id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('updateOnboardingStatus', 'id', id) const localVarPath = `/v1/oidc-clients/offers/transactions/{id}/status` .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) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = offerTransactionStatusUpdateRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * OIDCClientApi - functional programming interface * @export */ export const OIDCClientApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = OIDCClientApiAxiosParamCreator(configuration) return { /** * This manages token usage of OIDC. * @summary OIDC token endpoint * @param {string} [code] * @param {'authozation_code' | 'password' | 'client_credentials' | 'refresh_token'} [grantType] * @param {string} [password] * @param {string} [redirectUri] * @param {string} [refreshToken] * @param {string} [scope] * @param {string} [username] * @param {string} [clientId] * @param {string} [clientSecret] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async generateToken(code?: string, grantType?: 'authozation_code' | 'password' | 'client_credentials' | 'refresh_token', password?: string, redirectUri?: string, refreshToken?: string, scope?: string, username?: string, clientId?: string, clientSecret?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.generateToken(code, grantType, password, redirectUri, refreshToken, scope, username, clientId, clientSecret, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches a list of campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCampaignList(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getCampaignList(page, limit, campaignStatus, offerStatus, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches a detail data of a specified offer. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOfferDetail(offerCode: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOfferDetail(offerCode, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation requests to fetch encrypted scope values shared by users with an OIDC client. The OIDC client needs to use an ephemeral private key generated in the OIDC flow to decrypt the values. The response body will contain encrypted custom claim values as well as the standard claims. * @summary Encrypted scope values shared by users * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUserInfo(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserInfo(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation updates onboarding status of an offer approval. This needs `oidc_client:write_transactions` scope. `code` and `description` are needed only when the status will be `FAILED`. * @summary Updates a status of offer redemption * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateOnboardingStatus(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOnboardingStatus(id, offerTransactionStatusUpdateRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * OIDCClientApi - factory interface * @export */ export const OIDCClientApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = OIDCClientApiFp(configuration) return { /** * This manages token usage of OIDC. * @summary OIDC token endpoint * @param {string} [code] * @param {'authozation_code' | 'password' | 'client_credentials' | 'refresh_token'} [grantType] * @param {string} [password] * @param {string} [redirectUri] * @param {string} [refreshToken] * @param {string} [scope] * @param {string} [username] * @param {string} [clientId] * @param {string} [clientSecret] * @param {*} [options] Override http request option. * @throws {RequiredError} */ generateToken(code?: string, grantType?: 'authozation_code' | 'password' | 'client_credentials' | 'refresh_token', password?: string, redirectUri?: string, refreshToken?: string, scope?: string, username?: string, clientId?: string, clientSecret?: string, options?: any): AxiosPromise { return localVarFp.generateToken(code, grantType, password, redirectUri, refreshToken, scope, username, clientId, clientSecret, options).then((request) => request(axios, basePath)); }, /** * This fetches a list of campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCampaignList(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options?: any): AxiosPromise { return localVarFp.getCampaignList(page, limit, campaignStatus, offerStatus, options).then((request) => request(axios, basePath)); }, /** * This fetches a detail data of a specified offer. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferDetail(offerCode: string, options?: any): AxiosPromise { return localVarFp.getOfferDetail(offerCode, options).then((request) => request(axios, basePath)); }, /** * This operation requests to fetch encrypted scope values shared by users with an OIDC client. The OIDC client needs to use an ephemeral private key generated in the OIDC flow to decrypt the values. The response body will contain encrypted custom claim values as well as the standard claims. * @summary Encrypted scope values shared by users * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserInfo(options?: any): AxiosPromise { return localVarFp.getUserInfo(options).then((request) => request(axios, basePath)); }, /** * This operation updates onboarding status of an offer approval. This needs `oidc_client:write_transactions` scope. `code` and `description` are needed only when the status will be `FAILED`. * @summary Updates a status of offer redemption * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOnboardingStatus(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: any): AxiosPromise { return localVarFp.updateOnboardingStatus(id, offerTransactionStatusUpdateRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * OIDCClientApi - interface * @export * @interface OIDCClientApi */ export interface OIDCClientApiInterface { /** * This manages token usage of OIDC. * @summary OIDC token endpoint * @param {string} [code] * @param {'authozation_code' | 'password' | 'client_credentials' | 'refresh_token'} [grantType] * @param {string} [password] * @param {string} [redirectUri] * @param {string} [refreshToken] * @param {string} [scope] * @param {string} [username] * @param {string} [clientId] * @param {string} [clientSecret] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApiInterface */ generateToken(code?: string, grantType?: 'authozation_code' | 'password' | 'client_credentials' | 'refresh_token', password?: string, redirectUri?: string, refreshToken?: string, scope?: string, username?: string, clientId?: string, clientSecret?: string, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches a list of campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApiInterface */ getCampaignList(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches a detail data of a specified offer. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApiInterface */ getOfferDetail(offerCode: string, options?: AxiosRequestConfig): AxiosPromise; /** * This operation requests to fetch encrypted scope values shared by users with an OIDC client. The OIDC client needs to use an ephemeral private key generated in the OIDC flow to decrypt the values. The response body will contain encrypted custom claim values as well as the standard claims. * @summary Encrypted scope values shared by users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApiInterface */ getUserInfo(options?: AxiosRequestConfig): AxiosPromise; /** * This operation updates onboarding status of an offer approval. This needs `oidc_client:write_transactions` scope. `code` and `description` are needed only when the status will be `FAILED`. * @summary Updates a status of offer redemption * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApiInterface */ updateOnboardingStatus(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig): AxiosPromise; } /** * OIDCClientApi - object-oriented interface * @export * @class OIDCClientApi * @extends {BaseAPI} */ export class OIDCClientApi extends BaseAPI implements OIDCClientApiInterface { /** * This manages token usage of OIDC. * @summary OIDC token endpoint * @param {string} [code] * @param {'authozation_code' | 'password' | 'client_credentials' | 'refresh_token'} [grantType] * @param {string} [password] * @param {string} [redirectUri] * @param {string} [refreshToken] * @param {string} [scope] * @param {string} [username] * @param {string} [clientId] * @param {string} [clientSecret] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApi */ public generateToken(code?: string, grantType?: 'authozation_code' | 'password' | 'client_credentials' | 'refresh_token', password?: string, redirectUri?: string, refreshToken?: string, scope?: string, username?: string, clientId?: string, clientSecret?: string, options?: AxiosRequestConfig) { return OIDCClientApiFp(this.configuration).generateToken(code, grantType, password, redirectUri, refreshToken, scope, username, clientId, clientSecret, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches a list of campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApi */ public getCampaignList(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options?: AxiosRequestConfig) { return OIDCClientApiFp(this.configuration).getCampaignList(page, limit, campaignStatus, offerStatus, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches a detail data of a specified offer. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApi */ public getOfferDetail(offerCode: string, options?: AxiosRequestConfig) { return OIDCClientApiFp(this.configuration).getOfferDetail(offerCode, options).then((request) => request(this.axios, this.basePath)); } /** * This operation requests to fetch encrypted scope values shared by users with an OIDC client. The OIDC client needs to use an ephemeral private key generated in the OIDC flow to decrypt the values. The response body will contain encrypted custom claim values as well as the standard claims. * @summary Encrypted scope values shared by users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApi */ public getUserInfo(options?: AxiosRequestConfig) { return OIDCClientApiFp(this.configuration).getUserInfo(options).then((request) => request(this.axios, this.basePath)); } /** * This operation updates onboarding status of an offer approval. This needs `oidc_client:write_transactions` scope. `code` and `description` are needed only when the status will be `FAILED`. * @summary Updates a status of offer redemption * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OIDCClientApi */ public updateOnboardingStatus(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig) { return OIDCClientApiFp(this.configuration).updateOnboardingStatus(id, offerTransactionStatusUpdateRequest, options).then((request) => request(this.axios, this.basePath)); } }