/** * OAuth service. * @module api/OAuthApi */ export default class OAuthApi { /** * Constructs a new OAuthApi. * @alias OAuthApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient?: any); apiClient: any; /** * Callback function to receive the result of the generateOauthToken operation. * @callback generateOauthTokenCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {OAuthTokenGenerateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Generate OAuth 2.0 Token * Generate an OAuth 2.0 token for an API client. The token can be used to authorize access to the Voucherify API. The token inherits the permissions and IP whitelists of the API key that is used to generate the OAuth token. You can define the scope that limits its usage. You can generate up to 1000 OAuth tokens per project. The token expires in 900 seconds (15 minutes). If the API key that is used to generate the OAuth token is deleted or blocked, you cannot generate new OAuth tokens and the existing ones will stop working within one minute. If the API key used to generate an OAuth token is regenerated, the OAuth token can still be used. Format of scope values Separate the values of the scope property with spaces. * @param {{ grantType?: String, scope?: String, }} [opts] Optional parameters * @param {generateOauthTokenCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link OAuthTokenGenerateResponseBody} * @returns {Promise<(OAuthTokenGenerateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `OAuthTokenGenerateResponseBody` object or with `undefined`. */ generateOauthToken(opts?: { grantType?: string; scope?: string; }, callback?: (error: Error | null, data?: OAuthTokenGenerateResponseBody, response?: any) => any): Promise<(OAuthTokenGenerateResponseBody | undefined)>; /** * Callback function to receive the result of the introspectOauthToken operation. * @callback introspectOauthTokenCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {OAuthTokenIntrospectResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Introspect OAuth 2.0 Token * Introspect an OAuth 2.0 token for an API client. * @param {{ accessToken?: String, }} [opts] Optional parameters * @param {introspectOauthTokenCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link OAuthTokenIntrospectResponseBody} * @returns {Promise<(OAuthTokenIntrospectResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `OAuthTokenIntrospectResponseBody` object or with `undefined`. */ introspectOauthToken(opts?: { accessToken?: string; }, callback?: (error: Error | null, data?: OAuthTokenIntrospectResponseBody, response?: any) => any): Promise<(OAuthTokenIntrospectResponseBody | undefined)>; /** * Callback function to receive the result of the revokeOauthToken operation. * @callback revokeOauthTokenCallback * @param {Error|null} error Error object if failed, null otherwise. * @param data This operation does not return a value. * @param {Object} [response] Full response object if successful. */ /** * Revoke OAuth 2.0 Token * Revoke an OAuth 2.0 token for an API client. Once revoked, the token cannot be used anymore. * @param {{ accessToken?: String, }} [opts] Optional parameters * @param {revokeOauthTokenCallback} [callback] The callback function, accepting three arguments: error, data, response * @returns {Promise<( | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `` object or with `undefined`. */ revokeOauthToken(opts?: { accessToken?: string; }, callback?: (error: Error | null, data: any, response?: any) => any): Promise<(undefined)>; } import OAuthTokenGenerateResponseBody from '../model/OAuthTokenGenerateResponseBody'; import OAuthTokenIntrospectResponseBody from '../model/OAuthTokenIntrospectResponseBody';