/* 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 { Link } from './Link';
import {
    LinkFromJSON,
    LinkFromJSONTyped,
    LinkToJSON,
    LinkToJSONTyped,
} from './Link';
import type { SipTrunkResponseWithPasswordAllOfFailOverDestination } from './SipTrunkResponseWithPasswordAllOfFailOverDestination';
import {
    SipTrunkResponseWithPasswordAllOfFailOverDestinationFromJSON,
    SipTrunkResponseWithPasswordAllOfFailOverDestinationFromJSONTyped,
    SipTrunkResponseWithPasswordAllOfFailOverDestinationToJSON,
    SipTrunkResponseWithPasswordAllOfFailOverDestinationToJSONTyped,
} from './SipTrunkResponseWithPasswordAllOfFailOverDestination';

/**
 * SIP Trunk details including the newly regenerated SIP password.
 * @export
 * @interface SipTrunkResponseWithPassword
 */
export interface SipTrunkResponseWithPassword {
    /**
     * A user-friendly name for the SIP Trunk.
     * @type {string}
     * @memberof SipTrunkResponseWithPassword
     */
    name: string;
    /**
     * 
     * @type {string}
     * @memberof SipTrunkResponseWithPassword
     */
    login: string;
    /**
     * The newly generated SIP password for the trunk.
     * @type {string}
     * @memberof SipTrunkResponseWithPassword
     */
    password: string;
    /**
     * Indicates if the SIP Trunk is active.
     * @type {boolean}
     * @memberof SipTrunkResponseWithPassword
     */
    active?: boolean;
    /**
     * Maximum number of concurrent call channels allowed for this trunk.
     * @type {number}
     * @memberof SipTrunkResponseWithPassword
     */
    channelLimit?: number;
    /**
     * Optional. IP address and port (e.g., 63.211.239.14:5060) to send inbound calls to, bypassing registration.
     * @type {string}
     * @memberof SipTrunkResponseWithPassword
     */
    contactIp?: string | null;
    /**
     * Access Control List (IP address or range) restricting where this trunk can connect from/to.
     * @type {string}
     * @memberof SipTrunkResponseWithPassword
     */
    acl?: string | null;
    /**
     * Default Caller ID name for outbound calls from this trunk.
     * @type {string}
     * @memberof SipTrunkResponseWithPassword
     */
    callerIdName?: string | null;
    /**
     * Default Caller ID number for outbound calls from this trunk.
     * @type {string}
     * @memberof SipTrunkResponseWithPassword
     */
    callerIdNumber?: string | null;
    /**
     * Disable RFC3389 Comfort Noise if hardware does not support it.
     * @type {boolean}
     * @memberof SipTrunkResponseWithPassword
     */
    disableComfortNoise?: boolean;
    /**
     * Timeout in seconds for call attempts or registration.
     * @type {number}
     * @memberof SipTrunkResponseWithPassword
     */
    timeout?: number;
    /**
     * System code for the failover destination if the trunk is unavailable.
     * @type {string}
     * @memberof SipTrunkResponseWithPassword
     */
    failOverDestinationCode?: string | null;
    /**
     * Optional. Identifier of a user primarily associated with this SIP trunk.
     * @type {number}
     * @memberof SipTrunkResponseWithPassword
     */
    userId?: number | null;
    /**
     * 
     * @type {number}
     * @memberof SipTrunkResponseWithPassword
     */
    id: number;
    /**
     * 
     * @type {number}
     * @memberof SipTrunkResponseWithPassword
     */
    siteId: number;
    /**
     * 
     * @type {SipTrunkResponseWithPasswordAllOfFailOverDestination}
     * @memberof SipTrunkResponseWithPassword
     */
    failOverDestination?: SipTrunkResponseWithPasswordAllOfFailOverDestination;
    /**
     * 
     * @type {Array<Link>}
     * @memberof SipTrunkResponseWithPassword
     */
    links?: Array<Link> | null;
}

/**
 * Check if a given object implements the SipTrunkResponseWithPassword interface.
 */
export function instanceOfSipTrunkResponseWithPassword(value: object): value is SipTrunkResponseWithPassword {
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('login' in value) || value['login'] === undefined) return false;
    if (!('password' in value) || value['password'] === undefined) return false;
    if (!('id' in value) || value['id'] === undefined) return false;
    if (!('siteId' in value) || value['siteId'] === undefined) return false;
    return true;
}

export function SipTrunkResponseWithPasswordFromJSON(json: any): SipTrunkResponseWithPassword {
    return SipTrunkResponseWithPasswordFromJSONTyped(json, false);
}

export function SipTrunkResponseWithPasswordFromJSONTyped(json: any, ignoreDiscriminator: boolean): SipTrunkResponseWithPassword {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'login': json['login'],
        'password': json['password'],
        'active': json['active'] == null ? undefined : json['active'],
        'channelLimit': json['channel_limit'] == null ? undefined : json['channel_limit'],
        'contactIp': json['contact_ip'] == null ? undefined : json['contact_ip'],
        'acl': json['acl'] == null ? undefined : json['acl'],
        'callerIdName': json['caller_id_name'] == null ? undefined : json['caller_id_name'],
        'callerIdNumber': json['caller_id_number'] == null ? undefined : json['caller_id_number'],
        'disableComfortNoise': json['disable_comfort_noise'] == null ? undefined : json['disable_comfort_noise'],
        'timeout': json['timeout'] == null ? undefined : json['timeout'],
        'failOverDestinationCode': json['fail_over_destination_code'] == null ? undefined : json['fail_over_destination_code'],
        'userId': json['user_id'] == null ? undefined : json['user_id'],
        'id': json['id'],
        'siteId': json['site_id'],
        'failOverDestination': json['fail_over_destination'] == null ? undefined : SipTrunkResponseWithPasswordAllOfFailOverDestinationFromJSON(json['fail_over_destination']),
        'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(LinkFromJSON)),
    };
}

export function SipTrunkResponseWithPasswordToJSON(json: any): SipTrunkResponseWithPassword {
    return SipTrunkResponseWithPasswordToJSONTyped(json, false);
}

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

    return {
        
        'name': value['name'],
        'login': value['login'],
        'password': value['password'],
        'active': value['active'],
        'channel_limit': value['channelLimit'],
        'contact_ip': value['contactIp'],
        'acl': value['acl'],
        'caller_id_name': value['callerIdName'],
        'caller_id_number': value['callerIdNumber'],
        'disable_comfort_noise': value['disableComfortNoise'],
        'timeout': value['timeout'],
        'fail_over_destination_code': value['failOverDestinationCode'],
        'user_id': value['userId'],
        'id': value['id'],
        'site_id': value['siteId'],
        'fail_over_destination': SipTrunkResponseWithPasswordAllOfFailOverDestinationToJSON(value['failOverDestination']),
        'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(LinkToJSON)),
    };
}

