@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
126 lines (114 loc) • 3.9 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 { SeatResponse } from './SeatResponse';
import {
SeatResponseFromJSON,
SeatResponseFromJSONTyped,
SeatResponseToJSON,
SeatResponseToJSONTyped,
} from './SeatResponse';
import type { Link } from './Link';
import {
LinkFromJSON,
LinkFromJSONTyped,
LinkToJSON,
LinkToJSONTyped,
} from './Link';
/**
* A paginated list of seats.
* @export
* @interface PaginatedSeatListResponse
*/
export interface PaginatedSeatListResponse {
/**
*
* @type {Array<SeatResponse>}
* @memberof PaginatedSeatListResponse
*/
seats: Array<SeatResponse>;
/**
*
* @type {number}
* @memberof PaginatedSeatListResponse
*/
totalItems: number;
/**
*
* @type {number}
* @memberof PaginatedSeatListResponse
*/
totalPages: number;
/**
*
* @type {number}
* @memberof PaginatedSeatListResponse
*/
currentPage: number;
/**
*
* @type {number}
* @memberof PaginatedSeatListResponse
*/
perPage: number;
/**
*
* @type {Array<Link>}
* @memberof PaginatedSeatListResponse
*/
links?: Array<Link> | null;
}
/**
* Check if a given object implements the PaginatedSeatListResponse interface.
*/
export function instanceOfPaginatedSeatListResponse(value: object): value is PaginatedSeatListResponse {
if (!('seats' in value) || value['seats'] === 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 PaginatedSeatListResponseFromJSON(json: any): PaginatedSeatListResponse {
return PaginatedSeatListResponseFromJSONTyped(json, false);
}
export function PaginatedSeatListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedSeatListResponse {
if (json == null) {
return json;
}
return {
'seats': ((json['seats'] as Array<any>).map(SeatResponseFromJSON)),
'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(LinkFromJSON)),
};
}
export function PaginatedSeatListResponseToJSON(json: any): PaginatedSeatListResponse {
return PaginatedSeatListResponseToJSONTyped(json, false);
}
export function PaginatedSeatListResponseToJSONTyped(value?: PaginatedSeatListResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'seats': ((value['seats'] as Array<any>).map(SeatResponseToJSON)),
'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(LinkToJSON)),
};
}