@ringer-tel/ivy
Version:
TypeScript SDK for Ringer APIs
145 lines (133 loc) • 4.7 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 an address record, including its unique ID.
* @export
* @interface AddressResponse
*/
export interface AddressResponse {
/**
* Contact email address associated with this address record.
* @type {string}
* @memberof AddressResponse
*/
email: string;
/**
* Full street address, including building number, street name, and suite/apartment if applicable.
* @type {string}
* @memberof AddressResponse
*/
streetAddress: string;
/**
* Two-letter ISO 3166-1 alpha-2 country code (e.g., US, GB, CA).
* @type {string}
* @memberof AddressResponse
*/
country: string;
/**
* City name.
* @type {string}
* @memberof AddressResponse
*/
city: string;
/**
* State, province, or region, as applicable for the country.
* @type {string}
* @memberof AddressResponse
*/
stateProvince?: string;
/**
* Postal or ZIP code.
* @type {string}
* @memberof AddressResponse
*/
postalCode: string;
/**
* A contact phone number associated with this address, preferably in E.164 format.
* @type {string}
* @memberof AddressResponse
*/
contactNumber: string;
/**
* Unique identifier for the address record.
* @type {number}
* @memberof AddressResponse
*/
id: number;
/**
* HATEOAS links related to this address.
* @type {Array<SchemasLink>}
* @memberof AddressResponse
*/
links?: Array<SchemasLink> | null;
}
/**
* Check if a given object implements the AddressResponse interface.
*/
export function instanceOfAddressResponse(value: object): value is AddressResponse {
if (!('email' in value) || value['email'] === undefined) return false;
if (!('streetAddress' in value) || value['streetAddress'] === undefined) return false;
if (!('country' in value) || value['country'] === undefined) return false;
if (!('city' in value) || value['city'] === undefined) return false;
if (!('postalCode' in value) || value['postalCode'] === undefined) return false;
if (!('contactNumber' in value) || value['contactNumber'] === undefined) return false;
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function AddressResponseFromJSON(json: any): AddressResponse {
return AddressResponseFromJSONTyped(json, false);
}
export function AddressResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddressResponse {
if (json == null) {
return json;
}
return {
'email': json['email'],
'streetAddress': json['street_address'],
'country': json['country'],
'city': json['city'],
'stateProvince': json['state_province'] == null ? undefined : json['state_province'],
'postalCode': json['postal_code'],
'contactNumber': json['contact_number'],
'id': json['id'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(SchemasLinkFromJSON)),
};
}
export function AddressResponseToJSON(json: any): AddressResponse {
return AddressResponseToJSONTyped(json, false);
}
export function AddressResponseToJSONTyped(value?: AddressResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'email': value['email'],
'street_address': value['streetAddress'],
'country': value['country'],
'city': value['city'],
'state_province': value['stateProvince'],
'postal_code': value['postalCode'],
'contact_number': value['contactNumber'],
'id': value['id'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(SchemasLinkToJSON)),
};
}