/* tslint:disable */ /* eslint-disable */ /** * Credify external API doc v2 * API documentations for integration version 2. * * 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 { APIErrorV2 } from '../model'; // @ts-ignore import { AttachClaimTokens } from '../model'; // @ts-ignore import { EvaluatedOffersList } from '../model'; // @ts-ignore import { GetOffersRequest } from '../model'; // @ts-ignore import { LodgingRequest } from '../model'; // @ts-ignore import { LodgingResult } from '../model'; // @ts-ignore import { QueryProducts200Response } from '../model'; // @ts-ignore import { QueryProductsRequest } from '../model'; // @ts-ignore import { SimulateProductConfiguration200Response } from '../model'; // @ts-ignore import { SimulationRequest } from '../model'; /** * MarketplaceApi - axios parameter creator * @export */ export const MarketplaceApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This lodges a new intent. * @summary Lodge new intent * @param {LodgingRequest} lodgingRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ lodgeNewIntent: async (lodgingRequest: LodgingRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'lodgingRequest' is not null or undefined assertParamExists('lodgeNewIntent', 'lodgingRequest', lodgingRequest) const localVarPath = `/v2/integration/marketplace/intents`; // 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) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = lodgingRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches products and filters them in both service provider and marketplace context. * @summary Query products * @param {QueryProductsRequest} queryProductsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ queryProducts: async (queryProductsRequest: QueryProductsRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'queryProductsRequest' is not null or undefined assertParamExists('queryProducts', 'queryProductsRequest', queryProductsRequest) const localVarPath = `/v2/integration/marketplace/products/query`; // 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) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = queryProductsRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Query offers * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestEvaluatedOfferList: async (getOffersRequest: GetOffersRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'getOffersRequest' is not null or undefined assertParamExists('requestEvaluatedOfferList', 'getOffersRequest', getOffersRequest) const localVarPath = `/v2/integration/marketplace/offers/query`; // 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) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = getOffersRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This simulates product configurations of requested service providers for the provided product type. * @summary Product simulation * @param {string} productType * @param {SimulationRequest} [simulationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ simulateProductConfiguration: async (productType: string, simulationRequest?: SimulationRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'productType' is not null or undefined assertParamExists('simulateProductConfiguration', 'productType', productType) const localVarPath = `/v2/integration/marketplace/products/{product_type}/simulation` .replace(`{${"product_type"}}`, encodeURIComponent(String(productType))); // 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) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = simulationRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This updates a reference of user\'s claim values in certain scopes. Currently this is supposed to be called by claim providers, therefore it needs API_KEY (tentative). The custom claim values will be stored by claim providers, not Credify, so this API will receive only hashed claim values with a corresponding signature with the claim provider\'s signing key. In order to have a decent entropy, each scope will use commitments generated on the claim provider\'s system. * @summary Update claim values * @param {string} id Individual Entity ID (Credify ID) * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateClaimValues: async (id: string, attachClaimTokens: AttachClaimTokens, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('updateClaimValues', 'id', id) // verify required parameter 'attachClaimTokens' is not null or undefined assertParamExists('updateClaimValues', 'attachClaimTokens', attachClaimTokens) const localVarPath = `/v2/integration/marketplace/entities/{id}/claims` .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 = attachClaimTokens return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * MarketplaceApi - functional programming interface * @export */ export const MarketplaceApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = MarketplaceApiAxiosParamCreator(configuration) return { /** * This lodges a new intent. * @summary Lodge new intent * @param {LodgingRequest} lodgingRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async lodgeNewIntent(lodgingRequest: LodgingRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.lodgeNewIntent(lodgingRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches products and filters them in both service provider and marketplace context. * @summary Query products * @param {QueryProductsRequest} queryProductsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async queryProducts(queryProductsRequest: QueryProductsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.queryProducts(queryProductsRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Query offers * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async requestEvaluatedOfferList(getOffersRequest: GetOffersRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.requestEvaluatedOfferList(getOffersRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This simulates product configurations of requested service providers for the provided product type. * @summary Product simulation * @param {string} productType * @param {SimulationRequest} [simulationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async simulateProductConfiguration(productType: string, simulationRequest?: SimulationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.simulateProductConfiguration(productType, simulationRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This updates a reference of user\'s claim values in certain scopes. Currently this is supposed to be called by claim providers, therefore it needs API_KEY (tentative). The custom claim values will be stored by claim providers, not Credify, so this API will receive only hashed claim values with a corresponding signature with the claim provider\'s signing key. In order to have a decent entropy, each scope will use commitments generated on the claim provider\'s system. * @summary Update claim values * @param {string} id Individual Entity ID (Credify ID) * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateClaimValues(id: string, attachClaimTokens: AttachClaimTokens, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateClaimValues(id, attachClaimTokens, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * MarketplaceApi - factory interface * @export */ export const MarketplaceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = MarketplaceApiFp(configuration) return { /** * This lodges a new intent. * @summary Lodge new intent * @param {LodgingRequest} lodgingRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ lodgeNewIntent(lodgingRequest: LodgingRequest, options?: any): AxiosPromise { return localVarFp.lodgeNewIntent(lodgingRequest, options).then((request) => request(axios, basePath)); }, /** * This fetches products and filters them in both service provider and marketplace context. * @summary Query products * @param {QueryProductsRequest} queryProductsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ queryProducts(queryProductsRequest: QueryProductsRequest, options?: any): AxiosPromise { return localVarFp.queryProducts(queryProductsRequest, options).then((request) => request(axios, basePath)); }, /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Query offers * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestEvaluatedOfferList(getOffersRequest: GetOffersRequest, options?: any): AxiosPromise { return localVarFp.requestEvaluatedOfferList(getOffersRequest, options).then((request) => request(axios, basePath)); }, /** * This simulates product configurations of requested service providers for the provided product type. * @summary Product simulation * @param {string} productType * @param {SimulationRequest} [simulationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ simulateProductConfiguration(productType: string, simulationRequest?: SimulationRequest, options?: any): AxiosPromise { return localVarFp.simulateProductConfiguration(productType, simulationRequest, options).then((request) => request(axios, basePath)); }, /** * This updates a reference of user\'s claim values in certain scopes. Currently this is supposed to be called by claim providers, therefore it needs API_KEY (tentative). The custom claim values will be stored by claim providers, not Credify, so this API will receive only hashed claim values with a corresponding signature with the claim provider\'s signing key. In order to have a decent entropy, each scope will use commitments generated on the claim provider\'s system. * @summary Update claim values * @param {string} id Individual Entity ID (Credify ID) * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateClaimValues(id: string, attachClaimTokens: AttachClaimTokens, options?: any): AxiosPromise { return localVarFp.updateClaimValues(id, attachClaimTokens, options).then((request) => request(axios, basePath)); }, }; }; /** * MarketplaceApi - interface * @export * @interface MarketplaceApi */ export interface MarketplaceApiInterface { /** * This lodges a new intent. * @summary Lodge new intent * @param {LodgingRequest} lodgingRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApiInterface */ lodgeNewIntent(lodgingRequest: LodgingRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches products and filters them in both service provider and marketplace context. * @summary Query products * @param {QueryProductsRequest} queryProductsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApiInterface */ queryProducts(queryProductsRequest: QueryProductsRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Query offers * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApiInterface */ requestEvaluatedOfferList(getOffersRequest: GetOffersRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This simulates product configurations of requested service providers for the provided product type. * @summary Product simulation * @param {string} productType * @param {SimulationRequest} [simulationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApiInterface */ simulateProductConfiguration(productType: string, simulationRequest?: SimulationRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This updates a reference of user\'s claim values in certain scopes. Currently this is supposed to be called by claim providers, therefore it needs API_KEY (tentative). The custom claim values will be stored by claim providers, not Credify, so this API will receive only hashed claim values with a corresponding signature with the claim provider\'s signing key. In order to have a decent entropy, each scope will use commitments generated on the claim provider\'s system. * @summary Update claim values * @param {string} id Individual Entity ID (Credify ID) * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApiInterface */ updateClaimValues(id: string, attachClaimTokens: AttachClaimTokens, options?: AxiosRequestConfig): AxiosPromise; } /** * MarketplaceApi - object-oriented interface * @export * @class MarketplaceApi * @extends {BaseAPI} */ export class MarketplaceApi extends BaseAPI implements MarketplaceApiInterface { /** * This lodges a new intent. * @summary Lodge new intent * @param {LodgingRequest} lodgingRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApi */ public lodgeNewIntent(lodgingRequest: LodgingRequest, options?: AxiosRequestConfig) { return MarketplaceApiFp(this.configuration).lodgeNewIntent(lodgingRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches products and filters them in both service provider and marketplace context. * @summary Query products * @param {QueryProductsRequest} queryProductsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApi */ public queryProducts(queryProductsRequest: QueryProductsRequest, options?: AxiosRequestConfig) { return MarketplaceApiFp(this.configuration).queryProducts(queryProductsRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Query offers * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApi */ public requestEvaluatedOfferList(getOffersRequest: GetOffersRequest, options?: AxiosRequestConfig) { return MarketplaceApiFp(this.configuration).requestEvaluatedOfferList(getOffersRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This simulates product configurations of requested service providers for the provided product type. * @summary Product simulation * @param {string} productType * @param {SimulationRequest} [simulationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApi */ public simulateProductConfiguration(productType: string, simulationRequest?: SimulationRequest, options?: AxiosRequestConfig) { return MarketplaceApiFp(this.configuration).simulateProductConfiguration(productType, simulationRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This updates a reference of user\'s claim values in certain scopes. Currently this is supposed to be called by claim providers, therefore it needs API_KEY (tentative). The custom claim values will be stored by claim providers, not Credify, so this API will receive only hashed claim values with a corresponding signature with the claim provider\'s signing key. In order to have a decent entropy, each scope will use commitments generated on the claim provider\'s system. * @summary Update claim values * @param {string} id Individual Entity ID (Credify ID) * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MarketplaceApi */ public updateClaimValues(id: string, attachClaimTokens: AttachClaimTokens, options?: AxiosRequestConfig) { return MarketplaceApiFp(this.configuration).updateClaimValues(id, attachClaimTokens, options).then((request) => request(this.axios, this.basePath)); } }