@lob/lob-typescript-sdk
Version:
Lob API wrapper
1,384 lines (1,363 loc) • 1.29 MB
JavaScript
/**
* @license
* author: Lob <support@lob.com> (https://lob.com/)
* Lob Typescript SDK v1.3.5
*/
import globalAxios from 'axios';
/* tslint:disable */
const BASE_PATH = "https://api.lob.com/v1".replace(/\/+$/, "");
/**
*
* @export
* @class BaseAPI
*/
class BaseAPI {
constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
this.basePath = basePath;
this.axios = axios;
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
}
}
}
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
class RequiredError extends Error {
constructor(field, msg) {
super(msg);
this.field = field;
this.name = "RequiredError";
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/**
*
* @export
*/
const DUMMY_BASE_URL = "https://example.com";
/**
*
* @throws {RequiredError}
* @export
*/
const assertParamExists = function (functionName, paramName, paramValue) {
if (paramValue === null || paramValue === undefined) {
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
}
};
/**
*
* @export
*/
const setBasicAuthToObject = function (object, configuration) {
if (configuration && (configuration.username || configuration.password)) {
object["auth"] = {
username: configuration.username,
password: configuration.password,
};
}
};
/**
*
* @export
*/
const setSearchParams = function (url, ...objects) {
const searchParams = new URLSearchParams(url.search);
for (const object of objects) {
for (const key in object) {
if (Array.isArray(object[key])) {
searchParams.delete(key);
for (const item of object[key]) {
searchParams.append(key, item);
}
}
else {
searchParams.set(key, object[key]);
}
}
}
url.search = searchParams.toString();
};
/**
*
* @export
*/
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
const nonString = typeof value !== "string";
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(requestOptions.headers["Content-Type"])
: nonString;
return needsSerialization
? JSON.stringify(value !== undefined ? value : {})
: value || "";
};
/**
*
* @export
*/
const toPathString = function (url) {
return url.pathname + url.search + url.hash;
};
/**
*
* @export
*/
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
return (axios = globalAxios, basePath = BASE_PATH) => {
axiosArgs.options = Object.assign(Object.assign({}, axiosArgs.options), {
options: {
"User-Agent": `${process.env.npm_package_name}/${process.env.npm_package_version}`,
},
});
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url });
return axios.request(axiosRequestArgs);
};
};
/**
* Converts an input value to a string. When the input value is an object, it is converted to a JSON string.
* @export
*/
const valueToString = function valueToString(value) {
let out;
switch (typeof value) {
case "object":
out = JSON.stringify(value);
break;
default:
out = String(value);
break;
}
return out;
};
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class Address
*/
class Address {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.id) !== "undefined") {
this.id = input.id;
}
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.name) !== "undefined") {
this.name = input.name;
}
if (typeof (input === null || input === void 0 ? void 0 : input.company) !== "undefined") {
this.company = input.company;
}
if (typeof (input === null || input === void 0 ? void 0 : input.phone) !== "undefined") {
this.phone = input.phone;
}
if (typeof (input === null || input === void 0 ? void 0 : input.email) !== "undefined") {
this.email = input.email;
}
if (typeof (input === null || input === void 0 ? void 0 : input.metadata) !== "undefined") {
this.metadata = input.metadata;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_line1) !== "undefined") {
this.address_line1 = input.address_line1;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_line2) !== "undefined") {
this.address_line2 = input.address_line2;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_city) !== "undefined") {
this.address_city = input.address_city;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_state) !== "undefined") {
this.address_state = input.address_state;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_zip) !== "undefined") {
this.address_zip = input.address_zip;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_country) !== "undefined") {
this.address_country = input.address_country;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
if (typeof (input === null || input === void 0 ? void 0 : input.date_created) !== "undefined") {
this.date_created = input.date_created;
}
if (typeof (input === null || input === void 0 ? void 0 : input.date_modified) !== "undefined") {
this.date_modified = input.date_modified;
}
if (typeof (input === null || input === void 0 ? void 0 : input.deleted) !== "undefined") {
this.deleted = input.deleted;
}
if (typeof (input === null || input === void 0 ? void 0 : input.recipient_moved) !== "undefined") {
this.recipient_moved = input.recipient_moved;
}
}
get id() {
return (this._id || undefined);
}
set id(newValue) {
if (newValue && !/^adr_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
}
get address_state() {
return (this._address_state || undefined);
}
set address_state(newValue) {
if (newValue && !/^[a-zA-Z]{2}$/.test(newValue)) {
throw new Error("Invalid address_state provided");
}
this._address_state = newValue;
}
get address_zip() {
return (this._address_zip || undefined);
}
set address_zip(newValue) {
if (newValue && !/^\d{5}(-\d{4})?$/.test(newValue)) {
throw new Error("Invalid address_zip provided");
}
this._address_zip = newValue;
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* @export
* @enum {string}
*/
var AddressObjectEnum;
(function (AddressObjectEnum) {
AddressObjectEnum["Address"] = "address";
})(AddressObjectEnum || (AddressObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Object returned upon deleting an address
* @export
* @class AddressDeletion
*/
class AddressDeletion {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.id) !== "undefined") {
this.id = input.id;
}
if (typeof (input === null || input === void 0 ? void 0 : input.deleted) !== "undefined") {
this.deleted = input.deleted;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
}
get id() {
return (this._id || undefined);
}
set id(newValue) {
if (newValue && !/^adr_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* @export
* @enum {string}
*/
var AddressDeletionObjectEnum;
(function (AddressDeletionObjectEnum) {
AddressDeletionObjectEnum["AddressDeleted"] = "address_deleted";
})(AddressDeletionObjectEnum || (AddressDeletionObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class AddressDomestic
*/
class AddressDomestic {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.address_line1) !== "undefined") {
this.address_line1 = input.address_line1;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_line2) !== "undefined") {
this.address_line2 = input.address_line2;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_city) !== "undefined") {
this.address_city = input.address_city;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_state) !== "undefined") {
this.address_state = input.address_state;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_zip) !== "undefined") {
this.address_zip = input.address_zip;
}
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.name) !== "undefined") {
this.name = input.name;
}
if (typeof (input === null || input === void 0 ? void 0 : input.company) !== "undefined") {
this.company = input.company;
}
if (typeof (input === null || input === void 0 ? void 0 : input.phone) !== "undefined") {
this.phone = input.phone;
}
if (typeof (input === null || input === void 0 ? void 0 : input.email) !== "undefined") {
this.email = input.email;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_country) !== "undefined") {
this.address_country = input.address_country;
}
if (typeof (input === null || input === void 0 ? void 0 : input.metadata) !== "undefined") {
this.metadata = input.metadata;
}
}
get address_country() {
return (this._address_country || null || undefined);
}
set address_country(newValue) {
if (newValue && !/US/.test(newValue)) {
throw new Error("Invalid address_country provided");
}
this._address_country = newValue;
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class AddressDomesticExpanded
*/
class AddressDomesticExpanded {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.address_line1) !== "undefined") {
this.address_line1 = input.address_line1;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_line2) !== "undefined") {
this.address_line2 = input.address_line2;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_city) !== "undefined") {
this.address_city = input.address_city;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_state) !== "undefined") {
this.address_state = input.address_state;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_zip) !== "undefined") {
this.address_zip = input.address_zip;
}
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.name) !== "undefined") {
this.name = input.name;
}
if (typeof (input === null || input === void 0 ? void 0 : input.company) !== "undefined") {
this.company = input.company;
}
if (typeof (input === null || input === void 0 ? void 0 : input.phone) !== "undefined") {
this.phone = input.phone;
}
if (typeof (input === null || input === void 0 ? void 0 : input.email) !== "undefined") {
this.email = input.email;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_country) !== "undefined") {
this.address_country = input.address_country;
}
if (typeof (input === null || input === void 0 ? void 0 : input.metadata) !== "undefined") {
this.metadata = input.metadata;
}
}
get address_country() {
return (this._address_country || undefined);
}
set address_country(newValue) {
if (newValue && !/UNITED STATES/.test(newValue)) {
throw new Error("Invalid address_country provided");
}
this._address_country = newValue;
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class AddressEditable
*/
class AddressEditable {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.address_line1) !== "undefined") {
this.address_line1 = input.address_line1;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_line2) !== "undefined") {
this.address_line2 = input.address_line2;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_city) !== "undefined") {
this.address_city = input.address_city;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_state) !== "undefined") {
this.address_state = input.address_state;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_zip) !== "undefined") {
this.address_zip = input.address_zip;
}
if (typeof (input === null || input === void 0 ? void 0 : input.address_country) !== "undefined") {
this.address_country = input.address_country;
}
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.name) !== "undefined") {
this.name = input.name;
}
if (typeof (input === null || input === void 0 ? void 0 : input.company) !== "undefined") {
this.company = input.company;
}
if (typeof (input === null || input === void 0 ? void 0 : input.phone) !== "undefined") {
this.phone = input.phone;
}
if (typeof (input === null || input === void 0 ? void 0 : input.email) !== "undefined") {
this.email = input.email;
}
if (typeof (input === null || input === void 0 ? void 0 : input.metadata) !== "undefined") {
this.metadata = input.metadata;
}
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class AddressList
*/
class AddressList {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.data) !== "undefined") {
this.data = input.data;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
if (typeof (input === null || input === void 0 ? void 0 : input.next_url) !== "undefined") {
this.next_url = input.next_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.previous_url) !== "undefined") {
this.previous_url = input.previous_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.count) !== "undefined") {
this.count = input.count;
}
if (typeof (input === null || input === void 0 ? void 0 : input.total_count) !== "undefined") {
this.total_count = input.total_count;
}
}
get nextPageToken() {
var _a;
if (!this.next_url) {
return undefined;
}
return (_a = this.next_url
.split("?")[1]
.split("&")
.find((raw) => raw.includes("after="))) === null || _a === void 0 ? void 0 : _a.split("=")[1];
}
get previousPageToken() {
var _a;
if (!this.previous_url) {
return undefined;
}
return (_a = this.previous_url
.split("?")[1]
.split("&")
.find((raw) => raw.includes("before="))) === null || _a === void 0 ? void 0 : _a.split("=")[1];
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class BankAccount
*/
class BankAccount {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.routing_number) !== "undefined") {
this.routing_number = input.routing_number;
}
if (typeof (input === null || input === void 0 ? void 0 : input.account_number) !== "undefined") {
this.account_number = input.account_number;
}
if (typeof (input === null || input === void 0 ? void 0 : input.account_type) !== "undefined") {
this.account_type = input.account_type;
}
if (typeof (input === null || input === void 0 ? void 0 : input.signatory) !== "undefined") {
this.signatory = input.signatory;
}
if (typeof (input === null || input === void 0 ? void 0 : input.metadata) !== "undefined") {
this.metadata = input.metadata;
}
if (typeof (input === null || input === void 0 ? void 0 : input.id) !== "undefined") {
this.id = input.id;
}
if (typeof (input === null || input === void 0 ? void 0 : input.signature_url) !== "undefined") {
this.signature_url = input.signature_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.bank_name) !== "undefined") {
this.bank_name = input.bank_name;
}
if (typeof (input === null || input === void 0 ? void 0 : input.verified) !== "undefined") {
this.verified = input.verified;
}
if (typeof (input === null || input === void 0 ? void 0 : input.date_created) !== "undefined") {
this.date_created = input.date_created;
}
if (typeof (input === null || input === void 0 ? void 0 : input.date_modified) !== "undefined") {
this.date_modified = input.date_modified;
}
if (typeof (input === null || input === void 0 ? void 0 : input.deleted) !== "undefined") {
this.deleted = input.deleted;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
}
get id() {
return this._id;
}
set id(newValue) {
if (newValue && !/^bank_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
}
get signature_url() {
return (this._signature_url || null || undefined);
}
set signature_url(newValue) {
if (newValue &&
!/^https:\/\/lob-assets\.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(\.pdf|_thumb_[a-z]+_[0-9]+\.png)\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+$/.test(newValue)) {
throw new Error("Invalid signature_url provided");
}
this._signature_url = newValue;
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* @export
* @enum {string}
*/
var BankAccountAccountTypeEnum;
(function (BankAccountAccountTypeEnum) {
BankAccountAccountTypeEnum["Company"] = "company";
BankAccountAccountTypeEnum["Individual"] = "individual";
})(BankAccountAccountTypeEnum || (BankAccountAccountTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var BankAccountObjectEnum;
(function (BankAccountObjectEnum) {
BankAccountObjectEnum["BankAccount"] = "bank_account";
})(BankAccountObjectEnum || (BankAccountObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Lob uses RESTful HTTP response codes to indicate success or failure of an API request. In general, 2xx indicates success, 4xx indicate an input error, and 5xx indicates an error on Lob\'s end.
* @export
* @class BankAccountDeletion
*/
class BankAccountDeletion {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.id) !== "undefined") {
this.id = input.id;
}
if (typeof (input === null || input === void 0 ? void 0 : input.deleted) !== "undefined") {
this.deleted = input.deleted;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
}
get id() {
return (this._id || undefined);
}
set id(newValue) {
if (newValue && !/^bank_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* @export
* @enum {string}
*/
var BankAccountDeletionObjectEnum;
(function (BankAccountDeletionObjectEnum) {
BankAccountDeletionObjectEnum["BankAccountDeleted"] = "bank_account_deleted";
})(BankAccountDeletionObjectEnum || (BankAccountDeletionObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class BankAccountList
*/
class BankAccountList {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.data) !== "undefined") {
this.data = input.data;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
if (typeof (input === null || input === void 0 ? void 0 : input.next_url) !== "undefined") {
this.next_url = input.next_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.previous_url) !== "undefined") {
this.previous_url = input.previous_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.count) !== "undefined") {
this.count = input.count;
}
if (typeof (input === null || input === void 0 ? void 0 : input.total_count) !== "undefined") {
this.total_count = input.total_count;
}
}
get nextPageToken() {
var _a;
if (!this.next_url) {
return undefined;
}
return (_a = this.next_url
.split("?")[1]
.split("&")
.find((raw) => raw.includes("after="))) === null || _a === void 0 ? void 0 : _a.split("=")[1];
}
get previousPageToken() {
var _a;
if (!this.previous_url) {
return undefined;
}
return (_a = this.previous_url
.split("?")[1]
.split("&")
.find((raw) => raw.includes("before="))) === null || _a === void 0 ? void 0 : _a.split("=")[1];
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class BankAccountVerify
*/
class BankAccountVerify {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.amounts) !== "undefined") {
this.amounts = input.amounts;
}
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class BankAccountWritable
*/
class BankAccountWritable {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.routing_number) !== "undefined") {
this.routing_number = input.routing_number;
}
if (typeof (input === null || input === void 0 ? void 0 : input.account_number) !== "undefined") {
this.account_number = input.account_number;
}
if (typeof (input === null || input === void 0 ? void 0 : input.account_type) !== "undefined") {
this.account_type = input.account_type;
}
if (typeof (input === null || input === void 0 ? void 0 : input.signatory) !== "undefined") {
this.signatory = input.signatory;
}
if (typeof (input === null || input === void 0 ? void 0 : input.metadata) !== "undefined") {
this.metadata = input.metadata;
}
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* The type of entity that holds the account.
* @export
* @enum {string}
*/
var BankTypeEnum;
(function (BankTypeEnum) {
BankTypeEnum["Company"] = "company";
BankTypeEnum["Individual"] = "individual";
})(BankTypeEnum || (BankTypeEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class BillingGroup
*/
class BillingGroup {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.name) !== "undefined") {
this.name = input.name;
}
if (typeof (input === null || input === void 0 ? void 0 : input.id) !== "undefined") {
this.id = input.id;
}
if (typeof (input === null || input === void 0 ? void 0 : input.date_created) !== "undefined") {
this.date_created = input.date_created;
}
if (typeof (input === null || input === void 0 ? void 0 : input.date_modified) !== "undefined") {
this.date_modified = input.date_modified;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
}
get id() {
return this._id;
}
set id(newValue) {
if (newValue && !/^bg_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* @export
* @enum {string}
*/
var BillingGroupObjectEnum;
(function (BillingGroupObjectEnum) {
BillingGroupObjectEnum["BillingGroup"] = "billing_group";
})(BillingGroupObjectEnum || (BillingGroupObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class BillingGroupEditable
*/
class BillingGroupEditable {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.name) !== "undefined") {
this.name = input.name;
}
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class BillingGroupList
*/
class BillingGroupList {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.data) !== "undefined") {
this.data = input.data;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
if (typeof (input === null || input === void 0 ? void 0 : input.next_url) !== "undefined") {
this.next_url = input.next_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.previous_url) !== "undefined") {
this.previous_url = input.previous_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.count) !== "undefined") {
this.count = input.count;
}
}
get nextPageToken() {
var _a;
if (!this.next_url) {
return undefined;
}
return (_a = this.next_url
.split("?")[1]
.split("&")
.find((raw) => raw.includes("after="))) === null || _a === void 0 ? void 0 : _a.split("=")[1];
}
get previousPageToken() {
var _a;
if (!this.previous_url) {
return undefined;
}
return (_a = this.previous_url
.split("?")[1]
.split("&")
.find((raw) => raw.includes("before="))) === null || _a === void 0 ? void 0 : _a.split("=")[1];
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @class Buckslip
*/
class Buckslip {
constructor(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.id) !== "undefined") {
this.id = input.id;
}
if (typeof (input === null || input === void 0 ? void 0 : input.auto_reorder) !== "undefined") {
this.auto_reorder = input.auto_reorder;
}
if (typeof (input === null || input === void 0 ? void 0 : input.reorder_quantity) !== "undefined") {
this.reorder_quantity = input.reorder_quantity;
}
if (typeof (input === null || input === void 0 ? void 0 : input.threshold_amount) !== "undefined") {
this.threshold_amount = input.threshold_amount;
}
if (typeof (input === null || input === void 0 ? void 0 : input.url) !== "undefined") {
this.url = input.url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.raw_url) !== "undefined") {
this.raw_url = input.raw_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.front_original_url) !== "undefined") {
this.front_original_url = input.front_original_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.back_original_url) !== "undefined") {
this.back_original_url = input.back_original_url;
}
if (typeof (input === null || input === void 0 ? void 0 : input.thumbnails) !== "undefined") {
this.thumbnails = input.thumbnails;
}
if (typeof (input === null || input === void 0 ? void 0 : input.available_quantity) !== "undefined") {
this.available_quantity = input.available_quantity;
}
if (typeof (input === null || input === void 0 ? void 0 : input.allocated_quantity) !== "undefined") {
this.allocated_quantity = input.allocated_quantity;
}
if (typeof (input === null || input === void 0 ? void 0 : input.onhand_quantity) !== "undefined") {
this.onhand_quantity = input.onhand_quantity;
}
if (typeof (input === null || input === void 0 ? void 0 : input.pending_quantity) !== "undefined") {
this.pending_quantity = input.pending_quantity;
}
if (typeof (input === null || input === void 0 ? void 0 : input.projected_quantity) !== "undefined") {
this.projected_quantity = input.projected_quantity;
}
if (typeof (input === null || input === void 0 ? void 0 : input.buckslip_orders) !== "undefined") {
this.buckslip_orders = input.buckslip_orders;
}
if (typeof (input === null || input === void 0 ? void 0 : input.stock) !== "undefined") {
this.stock = input.stock;
}
if (typeof (input === null || input === void 0 ? void 0 : input.weight) !== "undefined") {
this.weight = input.weight;
}
if (typeof (input === null || input === void 0 ? void 0 : input.finish) !== "undefined") {
this.finish = input.finish;
}
if (typeof (input === null || input === void 0 ? void 0 : input.status) !== "undefined") {
this.status = input.status;
}
if (typeof (input === null || input === void 0 ? void 0 : input.object) !== "undefined") {
this.object = input.object;
}
if (typeof (input === null || input === void 0 ? void 0 : input.description) !== "undefined") {
this.description = input.description;
}
if (typeof (input === null || input === void 0 ? void 0 : input.size) !== "undefined") {
this.size = input.size;
}
}
get id() {
return this._id;
}
set id(newValue) {
if (newValue && !/^bck_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
}
toJSON() {
let out = {};
for (const [key, value] of Object.entries(this)) {
out = Object.assign({}, out, {
[key[0] === "_" ? key.substr(1, key.length) : key]: value,
});
}
return out;
}
}
/**
* @export
* @enum {string}
*/
var BuckslipStockEnum;
(function (BuckslipStockEnum) {
BuckslipStockEnum["Text"] = "text";
BuckslipStockEnum["Cover"] = "cover";
})(BuckslipStockEnum || (BuckslipStockEnum = {}));
/**
* @export
* @enum {string}
*/
var BuckslipWeightEnum;
(function (BuckslipWeightEnum) {
BuckslipWeightEnum["_80"] = "80#";
})(BuckslipWeightEnum || (BuckslipWeightEnum = {}));
/**
* @export
* @enum {string}
*/
var BuckslipFinishEnum;
(function (BuckslipFinishEnum) {
BuckslipFinishEnum["Gloss"] = "gloss";
BuckslipFinishEnum["Matte"] = "matte";
})(BuckslipFinishEnum || (BuckslipFinishEnum = {}));
/**
* @export
* @enum {string}
*/
var BuckslipStatusEnum;
(function (BuckslipStatusEnum) {
BuckslipStatusEnum["Processed"] = "processed";
BuckslipStatusEnum["Rendered"] = "rendered";
})(BuckslipStatusEnum || (BuckslipStatusEnum = {}));
/**
* @export
* @enum {string}
*/
var BuckslipObjectEnum;
(function (BuckslipObjectEnum) {
BuckslipObjectEnum["Buckslip"] = "buckslip";
})(BuckslipObjectEnum || (BuckslipObjectEnum = {}));
/**
* @export
* @enum {string}
*/
var BuckslipSizeEnum;
(function (BuckslipSizeEnum) {
BuckslipSizeEnum["_875x375"] = "8.75x3.75";
})(BuckslipSizeEnum || (BuckslipSizeEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous docum