@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
165 lines (153 loc) • 5.69 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 { 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';
/**
* Detailed information about a phone number assigned to a site.
* @export
* @interface SchemasPhoneNumberResponse
*/
export interface SchemasPhoneNumberResponse {
/**
* A user-friendly name for the phone number (e.g., "Main Line", "Sales Dept").
* @type {string}
* @memberof SchemasPhoneNumberResponse
*/
name: string;
/**
* The actual phone number in E.164 format (e.g., +13035551212).
* @type {string}
* @memberof SchemasPhoneNumberResponse
*/
number: string;
/**
* System code for the primary destination where calls to this number are routed.
* @type {string}
* @memberof SchemasPhoneNumberResponse
*/
destinationCode: string;
/**
* System code for the failover destination if the primary is unavailable.
* @type {string}
* @memberof SchemasPhoneNumberResponse
*/
failOverDestinationCode?: string | null;
/**
* Identifier of the E911 record associated with this phone number for emergency calling.
* @type {number}
* @memberof SchemasPhoneNumberResponse
*/
e911Id?: number | null;
/**
* Optional. Identifier of a user primarily associated with this phone number.
* @type {number}
* @memberof SchemasPhoneNumberResponse
*/
userId?: number | null;
/**
*
* @type {number}
* @memberof SchemasPhoneNumberResponse
*/
id: number;
/**
*
* @type {number}
* @memberof SchemasPhoneNumberResponse
*/
siteId?: number | null;
/**
*
* @type {SiteDestination}
* @memberof SchemasPhoneNumberResponse
*/
destination?: SiteDestination | null;
/**
*
* @type {SiteDestination}
* @memberof SchemasPhoneNumberResponse
*/
failOverDestination?: SiteDestination | null;
/**
*
* @type {Array<Link>}
* @memberof SchemasPhoneNumberResponse
*/
links?: Array<Link> | null;
}
/**
* Check if a given object implements the SchemasPhoneNumberResponse interface.
*/
export function instanceOfSchemasPhoneNumberResponse(value: object): value is SchemasPhoneNumberResponse {
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;
return true;
}
export function SchemasPhoneNumberResponseFromJSON(json: any): SchemasPhoneNumberResponse {
return SchemasPhoneNumberResponseFromJSONTyped(json, false);
}
export function SchemasPhoneNumberResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SchemasPhoneNumberResponse {
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)),
};
}
export function SchemasPhoneNumberResponseToJSON(json: any): SchemasPhoneNumberResponse {
return SchemasPhoneNumberResponseToJSONTyped(json, false);
}
export function SchemasPhoneNumberResponseToJSONTyped(value?: SchemasPhoneNumberResponse | 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)),
};
}