@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
136 lines (124 loc) • 4.6 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.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 { IndexComponentsSchemasLink } from './IndexComponentsSchemasLink';
import {
IndexComponentsSchemasLinkFromJSON,
IndexComponentsSchemasLinkFromJSONTyped,
IndexComponentsSchemasLinkToJSON,
IndexComponentsSchemasLinkToJSONTyped,
} from './IndexComponentsSchemasLink';
/**
* Detailed information about a site extension.
* @export
* @interface ExtensionResponse
*/
export interface ExtensionResponse {
/**
* Extension number (e.g., "1001", "*123"). Typically 2-12 digits.
* @type {string}
* @memberof ExtensionResponse
*/
number: string;
/**
* A user-friendly name for the extension (e.g., "Sales Hotline", "John Doe").
* @type {string}
* @memberof ExtensionResponse
*/
name: string;
/**
* System code for the destination where calls to this extension are routed (e.g., "device:dev_xyz", "menu:ivr_main").
* @type {string}
* @memberof ExtensionResponse
*/
destinationCode: string;
/**
* Unique identifier for the extension.
* @type {number}
* @memberof ExtensionResponse
*/
id: number;
/**
* Identifier of the site this extension belongs to.
* @type {number}
* @memberof ExtensionResponse
*/
siteId: number | null;
/**
* Human-readable name of the destination this extension points to.
* @type {string}
* @memberof ExtensionResponse
*/
destinationName: string | null;
/**
* Optional user ID associated with this extension.
* @type {number}
* @memberof ExtensionResponse
*/
userId?: number | null;
/**
*
* @type {Array<IndexComponentsSchemasLink>}
* @memberof ExtensionResponse
*/
links?: Array<IndexComponentsSchemasLink> | null;
}
/**
* Check if a given object implements the ExtensionResponse interface.
*/
export function instanceOfExtensionResponse(value: object): value is ExtensionResponse {
if (!('number' in value) || value['number'] === undefined) return false;
if (!('name' in value) || value['name'] === undefined) return false;
if (!('destinationCode' in value) || value['destinationCode'] === undefined) return false;
if (!('id' in value) || value['id'] === undefined) return false;
if (!('siteId' in value) || value['siteId'] === undefined) return false;
if (!('destinationName' in value) || value['destinationName'] === undefined) return false;
return true;
}
export function ExtensionResponseFromJSON(json: any): ExtensionResponse {
return ExtensionResponseFromJSONTyped(json, false);
}
export function ExtensionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExtensionResponse {
if (json == null) {
return json;
}
return {
'number': json['number'],
'name': json['name'],
'destinationCode': json['destination_code'],
'id': json['id'],
'siteId': json['site_id'],
'destinationName': json['destination_name'],
'userId': json['user_id'] == null ? undefined : json['user_id'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(IndexComponentsSchemasLinkFromJSON)),
};
}
export function ExtensionResponseToJSON(json: any): ExtensionResponse {
return ExtensionResponseToJSONTyped(json, false);
}
export function ExtensionResponseToJSONTyped(value?: ExtensionResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'number': value['number'],
'name': value['name'],
'destination_code': value['destinationCode'],
'id': value['id'],
'site_id': value['siteId'],
'destination_name': value['destinationName'],
'user_id': value['userId'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(IndexComponentsSchemasLinkToJSON)),
};
}