@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
207 lines (192 loc) • 7.15 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 specific account statement.
* @export
* @interface StatementResponse
*/
export interface StatementResponse {
/**
* Unique identifier for the statement.
* @type {number}
* @memberof StatementResponse
*/
id: number;
/**
* A human-readable identifier for the statement (e.g., STMT-2023-10-001).
* @type {string}
* @memberof StatementResponse
*/
statementNumber?: string | null;
/**
* The start date and time of the service period covered by this statement.
* @type {Date}
* @memberof StatementResponse
*/
periodStart: Date;
/**
* The end date and time of the service period covered by this statement.
* @type {Date}
* @memberof StatementResponse
*/
periodEnd: Date;
/**
* The date when the statement was issued.
* @type {Date}
* @memberof StatementResponse
*/
issueDate: Date;
/**
* The date when payment for this statement is due.
* @type {Date}
* @memberof StatementResponse
*/
dueDate?: Date | null;
/**
* The total amount due or charged on this statement.
* @type {string}
* @memberof StatementResponse
*/
totalAmount: string;
/**
* Three-letter ISO currency code for the amounts on the statement.
* @type {string}
* @memberof StatementResponse
*/
currency: string;
/**
* The current status of the statement.
* @type {string}
* @memberof StatementResponse
*/
status: StatementResponseStatusEnum;
/**
* Original creation date string from legacy system, if applicable.
* @type {string}
* @memberof StatementResponse
*/
createdAtOriginal?: string | null;
/**
* Original closing date string from legacy system, if applicable.
* @type {string}
* @memberof StatementResponse
*/
closedAtOriginal?: string | null;
/**
* URL to an image representation of the statement (e.g., a PNG or JPG).
* @type {string}
* @memberof StatementResponse
*/
imageUrl?: string | null;
/**
* URL to download the statement in PDF format.
* @type {string}
* @memberof StatementResponse
*/
pdfUrl?: string | null;
/**
* URL to download associated Call Detail Records (CDRs) for this statement period, typically in CSV format.
* @type {string}
* @memberof StatementResponse
*/
cdrExportUrl?: string | null;
/**
* HATEOAS links related to this statement.
* @type {Array<SchemasLink>}
* @memberof StatementResponse
*/
links?: Array<SchemasLink> | null;
}
/**
* @export
*/
export const StatementResponseStatusEnum = {
Open: 'open',
Paid: 'paid',
Overdue: 'overdue',
Void: 'void',
Uncollectible: 'uncollectible'
} as const;
export type StatementResponseStatusEnum = typeof StatementResponseStatusEnum[keyof typeof StatementResponseStatusEnum];
/**
* Check if a given object implements the StatementResponse interface.
*/
export function instanceOfStatementResponse(value: object): value is StatementResponse {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('periodStart' in value) || value['periodStart'] === undefined) return false;
if (!('periodEnd' in value) || value['periodEnd'] === undefined) return false;
if (!('issueDate' in value) || value['issueDate'] === undefined) return false;
if (!('totalAmount' in value) || value['totalAmount'] === undefined) return false;
if (!('currency' in value) || value['currency'] === undefined) return false;
if (!('status' in value) || value['status'] === undefined) return false;
return true;
}
export function StatementResponseFromJSON(json: any): StatementResponse {
return StatementResponseFromJSONTyped(json, false);
}
export function StatementResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StatementResponse {
if (json == null) {
return json;
}
return {
'id': json['id'],
'statementNumber': json['statement_number'] == null ? undefined : json['statement_number'],
'periodStart': (new Date(json['period_start'])),
'periodEnd': (new Date(json['period_end'])),
'issueDate': (new Date(json['issue_date'])),
'dueDate': json['due_date'] == null ? undefined : (new Date(json['due_date'])),
'totalAmount': json['total_amount'],
'currency': json['currency'],
'status': json['status'],
'createdAtOriginal': json['created_at_original'] == null ? undefined : json['created_at_original'],
'closedAtOriginal': json['closed_at_original'] == null ? undefined : json['closed_at_original'],
'imageUrl': json['image_url'] == null ? undefined : json['image_url'],
'pdfUrl': json['pdf_url'] == null ? undefined : json['pdf_url'],
'cdrExportUrl': json['cdr_export_url'] == null ? undefined : json['cdr_export_url'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SchemasLinkFromJSON)),
};
}
export function StatementResponseToJSON(json: any): StatementResponse {
return StatementResponseToJSONTyped(json, false);
}
export function StatementResponseToJSONTyped(value?: StatementResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'statement_number': value['statementNumber'],
'period_start': ((value['periodStart']).toISOString()),
'period_end': ((value['periodEnd']).toISOString()),
'issue_date': ((value['issueDate']).toISOString()),
'due_date': value['dueDate'] == null ? undefined : ((value['dueDate'] as any).toISOString()),
'total_amount': value['totalAmount'],
'currency': value['currency'],
'status': value['status'],
'created_at_original': value['createdAtOriginal'],
'closed_at_original': value['closedAtOriginal'],
'image_url': value['imageUrl'],
'pdf_url': value['pdfUrl'],
'cdr_export_url': value['cdrExportUrl'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SchemasLinkToJSON)),
};
}