@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
163 lines (151 loc) • 5.36 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';
/**
* Detailed information about a stored credit card (excluding sensitive full PAN).
* @export
* @interface CreditCardResponse
*/
export interface CreditCardResponse {
/**
* Unique identifier for the credit card record.
* @type {number}
* @memberof CreditCardResponse
*/
id: number;
/**
* A custom name or label for the credit card (e.g., "Work Visa", "Personal Amex").
* @type {string}
* @memberof CreditCardResponse
*/
name: string;
/**
* The last four digits of the credit card number.
* @type {string}
* @memberof CreditCardResponse
*/
last4: string;
/**
* The brand of the credit card (e.g., Visa, Mastercard, American Express).
* @type {string}
* @memberof CreditCardResponse
*/
brand: string;
/**
* The expiration month of the credit card (1-12).
* @type {number}
* @memberof CreditCardResponse
*/
expMonth: number;
/**
* The expiration year of the credit card (e.g., 2025).
* @type {number}
* @memberof CreditCardResponse
*/
expYear: number;
/**
* Priority for payment processing (higher numbers typically processed first). Range 0-100.
* @type {number}
* @memberof CreditCardResponse
*/
priority: number;
/**
* Indicates if the card is active for payments.
* @type {boolean}
* @memberof CreditCardResponse
*/
active: boolean;
/**
* Indicates if the card has been successfully verified.
* @type {boolean}
* @memberof CreditCardResponse
*/
verified: boolean;
/**
* Indicates if the card is currently expired based on its expiration date.
* @type {boolean}
* @memberof CreditCardResponse
*/
readonly expired: boolean;
/**
* HATEOAS links related to this credit card.
* @type {Array<SchemasLink>}
* @memberof CreditCardResponse
*/
links?: Array<SchemasLink> | null;
}
/**
* Check if a given object implements the CreditCardResponse interface.
*/
export function instanceOfCreditCardResponse(value: object): value is CreditCardResponse {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('name' in value) || value['name'] === undefined) return false;
if (!('last4' in value) || value['last4'] === undefined) return false;
if (!('brand' in value) || value['brand'] === undefined) return false;
if (!('expMonth' in value) || value['expMonth'] === undefined) return false;
if (!('expYear' in value) || value['expYear'] === undefined) return false;
if (!('priority' in value) || value['priority'] === undefined) return false;
if (!('active' in value) || value['active'] === undefined) return false;
if (!('verified' in value) || value['verified'] === undefined) return false;
if (!('expired' in value) || value['expired'] === undefined) return false;
return true;
}
export function CreditCardResponseFromJSON(json: any): CreditCardResponse {
return CreditCardResponseFromJSONTyped(json, false);
}
export function CreditCardResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreditCardResponse {
if (json == null) {
return json;
}
return {
'id': json['id'],
'name': json['name'],
'last4': json['last4'],
'brand': json['brand'],
'expMonth': json['exp_month'],
'expYear': json['exp_year'],
'priority': json['priority'],
'active': json['active'],
'verified': json['verified'],
'expired': json['expired'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SchemasLinkFromJSON)),
};
}
export function CreditCardResponseToJSON(json: any): CreditCardResponse {
return CreditCardResponseToJSONTyped(json, false);
}
export function CreditCardResponseToJSONTyped(value?: Omit<CreditCardResponse, 'expired'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'name': value['name'],
'last4': value['last4'],
'brand': value['brand'],
'exp_month': value['expMonth'],
'exp_year': value['expYear'],
'priority': value['priority'],
'active': value['active'],
'verified': value['verified'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SchemasLinkToJSON)),
};
}