@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
126 lines (114 loc) • 3.95 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 { SchemasLink } from './SchemasLink';
import {
SchemasLinkFromJSON,
SchemasLinkFromJSONTyped,
SchemasLinkToJSON,
SchemasLinkToJSONTyped,
} from './SchemasLink';
import type { TemplateResponse } from './TemplateResponse';
import {
TemplateResponseFromJSON,
TemplateResponseFromJSONTyped,
TemplateResponseToJSON,
TemplateResponseToJSONTyped,
} from './TemplateResponse';
/**
* A list of service templates.
* @export
* @interface TemplateListResponse
*/
export interface TemplateListResponse {
/**
*
* @type {Array<TemplateResponse>}
* @memberof TemplateListResponse
*/
templates: Array<TemplateResponse>;
/**
*
* @type {number}
* @memberof TemplateListResponse
*/
totalItems: number;
/**
*
* @type {number}
* @memberof TemplateListResponse
*/
totalPages: number;
/**
*
* @type {number}
* @memberof TemplateListResponse
*/
currentPage: number;
/**
*
* @type {number}
* @memberof TemplateListResponse
*/
perPage: number;
/**
*
* @type {Array<SchemasLink>}
* @memberof TemplateListResponse
*/
links?: Array<SchemasLink> | null;
}
/**
* Check if a given object implements the TemplateListResponse interface.
*/
export function instanceOfTemplateListResponse(value: object): value is TemplateListResponse {
if (!('templates' in value) || value['templates'] === 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 TemplateListResponseFromJSON(json: any): TemplateListResponse {
return TemplateListResponseFromJSONTyped(json, false);
}
export function TemplateListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TemplateListResponse {
if (json == null) {
return json;
}
return {
'templates': ((json['templates'] as Array<any>).map(TemplateResponseFromJSON)),
'totalItems': json['total_items'],
'totalPages': json['total_pages'],
'currentPage': json['current_page'],
'perPage': json['per_page'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SchemasLinkFromJSON)),
};
}
export function TemplateListResponseToJSON(json: any): TemplateListResponse {
return TemplateListResponseToJSONTyped(json, false);
}
export function TemplateListResponseToJSONTyped(value?: TemplateListResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'templates': ((value['templates'] as Array<any>).map(TemplateResponseToJSON)),
'total_items': value['totalItems'],
'total_pages': value['totalPages'],
'current_page': value['currentPage'],
'per_page': value['perPage'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SchemasLinkToJSON)),
};
}