UNPKG

@ringer-tel/ivy

Version:
217 lines (202 loc) 7.21 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 { SchemasLink } from './SchemasLink'; import { SchemasLinkFromJSON, SchemasLinkFromJSONTyped, SchemasLinkToJSON, SchemasLinkToJSONTyped, } from './SchemasLink'; import type { PackageFeature } from './PackageFeature'; import { PackageFeatureFromJSON, PackageFeatureFromJSONTyped, PackageFeatureToJSON, PackageFeatureToJSONTyped, } from './PackageFeature'; /** * Detailed information about a service package. * @export * @interface PackageResponse */ export interface PackageResponse { /** * Unique identifier for the package. * @type {number} * @memberof PackageResponse */ id: number; /** * The name of the package. * @type {string} * @memberof PackageResponse */ name: string; /** * A brief description of what the package includes or its purpose. * @type {string} * @memberof PackageResponse */ description?: string | null; /** * The type of item this package represents or groups (e.g., subscription, feature_bundle, usage_minutes). * @type {string} * @memberof PackageResponse */ itemType: string; /** * Specific rules or subclassifications for the item type. * @type {string} * @memberof PackageResponse */ itemRules?: string | null; /** * The quantity of the item provided by this package (e.g., number of minutes, 1 for a subscription). * @type {number} * @memberof PackageResponse */ itemQuantity: number; /** * The cost of this package if it's optional or its contribution to a plan's price. * @type {string} * @memberof PackageResponse */ price: string; /** * Three-letter ISO currency code for the package price. * @type {string} * @memberof PackageResponse */ currency: string; /** * Identifier of the plan this package definition might be primarily associated with or templated from. * @type {number} * @memberof PackageResponse */ planId?: number | null; /** * True if this package is an included part of a plan, false if it's optional. * @type {boolean} * @memberof PackageResponse */ included: boolean; /** * Indicates if this package can be removed from a plan by the customer. * @type {boolean} * @memberof PackageResponse */ removable: boolean; /** * Category of the package * @type {string} * @memberof PackageResponse */ category?: PackageResponseCategoryEnum; /** * Whether the package renews automatically * @type {boolean} * @memberof PackageResponse */ renewable?: boolean; /** * List of features included in the package * @type {Array<PackageFeature>} * @memberof PackageResponse */ features?: Array<PackageFeature> | null; /** * HATEOAS links related to this package. * @type {Array<SchemasLink>} * @memberof PackageResponse */ links?: Array<SchemasLink> | null; } /** * @export */ export const PackageResponseCategoryEnum = { Calling: 'calling', Messaging: 'messaging', Conferencing: 'conferencing', Faxing: 'faxing', Security: 'security', BasePlan: 'base_plan', AddOn: 'add_on' } as const; export type PackageResponseCategoryEnum = typeof PackageResponseCategoryEnum[keyof typeof PackageResponseCategoryEnum]; /** * Check if a given object implements the PackageResponse interface. */ export function instanceOfPackageResponse(value: object): value is PackageResponse { if (!('id' in value) || value['id'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; if (!('itemType' in value) || value['itemType'] === undefined) return false; if (!('itemQuantity' in value) || value['itemQuantity'] === undefined) return false; if (!('price' in value) || value['price'] === undefined) return false; if (!('currency' in value) || value['currency'] === undefined) return false; if (!('included' in value) || value['included'] === undefined) return false; if (!('removable' in value) || value['removable'] === undefined) return false; return true; } export function PackageResponseFromJSON(json: any): PackageResponse { return PackageResponseFromJSONTyped(json, false); } export function PackageResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PackageResponse { if (json == null) { return json; } return { 'id': json['id'], 'name': json['name'], 'description': json['description'] == null ? undefined : json['description'], 'itemType': json['item_type'], 'itemRules': json['item_rules'] == null ? undefined : json['item_rules'], 'itemQuantity': json['item_quantity'], 'price': json['price'], 'currency': json['currency'], 'planId': json['plan_id'] == null ? undefined : json['plan_id'], 'included': json['included'], 'removable': json['removable'], 'category': json['category'] == null ? undefined : json['category'], 'renewable': json['renewable'] == null ? undefined : json['renewable'], 'features': json['features'] == null ? undefined : ((json['features'] as Array<any>).map(PackageFeatureFromJSON)), 'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SchemasLinkFromJSON)), }; } export function PackageResponseToJSON(json: any): PackageResponse { return PackageResponseToJSONTyped(json, false); } export function PackageResponseToJSONTyped(value?: PackageResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'name': value['name'], 'description': value['description'], 'item_type': value['itemType'], 'item_rules': value['itemRules'], 'item_quantity': value['itemQuantity'], 'price': value['price'], 'currency': value['currency'], 'plan_id': value['planId'], 'included': value['included'], 'removable': value['removable'], 'category': value['category'], 'renewable': value['renewable'], 'features': value['features'] == null ? undefined : ((value['features'] as Array<any>).map(PackageFeatureToJSON)), 'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SchemasLinkToJSON)), }; }