/* 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 { AttachClaimTokens } from '../model'; // @ts-ignore import { CommonResponse } from '../model'; // @ts-ignore import { EvaluatedOffersListResponse } from '../model'; // @ts-ignore import { GetOffersRequest } from '../model'; /** * ClaimProviderApi - axios parameter creator * @export */ export const ClaimProviderApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offer List * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferListForClaimProvider: async (getOffersRequest: GetOffersRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'getOffersRequest' is not null or undefined assertParamExists('getOfferListForClaimProvider', 'getOffersRequest', getOffersRequest) const localVarPath = `/v1/claim-providers/offers`; // 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 kicks off an OIDC session or referral. This receives Organization ID and Individual ID, and pass the request to each service provider. If the offer is `no_oidc = true`, this operation will redirect the request to a preset oidc_setup_url with `referral_id`. * @summary Starts OIDC / referral * @param {string} [entityId] * @param {string} [credifyId] * @param {string} [organizationId] * @param {string} [phoneNumber] * @param {string} [countryCode] * @param {string} [offerCode] * @param {string} [packageCode] * @param {string} [clientId] * @param {string} [localId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ initOidcSession: async (entityId?: string, credifyId?: string, organizationId?: string, phoneNumber?: string, countryCode?: string, offerCode?: string, packageCode?: string, clientId?: string, localId?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/oidc`; // 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 (entityId !== undefined) { localVarQueryParameter['entity_id'] = entityId; } if (credifyId !== undefined) { localVarQueryParameter['credify_id'] = credifyId; } if (organizationId !== undefined) { localVarQueryParameter['organization_id'] = organizationId; } if (phoneNumber !== undefined) { localVarQueryParameter['phone_number'] = phoneNumber; } if (countryCode !== undefined) { localVarQueryParameter['country_code'] = countryCode; } if (offerCode !== undefined) { localVarQueryParameter['offer_code'] = offerCode; } if (packageCode !== undefined) { localVarQueryParameter['package_code'] = packageCode; } if (clientId !== undefined) { localVarQueryParameter['client_id'] = clientId; } if (localId !== undefined) { localVarQueryParameter['local_id'] = localId; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; 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 * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAttachedClaim: async (id: string, attachClaimTokens: AttachClaimTokens, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('updateAttachedClaim', 'id', id) // verify required parameter 'attachClaimTokens' is not null or undefined assertParamExists('updateAttachedClaim', 'attachClaimTokens', attachClaimTokens) const localVarPath = `/claim-providers/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, }; }, } }; /** * ClaimProviderApi - functional programming interface * @export */ export const ClaimProviderApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ClaimProviderApiAxiosParamCreator(configuration) return { /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offer List * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOfferListForClaimProvider(getOffersRequest: GetOffersRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOfferListForClaimProvider(getOffersRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This kicks off an OIDC session or referral. This receives Organization ID and Individual ID, and pass the request to each service provider. If the offer is `no_oidc = true`, this operation will redirect the request to a preset oidc_setup_url with `referral_id`. * @summary Starts OIDC / referral * @param {string} [entityId] * @param {string} [credifyId] * @param {string} [organizationId] * @param {string} [phoneNumber] * @param {string} [countryCode] * @param {string} [offerCode] * @param {string} [packageCode] * @param {string} [clientId] * @param {string} [localId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async initOidcSession(entityId?: string, credifyId?: string, organizationId?: string, phoneNumber?: string, countryCode?: string, offerCode?: string, packageCode?: string, clientId?: string, localId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.initOidcSession(entityId, credifyId, organizationId, phoneNumber, countryCode, offerCode, packageCode, clientId, localId, 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 * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateAttachedClaim(id: string, attachClaimTokens: AttachClaimTokens, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateAttachedClaim(id, attachClaimTokens, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * ClaimProviderApi - factory interface * @export */ export const ClaimProviderApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ClaimProviderApiFp(configuration) return { /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offer List * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferListForClaimProvider(getOffersRequest: GetOffersRequest, options?: any): AxiosPromise { return localVarFp.getOfferListForClaimProvider(getOffersRequest, options).then((request) => request(axios, basePath)); }, /** * This kicks off an OIDC session or referral. This receives Organization ID and Individual ID, and pass the request to each service provider. If the offer is `no_oidc = true`, this operation will redirect the request to a preset oidc_setup_url with `referral_id`. * @summary Starts OIDC / referral * @param {string} [entityId] * @param {string} [credifyId] * @param {string} [organizationId] * @param {string} [phoneNumber] * @param {string} [countryCode] * @param {string} [offerCode] * @param {string} [packageCode] * @param {string} [clientId] * @param {string} [localId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ initOidcSession(entityId?: string, credifyId?: string, organizationId?: string, phoneNumber?: string, countryCode?: string, offerCode?: string, packageCode?: string, clientId?: string, localId?: string, options?: any): AxiosPromise { return localVarFp.initOidcSession(entityId, credifyId, organizationId, phoneNumber, countryCode, offerCode, packageCode, clientId, localId, 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 * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAttachedClaim(id: string, attachClaimTokens: AttachClaimTokens, options?: any): AxiosPromise { return localVarFp.updateAttachedClaim(id, attachClaimTokens, options).then((request) => request(axios, basePath)); }, }; }; /** * ClaimProviderApi - interface * @export * @interface ClaimProviderApi */ export interface ClaimProviderApiInterface { /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offer List * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ClaimProviderApiInterface */ getOfferListForClaimProvider(getOffersRequest: GetOffersRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This kicks off an OIDC session or referral. This receives Organization ID and Individual ID, and pass the request to each service provider. If the offer is `no_oidc = true`, this operation will redirect the request to a preset oidc_setup_url with `referral_id`. * @summary Starts OIDC / referral * @param {string} [entityId] * @param {string} [credifyId] * @param {string} [organizationId] * @param {string} [phoneNumber] * @param {string} [countryCode] * @param {string} [offerCode] * @param {string} [packageCode] * @param {string} [clientId] * @param {string} [localId] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ClaimProviderApiInterface */ initOidcSession(entityId?: string, credifyId?: string, organizationId?: string, phoneNumber?: string, countryCode?: string, offerCode?: string, packageCode?: string, clientId?: string, localId?: string, 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 * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ClaimProviderApiInterface */ updateAttachedClaim(id: string, attachClaimTokens: AttachClaimTokens, options?: AxiosRequestConfig): AxiosPromise; } /** * ClaimProviderApi - object-oriented interface * @export * @class ClaimProviderApi * @extends {BaseAPI} */ export class ClaimProviderApi extends BaseAPI implements ClaimProviderApiInterface { /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offer List * @param {GetOffersRequest} getOffersRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ClaimProviderApi */ public getOfferListForClaimProvider(getOffersRequest: GetOffersRequest, options?: AxiosRequestConfig) { return ClaimProviderApiFp(this.configuration).getOfferListForClaimProvider(getOffersRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This kicks off an OIDC session or referral. This receives Organization ID and Individual ID, and pass the request to each service provider. If the offer is `no_oidc = true`, this operation will redirect the request to a preset oidc_setup_url with `referral_id`. * @summary Starts OIDC / referral * @param {string} [entityId] * @param {string} [credifyId] * @param {string} [organizationId] * @param {string} [phoneNumber] * @param {string} [countryCode] * @param {string} [offerCode] * @param {string} [packageCode] * @param {string} [clientId] * @param {string} [localId] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ClaimProviderApi */ public initOidcSession(entityId?: string, credifyId?: string, organizationId?: string, phoneNumber?: string, countryCode?: string, offerCode?: string, packageCode?: string, clientId?: string, localId?: string, options?: AxiosRequestConfig) { return ClaimProviderApiFp(this.configuration).initOidcSession(entityId, credifyId, organizationId, phoneNumber, countryCode, offerCode, packageCode, clientId, localId, 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 * @param {AttachClaimTokens} attachClaimTokens * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ClaimProviderApi */ public updateAttachedClaim(id: string, attachClaimTokens: AttachClaimTokens, options?: AxiosRequestConfig) { return ClaimProviderApiFp(this.configuration).updateAttachedClaim(id, attachClaimTokens, options).then((request) => request(this.axios, this.basePath)); } }