UNPKG

@ringer-tel/ivy

Version:
229 lines (214 loc) 7.66 kB
/* 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 { UserSummary } from './UserSummary'; import { UserSummaryFromJSON, UserSummaryFromJSONTyped, UserSummaryToJSON, UserSummaryToJSONTyped, } from './UserSummary'; import type { SchemasLink } from './SchemasLink'; import { SchemasLinkFromJSON, SchemasLinkFromJSONTyped, SchemasLinkToJSON, SchemasLinkToJSONTyped, } from './SchemasLink'; import type { AddressResponse } from './AddressResponse'; import { AddressResponseFromJSON, AddressResponseFromJSONTyped, AddressResponseToJSON, AddressResponseToJSONTyped, } from './AddressResponse'; /** * Detailed information about a customer account. * @export * @interface AccountResponse */ export interface AccountResponse { /** * Unique identifier for the account. * @type {number} * @memberof AccountResponse */ id: number; /** * The official name of the account/company. * @type {string} * @memberof AccountResponse */ name: string; /** * Current status of the account. * @type {string} * @memberof AccountResponse */ status: AccountResponseStatusEnum; /** * Identifier or name of the current subscription plan. * @type {string} * @memberof AccountResponse */ plan?: string; /** * Primary contact email for the account (often billing or admin). * @type {string} * @memberof AccountResponse */ email: string; /** * Primary contact phone number for the account. * @type {string} * @memberof AccountResponse */ phone?: string; /** * Timestamp of when the account was created. * @type {Date} * @memberof AccountResponse */ createdAt: Date; /** * Preferred language and regional settings for the account. * @type {string} * @memberof AccountResponse */ locale: string; /** * Current monetary balance of the account. * @type {string} * @memberof AccountResponse */ balance: string; /** * Desired minimum balance to maintain, in dollars. * @type {string} * @memberof AccountResponse */ balancePreferenceInDollars?: string; /** * Amount to automatically recharge when balance falls below preference, in dollars. * @type {string} * @memberof AccountResponse */ rechargePreferenceInDollars?: string; /** * Maximum permissible auto-recharge amount in a single transaction, in dollars. * @type {string} * @memberof AccountResponse */ maximumRechargePreferenceInDollars?: string; /** * Flag indicating if international calling/services are enabled. * @type {boolean} * @memberof AccountResponse */ internationalEnabled?: boolean; /** * * @type {UserSummary} * @memberof AccountResponse */ currentUser?: UserSummary; /** * * @type {AddressResponse} * @memberof AccountResponse */ address?: AddressResponse; /** * HATEOAS links related to the account. * @type {Array<SchemasLink>} * @memberof AccountResponse */ links?: Array<SchemasLink>; } /** * @export */ export const AccountResponseStatusEnum = { Active: 'active', Inactive: 'inactive', Suspended: 'suspended', PendingConfirmation: 'pending_confirmation', Closed: 'closed' } as const; export type AccountResponseStatusEnum = typeof AccountResponseStatusEnum[keyof typeof AccountResponseStatusEnum]; /** * Check if a given object implements the AccountResponse interface. */ export function instanceOfAccountResponse(value: object): value is AccountResponse { if (!('id' in value) || value['id'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; if (!('status' in value) || value['status'] === undefined) return false; if (!('email' in value) || value['email'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('locale' in value) || value['locale'] === undefined) return false; if (!('balance' in value) || value['balance'] === undefined) return false; return true; } export function AccountResponseFromJSON(json: any): AccountResponse { return AccountResponseFromJSONTyped(json, false); } export function AccountResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountResponse { if (json == null) { return json; } return { 'id': json['id'], 'name': json['name'], 'status': json['status'], 'plan': json['plan'] == null ? undefined : json['plan'], 'email': json['email'], 'phone': json['phone'] == null ? undefined : json['phone'], 'createdAt': (new Date(json['created_at'])), 'locale': json['locale'], 'balance': json['balance'], 'balancePreferenceInDollars': json['balance_preference_in_dollars'] == null ? undefined : json['balance_preference_in_dollars'], 'rechargePreferenceInDollars': json['recharge_preference_in_dollars'] == null ? undefined : json['recharge_preference_in_dollars'], 'maximumRechargePreferenceInDollars': json['maximum_recharge_preference_in_dollars'] == null ? undefined : json['maximum_recharge_preference_in_dollars'], 'internationalEnabled': json['international_enabled'] == null ? undefined : json['international_enabled'], 'currentUser': json['current_user'] == null ? undefined : UserSummaryFromJSON(json['current_user']), 'address': json['address'] == null ? undefined : AddressResponseFromJSON(json['address']), 'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SchemasLinkFromJSON)), }; } export function AccountResponseToJSON(json: any): AccountResponse { return AccountResponseToJSONTyped(json, false); } export function AccountResponseToJSONTyped(value?: AccountResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'name': value['name'], 'status': value['status'], 'plan': value['plan'], 'email': value['email'], 'phone': value['phone'], 'created_at': ((value['createdAt']).toISOString()), 'locale': value['locale'], 'balance': value['balance'], 'balance_preference_in_dollars': value['balancePreferenceInDollars'], 'recharge_preference_in_dollars': value['rechargePreferenceInDollars'], 'maximum_recharge_preference_in_dollars': value['maximumRechargePreferenceInDollars'], 'international_enabled': value['internationalEnabled'], 'current_user': UserSummaryToJSON(value['currentUser']), 'address': AddressResponseToJSON(value['address']), 'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SchemasLinkToJSON)), }; }