@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
131 lines (119 loc) • 4.48 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 { SiteDestination } from './SiteDestination';
import {
SiteDestinationFromJSON,
SiteDestinationFromJSONTyped,
SiteDestinationToJSON,
SiteDestinationToJSONTyped,
} from './SiteDestination';
import type { TemplateFeatureAttribute } from './TemplateFeatureAttribute';
import {
TemplateFeatureAttributeFromJSON,
TemplateFeatureAttributeFromJSONTyped,
TemplateFeatureAttributeToJSON,
TemplateFeatureAttributeToJSONTyped,
} from './TemplateFeatureAttribute';
/**
* Represents a configurable feature (switchable) within a template, forming a tree structure.
* @export
* @interface TemplateFeature
*/
export interface TemplateFeature {
/**
*
* @type {string}
* @memberof TemplateFeature
*/
switchable: string;
/**
*
* @type {number}
* @memberof TemplateFeature
*/
position: number;
/**
*
* @type {Array<TemplateFeatureAttribute>}
* @memberof TemplateFeature
*/
attrs?: Array<TemplateFeatureAttribute>;
/**
*
* @type {Array<TemplateFeature>}
* @memberof TemplateFeature
*/
destinations?: Array<TemplateFeature> | null;
/**
* Type of feature (e.g., device, extension, menu, voicemail).
* @type {string}
* @memberof TemplateFeature
*/
featureType?: string;
/**
* Optional. System code for the failover destination if this feature is unavailable.
* @type {SiteDestination}
* @memberof TemplateFeature
*/
failover?: SiteDestination | null;
/**
* The type of the target object for the feature (e.g. Device, RingGroup).
* @type {string}
* @memberof TemplateFeature
*/
targetType?: string;
}
/**
* Check if a given object implements the TemplateFeature interface.
*/
export function instanceOfTemplateFeature(value: object): value is TemplateFeature {
if (!('switchable' in value) || value['switchable'] === undefined) return false;
if (!('position' in value) || value['position'] === undefined) return false;
return true;
}
export function TemplateFeatureFromJSON(json: any): TemplateFeature {
return TemplateFeatureFromJSONTyped(json, false);
}
export function TemplateFeatureFromJSONTyped(json: any, ignoreDiscriminator: boolean): TemplateFeature {
if (json == null) {
return json;
}
return {
'switchable': json['switchable'],
'position': json['position'],
'attrs': json['attrs'] == null ? undefined : ((json['attrs'] as Array<any>).map(TemplateFeatureAttributeFromJSON)),
'destinations': json['destinations'] == null ? undefined : ((json['destinations'] as Array<any>).map(TemplateFeatureFromJSON)),
'featureType': json['feature_type'] == null ? undefined : json['feature_type'],
'failover': json['failover'] == null ? undefined : SiteDestinationFromJSON(json['failover']),
'targetType': json['target_type'] == null ? undefined : json['target_type'],
};
}
export function TemplateFeatureToJSON(json: any): TemplateFeature {
return TemplateFeatureToJSONTyped(json, false);
}
export function TemplateFeatureToJSONTyped(value?: TemplateFeature | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'switchable': value['switchable'],
'position': value['position'],
'attrs': value['attrs'] == null ? undefined : ((value['attrs'] as Array<any>).map(TemplateFeatureAttributeToJSON)),
'destinations': value['destinations'] == null ? undefined : ((value['destinations'] as Array<any>).map(TemplateFeatureToJSON)),
'feature_type': value['featureType'],
'failover': SiteDestinationToJSON(value['failover']),
'target_type': value['targetType'],
};
}