@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
126 lines (114 loc) • 4.37 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 { SchemasLink } from './SchemasLink';
import {
SchemasLinkFromJSON,
SchemasLinkFromJSONTyped,
SchemasLinkToJSON,
SchemasLinkToJSONTyped,
} from './SchemasLink';
/**
* Detailed information about a call block rule.
* @export
* @interface CallBlockResponse
*/
export interface CallBlockResponse {
/**
* The phone number (or pattern) to block. E.164 format recommended for specific numbers.
* @type {string}
* @memberof CallBlockResponse
*/
numberToBlock: string;
/**
* If true, calls from the number are blocked to all extensions on the site. If false, `applicable_extensions` must be specified.
* @type {boolean}
* @memberof CallBlockResponse
*/
blockAllExtensions: boolean;
/**
* A list of specific extension identifiers (e.g., device codes, extension numbers) to which this block applies. Used if `block_all_extensions` is false.
* @type {Array<string>}
* @memberof CallBlockResponse
*/
applicableExtensions?: Array<string> | null;
/**
* Optional notes or reason for this call block rule.
* @type {string}
* @memberof CallBlockResponse
*/
notes?: string | null;
/**
* Unique identifier for the call block rule.
* @type {number}
* @memberof CallBlockResponse
*/
id: number;
/**
* Identifier of the site this call block rule belongs to.
* @type {number}
* @memberof CallBlockResponse
*/
siteId: number;
/**
* HATEOAS links related to this call block rule.
* @type {Array<SchemasLink>}
* @memberof CallBlockResponse
*/
links?: Array<SchemasLink> | null;
}
/**
* Check if a given object implements the CallBlockResponse interface.
*/
export function instanceOfCallBlockResponse(value: object): value is CallBlockResponse {
if (!('numberToBlock' in value) || value['numberToBlock'] === undefined) return false;
if (!('blockAllExtensions' in value) || value['blockAllExtensions'] === 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 CallBlockResponseFromJSON(json: any): CallBlockResponse {
return CallBlockResponseFromJSONTyped(json, false);
}
export function CallBlockResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CallBlockResponse {
if (json == null) {
return json;
}
return {
'numberToBlock': json['number_to_block'],
'blockAllExtensions': json['block_all_extensions'],
'applicableExtensions': json['applicable_extensions'] == null ? undefined : json['applicable_extensions'],
'notes': json['notes'] == null ? undefined : json['notes'],
'id': json['id'],
'siteId': json['site_id'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SchemasLinkFromJSON)),
};
}
export function CallBlockResponseToJSON(json: any): CallBlockResponse {
return CallBlockResponseToJSONTyped(json, false);
}
export function CallBlockResponseToJSONTyped(value?: CallBlockResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'number_to_block': value['numberToBlock'],
'block_all_extensions': value['blockAllExtensions'],
'applicable_extensions': value['applicableExtensions'],
'notes': value['notes'],
'id': value['id'],
'site_id': value['siteId'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SchemasLinkToJSON)),
};
}