UNPKG

@ringer-tel/ivy

Version:
182 lines (170 loc) 6.13 kB
/* 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 { SiteDestination } from './SiteDestination'; import { SiteDestinationFromJSON, SiteDestinationFromJSONTyped, SiteDestinationToJSON, SiteDestinationToJSONTyped, } from './SiteDestination'; import type { Link } from './Link'; import { LinkFromJSON, LinkFromJSONTyped, LinkToJSON, LinkToJSONTyped, } from './Link'; /** * * @export * @interface AvailablePhoneNumber */ export interface AvailablePhoneNumber { /** * A user-friendly name for the phone number (e.g., "Main Line", "Sales Dept"). * @type {string} * @memberof AvailablePhoneNumber */ name: string; /** * The actual phone number in E.164 format (e.g., +13035551212). * @type {string} * @memberof AvailablePhoneNumber */ number: string; /** * System code for the primary destination where calls to this number are routed. * @type {string} * @memberof AvailablePhoneNumber */ destinationCode: string; /** * System code for the failover destination if the primary is unavailable. * @type {string} * @memberof AvailablePhoneNumber */ failOverDestinationCode?: string | null; /** * Identifier of the E911 record associated with this phone number for emergency calling. * @type {number} * @memberof AvailablePhoneNumber */ e911Id?: number | null; /** * Optional. Identifier of a user primarily associated with this phone number. * @type {number} * @memberof AvailablePhoneNumber */ userId?: number | null; /** * * @type {number} * @memberof AvailablePhoneNumber */ id: number; /** * * @type {number} * @memberof AvailablePhoneNumber */ siteId?: number | null; /** * * @type {SiteDestination} * @memberof AvailablePhoneNumber */ destination?: SiteDestination; /** * * @type {SiteDestination} * @memberof AvailablePhoneNumber */ failOverDestination?: SiteDestination; /** * * @type {Array<Link>} * @memberof AvailablePhoneNumber */ links?: Array<Link> | null; /** * Whether the phone number is currently assigned (e.g. to the specified user or any user on the site). * @type {boolean} * @memberof AvailablePhoneNumber */ assigned: boolean; /** * ID of the user this phone number is assigned to, if any. * @type {number} * @memberof AvailablePhoneNumber */ assignedTo?: number | null; } /** * Check if a given object implements the AvailablePhoneNumber interface. */ export function instanceOfAvailablePhoneNumber(value: object): value is AvailablePhoneNumber { if (!('name' in value) || value['name'] === undefined) return false; if (!('number' in value) || value['number'] === undefined) return false; if (!('destinationCode' in value) || value['destinationCode'] === undefined) return false; if (!('id' in value) || value['id'] === undefined) return false; if (!('assigned' in value) || value['assigned'] === undefined) return false; return true; } export function AvailablePhoneNumberFromJSON(json: any): AvailablePhoneNumber { return AvailablePhoneNumberFromJSONTyped(json, false); } export function AvailablePhoneNumberFromJSONTyped(json: any, ignoreDiscriminator: boolean): AvailablePhoneNumber { if (json == null) { return json; } return { 'name': json['name'], 'number': json['number'], 'destinationCode': json['destination_code'], 'failOverDestinationCode': json['fail_over_destination_code'] == null ? undefined : json['fail_over_destination_code'], 'e911Id': json['e911_id'] == null ? undefined : json['e911_id'], 'userId': json['user_id'] == null ? undefined : json['user_id'], 'id': json['id'], 'siteId': json['site_id'] == null ? undefined : json['site_id'], 'destination': json['destination'] == null ? undefined : SiteDestinationFromJSON(json['destination']), 'failOverDestination': json['fail_over_destination'] == null ? undefined : SiteDestinationFromJSON(json['fail_over_destination']), 'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(LinkFromJSON)), 'assigned': json['assigned'], 'assignedTo': json['assigned_to'] == null ? undefined : json['assigned_to'], }; } export function AvailablePhoneNumberToJSON(json: any): AvailablePhoneNumber { return AvailablePhoneNumberToJSONTyped(json, false); } export function AvailablePhoneNumberToJSONTyped(value?: AvailablePhoneNumber | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'name': value['name'], 'number': value['number'], 'destination_code': value['destinationCode'], 'fail_over_destination_code': value['failOverDestinationCode'], 'e911_id': value['e911Id'], 'user_id': value['userId'], 'id': value['id'], 'site_id': value['siteId'], 'destination': SiteDestinationToJSON(value['destination']), 'fail_over_destination': SiteDestinationToJSON(value['failOverDestination']), 'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(LinkToJSON)), 'assigned': value['assigned'], 'assigned_to': value['assignedTo'], }; }