@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
79 lines (66 loc) • 3.12 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Ringer Business API
* This API provides comprehensive endpoints for the Ringer Business system. It includes functionality for managing customer accounts, addresses, sites, phone numbers, payments, users, and other business resources. Operations typically require authentication and appropriate permissions.
*
* The version of the OpenAPI document: 1.0.6
* Contact: support@ringer.tel
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
ConfirmationComponentsSchemasError,
ConfirmationRequest,
ConfirmationResponse,
} from '../models/index';
import {
ConfirmationComponentsSchemasErrorFromJSON,
ConfirmationComponentsSchemasErrorToJSON,
ConfirmationRequestFromJSON,
ConfirmationRequestToJSON,
ConfirmationResponseFromJSON,
ConfirmationResponseToJSON,
} from '../models/index';
export interface ConfirmAccountRequest {
confirmationRequest: ConfirmationRequest;
}
/**
*
*/
export class ConfirmationApi extends runtime.BaseAPI {
/**
* Confirms a user account using a confirmation token obtained during sign-up. If a valid token is provided, the account becomes active and operational. This token is typically obtained via an email link sent to the user after they sign up.
* Confirm a User Account
*/
async confirmAccountRaw(requestParameters: ConfirmAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConfirmationResponse>> {
if (requestParameters['confirmationRequest'] == null) {
throw new runtime.RequiredError(
'confirmationRequest',
'Required parameter "confirmationRequest" was null or undefined when calling confirmAccount().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/confirmation`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ConfirmationRequestToJSON(requestParameters['confirmationRequest']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ConfirmationResponseFromJSON(jsonValue));
}
/**
* Confirms a user account using a confirmation token obtained during sign-up. If a valid token is provided, the account becomes active and operational. This token is typically obtained via an email link sent to the user after they sign up.
* Confirm a User Account
*/
async confirmAccount(requestParameters: ConfirmAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConfirmationResponse> {
const response = await this.confirmAccountRaw(requestParameters, initOverrides);
return await response.value();
}
}