/* 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 {
  CustomerRegistrationRequest,
  CustomerRegistrationResponse,
  SignUpComponentsSchemasError,
} from '../models/index';
import {
    CustomerRegistrationRequestFromJSON,
    CustomerRegistrationRequestToJSON,
    CustomerRegistrationResponseFromJSON,
    CustomerRegistrationResponseToJSON,
    SignUpComponentsSchemasErrorFromJSON,
    SignUpComponentsSchemasErrorToJSON,
} from '../models/index';

export interface SignUpCustomerRequest {
    customerRegistrationRequest: CustomerRegistrationRequest;
}

/**
 * 
 */
export class SignUpApi extends runtime.BaseAPI {

    /**
     * Allows a new customer to register for the Ringer Business service by providing their company name and detailed contact information. Upon successful registration, the system creates an account and returns the account details along with a `confirmation_token`. This token is essential for the account confirmation process. 
     * Register a new Customer Account
     */
    async signUpCustomerRaw(requestParameters: SignUpCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomerRegistrationResponse>> {
        if (requestParameters['customerRegistrationRequest'] == null) {
            throw new runtime.RequiredError(
                'customerRegistrationRequest',
                'Required parameter "customerRegistrationRequest" was null or undefined when calling signUpCustomer().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        const response = await this.request({
            path: `/sign-up`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CustomerRegistrationRequestToJSON(requestParameters['customerRegistrationRequest']),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => CustomerRegistrationResponseFromJSON(jsonValue));
    }

    /**
     * Allows a new customer to register for the Ringer Business service by providing their company name and detailed contact information. Upon successful registration, the system creates an account and returns the account details along with a `confirmation_token`. This token is essential for the account confirmation process. 
     * Register a new Customer Account
     */
    async signUpCustomer(requestParameters: SignUpCustomerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomerRegistrationResponse> {
        const response = await this.signUpCustomerRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
