@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
142 lines (130 loc) • 4.59 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 { Link } from './Link';
import {
LinkFromJSON,
LinkFromJSONTyped,
LinkToJSON,
LinkToJSONTyped,
} from './Link';
/**
* Detailed information about a call forward.
* @export
* @interface ForwardResponse
*/
export interface ForwardResponse {
/**
* A user-friendly name for the forward configuration.
* @type {string}
* @memberof ForwardResponse
*/
name: string;
/**
* The external phone number (E.164 format recommended) to which calls will be forwarded.
* @type {string}
* @memberof ForwardResponse
*/
destinationDialString: string;
/**
* How long (in seconds) the forward will be attempted before failing over or disconnecting.
* @type {number}
* @memberof ForwardResponse
*/
timeout?: number;
/**
* Whether this call forward rule is currently active.
* @type {boolean}
* @memberof ForwardResponse
*/
active?: boolean;
/**
* System code for the destination if the forward attempt fails or times out.
* @type {string}
* @memberof ForwardResponse
*/
failOverDestinationCode?: string | null;
/**
* Optional. Identifier of the user primarily associated with this forward.
* @type {number}
* @memberof ForwardResponse
*/
userId?: number | null;
/**
* Unique identifier for the forward.
* @type {number}
* @memberof ForwardResponse
*/
id: number;
/**
* Identifier of the site this forward belongs to.
* @type {number}
* @memberof ForwardResponse
*/
siteId: number;
/**
*
* @type {Array<Link>}
* @memberof ForwardResponse
*/
links?: Array<Link> | null;
}
/**
* Check if a given object implements the ForwardResponse interface.
*/
export function instanceOfForwardResponse(value: object): value is ForwardResponse {
if (!('name' in value) || value['name'] === undefined) return false;
if (!('destinationDialString' in value) || value['destinationDialString'] === 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 ForwardResponseFromJSON(json: any): ForwardResponse {
return ForwardResponseFromJSONTyped(json, false);
}
export function ForwardResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ForwardResponse {
if (json == null) {
return json;
}
return {
'name': json['name'],
'destinationDialString': json['destination_dial_string'],
'timeout': json['timeout'] == null ? undefined : json['timeout'],
'active': json['active'] == null ? undefined : json['active'],
'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'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(LinkFromJSON)),
};
}
export function ForwardResponseToJSON(json: any): ForwardResponse {
return ForwardResponseToJSONTyped(json, false);
}
export function ForwardResponseToJSONTyped(value?: ForwardResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'destination_dial_string': value['destinationDialString'],
'timeout': value['timeout'],
'active': value['active'],
'fail_over_destination_code': value['failOverDestinationCode'],
'user_id': value['userId'],
'id': value['id'],
'site_id': value['siteId'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(LinkToJSON)),
};
}