@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
126 lines (114 loc) • 4.08 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 { SipTrunkResponse } from './SipTrunkResponse';
import {
SipTrunkResponseFromJSON,
SipTrunkResponseFromJSONTyped,
SipTrunkResponseToJSON,
SipTrunkResponseToJSONTyped,
} from './SipTrunkResponse';
import type { PaginationLinks } from './PaginationLinks';
import {
PaginationLinksFromJSON,
PaginationLinksFromJSONTyped,
PaginationLinksToJSON,
PaginationLinksToJSONTyped,
} from './PaginationLinks';
/**
* A paginated list of SIP Trunks.
* @export
* @interface PaginatedSipTrunkListResponse
*/
export interface PaginatedSipTrunkListResponse {
/**
*
* @type {Array<SipTrunkResponse>}
* @memberof PaginatedSipTrunkListResponse
*/
sipTrunks: Array<SipTrunkResponse>;
/**
*
* @type {number}
* @memberof PaginatedSipTrunkListResponse
*/
totalItems: number;
/**
*
* @type {number}
* @memberof PaginatedSipTrunkListResponse
*/
totalPages: number;
/**
*
* @type {number}
* @memberof PaginatedSipTrunkListResponse
*/
currentPage: number;
/**
*
* @type {number}
* @memberof PaginatedSipTrunkListResponse
*/
perPage: number;
/**
*
* @type {PaginationLinks}
* @memberof PaginatedSipTrunkListResponse
*/
links?: PaginationLinks;
}
/**
* Check if a given object implements the PaginatedSipTrunkListResponse interface.
*/
export function instanceOfPaginatedSipTrunkListResponse(value: object): value is PaginatedSipTrunkListResponse {
if (!('sipTrunks' in value) || value['sipTrunks'] === undefined) return false;
if (!('totalItems' in value) || value['totalItems'] === undefined) return false;
if (!('totalPages' in value) || value['totalPages'] === undefined) return false;
if (!('currentPage' in value) || value['currentPage'] === undefined) return false;
if (!('perPage' in value) || value['perPage'] === undefined) return false;
return true;
}
export function PaginatedSipTrunkListResponseFromJSON(json: any): PaginatedSipTrunkListResponse {
return PaginatedSipTrunkListResponseFromJSONTyped(json, false);
}
export function PaginatedSipTrunkListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedSipTrunkListResponse {
if (json == null) {
return json;
}
return {
'sipTrunks': ((json['sip_trunks'] as Array<any>).map(SipTrunkResponseFromJSON)),
'totalItems': json['total_items'],
'totalPages': json['total_pages'],
'currentPage': json['current_page'],
'perPage': json['per_page'],
'links': json['links'] == null ? undefined : PaginationLinksFromJSON(json['links']),
};
}
export function PaginatedSipTrunkListResponseToJSON(json: any): PaginatedSipTrunkListResponse {
return PaginatedSipTrunkListResponseToJSONTyped(json, false);
}
export function PaginatedSipTrunkListResponseToJSONTyped(value?: PaginatedSipTrunkListResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'sip_trunks': ((value['sipTrunks'] as Array<any>).map(SipTrunkResponseToJSON)),
'total_items': value['totalItems'],
'total_pages': value['totalPages'],
'current_page': value['currentPage'],
'per_page': value['perPage'],
'links': PaginationLinksToJSON(value['links']),
};
}