/* 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.5
 * 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 { mapValues } from '../runtime';
import type { SignUpComponentsSchemasLink } from './SignUpComponentsSchemasLink';
import {
    SignUpComponentsSchemasLinkFromJSON,
    SignUpComponentsSchemasLinkFromJSONTyped,
    SignUpComponentsSchemasLinkToJSON,
    SignUpComponentsSchemasLinkToJSONTyped,
} from './SignUpComponentsSchemasLink';
import type { AddressRegistered } from './AddressRegistered';
import {
    AddressRegisteredFromJSON,
    AddressRegisteredFromJSONTyped,
    AddressRegisteredToJSON,
    AddressRegisteredToJSONTyped,
} from './AddressRegistered';

/**
 * Details of the newly created customer account, including a confirmation token.
 * @export
 * @interface CustomerRegistrationResponse
 */
export interface CustomerRegistrationResponse {
    /**
     * Unique identifier for the newly created account.
     * @type {number}
     * @memberof CustomerRegistrationResponse
     */
    id: number;
    /**
     * The name of the registered company.
     * @type {string}
     * @memberof CustomerRegistrationResponse
     */
    name: string;
    /**
     * Indicates if the account is active. Typically false until confirmed.
     * @type {boolean}
     * @memberof CustomerRegistrationResponse
     */
    active: boolean;
    /**
     * The locale preference for the account (e.g., "en" for English).
     * @type {string}
     * @memberof CustomerRegistrationResponse
     */
    locale?: string;
    /**
     * Indicates if international services are enabled for this account.
     * @type {boolean}
     * @memberof CustomerRegistrationResponse
     */
    internationalEnabled?: boolean;
    /**
     * Preferred account balance threshold (in dollars).
     * @type {string}
     * @memberof CustomerRegistrationResponse
     */
    balancePreferenceInDollars?: string;
    /**
     * Preferred auto-recharge amount (in dollars).
     * @type {string}
     * @memberof CustomerRegistrationResponse
     */
    rechargePreferenceInDollars?: string;
    /**
     * 
     * @type {AddressRegistered}
     * @memberof CustomerRegistrationResponse
     */
    address: AddressRegistered;
    /**
     * A unique token required to confirm and activate the account.
     * @type {string}
     * @memberof CustomerRegistrationResponse
     */
    confirmationToken: string;
    /**
     * HATEOAS links related to the new account.
     * @type {Array<SignUpComponentsSchemasLink>}
     * @memberof CustomerRegistrationResponse
     */
    links?: Array<SignUpComponentsSchemasLink>;
}

/**
 * Check if a given object implements the CustomerRegistrationResponse interface.
 */
export function instanceOfCustomerRegistrationResponse(value: object): value is CustomerRegistrationResponse {
    if (!('id' in value) || value['id'] === undefined) return false;
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('active' in value) || value['active'] === undefined) return false;
    if (!('address' in value) || value['address'] === undefined) return false;
    if (!('confirmationToken' in value) || value['confirmationToken'] === undefined) return false;
    return true;
}

export function CustomerRegistrationResponseFromJSON(json: any): CustomerRegistrationResponse {
    return CustomerRegistrationResponseFromJSONTyped(json, false);
}

export function CustomerRegistrationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerRegistrationResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'],
        'name': json['name'],
        'active': json['active'],
        'locale': json['locale'] == null ? undefined : json['locale'],
        'internationalEnabled': json['international_enabled'] == null ? undefined : json['international_enabled'],
        'balancePreferenceInDollars': json['balance_preference_in_dollars'] == null ? undefined : json['balance_preference_in_dollars'],
        'rechargePreferenceInDollars': json['recharge_preference_in_dollars'] == null ? undefined : json['recharge_preference_in_dollars'],
        'address': AddressRegisteredFromJSON(json['address']),
        'confirmationToken': json['confirmation_token'],
        'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SignUpComponentsSchemasLinkFromJSON)),
    };
}

export function CustomerRegistrationResponseToJSON(json: any): CustomerRegistrationResponse {
    return CustomerRegistrationResponseToJSONTyped(json, false);
}

export function CustomerRegistrationResponseToJSONTyped(value?: CustomerRegistrationResponse | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'id': value['id'],
        'name': value['name'],
        'active': value['active'],
        'locale': value['locale'],
        'international_enabled': value['internationalEnabled'],
        'balance_preference_in_dollars': value['balancePreferenceInDollars'],
        'recharge_preference_in_dollars': value['rechargePreferenceInDollars'],
        'address': AddressRegisteredToJSON(value['address']),
        'confirmation_token': value['confirmationToken'],
        'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SignUpComponentsSchemasLinkToJSON)),
    };
}

