@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
141 lines (129 loc) • 4.32 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 { CallRecordItemSummary } from './CallRecordItemSummary';
import {
CallRecordItemSummaryFromJSON,
CallRecordItemSummaryFromJSONTyped,
CallRecordItemSummaryToJSON,
CallRecordItemSummaryToJSONTyped,
} from './CallRecordItemSummary';
import type { SchemasLink } from './SchemasLink';
import {
SchemasLinkFromJSON,
SchemasLinkFromJSONTyped,
SchemasLinkToJSON,
SchemasLinkToJSONTyped,
} from './SchemasLink';
/**
* Represents a Call Detail Record (CDR).
* @export
* @interface CallRecord
*/
export interface CallRecord {
/**
*
* @type {number}
* @memberof CallRecord
*/
id: number;
/**
*
* @type {string}
* @memberof CallRecord
*/
itemType: string;
/**
*
* @type {string}
* @memberof CallRecord
*/
itemRules?: string | null;
/**
*
* @type {{ [key: string]: any; }}
* @memberof CallRecord
*/
itemOptions?: { [key: string]: any; } | null;
/**
*
* @type {CallRecordItemSummary}
* @memberof CallRecord
*/
itemSummary: CallRecordItemSummary;
/**
*
* @type {string}
* @memberof CallRecord
*/
humanizedItemName: string | null;
/**
*
* @type {string}
* @memberof CallRecord
*/
customerBalanceAdjustment?: string | null;
/**
*
* @type {Array<SchemasLink>}
* @memberof CallRecord
*/
links?: Array<SchemasLink> | null;
}
/**
* Check if a given object implements the CallRecord interface.
*/
export function instanceOfCallRecord(value: object): value is CallRecord {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('itemType' in value) || value['itemType'] === undefined) return false;
if (!('itemSummary' in value) || value['itemSummary'] === undefined) return false;
if (!('humanizedItemName' in value) || value['humanizedItemName'] === undefined) return false;
return true;
}
export function CallRecordFromJSON(json: any): CallRecord {
return CallRecordFromJSONTyped(json, false);
}
export function CallRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean): CallRecord {
if (json == null) {
return json;
}
return {
'id': json['id'],
'itemType': json['item_type'],
'itemRules': json['item_rules'] == null ? undefined : json['item_rules'],
'itemOptions': json['item_options'] == null ? undefined : json['item_options'],
'itemSummary': CallRecordItemSummaryFromJSON(json['item_summary']),
'humanizedItemName': json['humanized_item_name'],
'customerBalanceAdjustment': json['customer_balance_adjustment'] == null ? undefined : json['customer_balance_adjustment'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SchemasLinkFromJSON)),
};
}
export function CallRecordToJSON(json: any): CallRecord {
return CallRecordToJSONTyped(json, false);
}
export function CallRecordToJSONTyped(value?: CallRecord | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'item_type': value['itemType'],
'item_rules': value['itemRules'],
'item_options': value['itemOptions'],
'item_summary': CallRecordItemSummaryToJSON(value['itemSummary']),
'humanized_item_name': value['humanizedItemName'],
'customer_balance_adjustment': value['customerBalanceAdjustment'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SchemasLinkToJSON)),
};
}