@lob/lob-typescript-sdk
Version:
Lob API wrapper
1,309 lines (1,263 loc) • 1.58 MB
JavaScript
/**
* @license
* author: Lob <support@lob.com> (https://lob.com/)
* Lob Typescript SDK v1.3.5
*/
'use strict';
var require$$0 = require('tslib');
var require$$1 = require('axios');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
var lobTypescriptSdk = {};
var api = {};
var addressesApi = {};
var common = {};
var base = {};
(function (exports) {
/* 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.defineProperty(exports, "__esModule", { value: true });
exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
var tslib_1 = require$$0__default["default"];
// Some imports not used depending on template conditions
// @ts-ignore
var axios_1 = tslib_1.__importDefault(require$$1__default["default"]);
exports.BASE_PATH = "https://api.lob.com/v1".replace(/\/+$/, "");
/**
*
* @export
*/
exports.COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
/**
*
* @export
* @class BaseAPI
*/
var BaseAPI = /** @class */ (function () {
function BaseAPI(configuration, basePath, axios) {
if (basePath === void 0) { basePath = exports.BASE_PATH; }
if (axios === void 0) { axios = axios_1.default; }
this.basePath = basePath;
this.axios = axios;
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
}
}
return BaseAPI;
}());
exports.BaseAPI = BaseAPI;
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
var RequiredError = /** @class */ (function (_super) {
tslib_1.__extends(RequiredError, _super);
function RequiredError(field, msg) {
var _this = _super.call(this, msg) || this;
_this.field = field;
_this.name = "RequiredError";
return _this;
}
return RequiredError;
}(Error));
exports.RequiredError = RequiredError;
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
}(base));
/* 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.defineProperty(common, "__esModule", { value: true });
common.valueToString = common.createRequestFunction = common.toPathString = common.serializeDataIfNeeded = common.setSearchParams = common.setOAuthToObject = common.setBearerAuthToObject = common.setBasicAuthToObject = common.setApiKeyToObject = common.assertParamExists = common.DUMMY_BASE_URL = void 0;
var tslib_1$1 = require$$0__default["default"];
var base_1 = base;
/**
*
* @export
*/
common.DUMMY_BASE_URL = "https://example.com";
/**
*
* @throws {RequiredError}
* @export
*/
var assertParamExists = function (functionName, paramName, paramValue) {
if (paramValue === null || paramValue === undefined) {
throw new base_1.RequiredError(paramName, "Required parameter ".concat(paramName, " was null or undefined when calling ").concat(functionName, "."));
}
};
common.assertParamExists = assertParamExists;
/**
*
* @export
*/
var setApiKeyToObject = function (object, keyParamName, configuration) {
return tslib_1$1.__awaiter(this, void 0, void 0, function () {
var localVarApiKeyValue, _a;
return tslib_1$1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!(configuration && configuration.apiKey)) return [3 /*break*/, 5];
if (!(typeof configuration.apiKey === "function")) return [3 /*break*/, 2];
return [4 /*yield*/, configuration.apiKey(keyParamName)];
case 1:
_a = _b.sent();
return [3 /*break*/, 4];
case 2: return [4 /*yield*/, configuration.apiKey];
case 3:
_a = _b.sent();
_b.label = 4;
case 4:
localVarApiKeyValue = _a;
object[keyParamName] = localVarApiKeyValue;
_b.label = 5;
case 5: return [2 /*return*/];
}
});
});
};
common.setApiKeyToObject = setApiKeyToObject;
/**
*
* @export
*/
var setBasicAuthToObject = function (object, configuration) {
if (configuration && (configuration.username || configuration.password)) {
object["auth"] = {
username: configuration.username,
password: configuration.password,
};
}
};
common.setBasicAuthToObject = setBasicAuthToObject;
/**
*
* @export
*/
var setBearerAuthToObject = function (object, configuration) {
return tslib_1$1.__awaiter(this, void 0, void 0, function () {
var accessToken, _a;
return tslib_1$1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
if (!(typeof configuration.accessToken === "function")) return [3 /*break*/, 2];
return [4 /*yield*/, configuration.accessToken()];
case 1:
_a = _b.sent();
return [3 /*break*/, 4];
case 2: return [4 /*yield*/, configuration.accessToken];
case 3:
_a = _b.sent();
_b.label = 4;
case 4:
accessToken = _a;
object["Authorization"] = "Bearer " + accessToken;
_b.label = 5;
case 5: return [2 /*return*/];
}
});
});
};
common.setBearerAuthToObject = setBearerAuthToObject;
/**
*
* @export
*/
var setOAuthToObject = function (object, name, scopes, configuration) {
return tslib_1$1.__awaiter(this, void 0, void 0, function () {
var localVarAccessTokenValue, _a;
return tslib_1$1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
if (!(typeof configuration.accessToken === "function")) return [3 /*break*/, 2];
return [4 /*yield*/, configuration.accessToken(name, scopes)];
case 1:
_a = _b.sent();
return [3 /*break*/, 4];
case 2: return [4 /*yield*/, configuration.accessToken];
case 3:
_a = _b.sent();
_b.label = 4;
case 4:
localVarAccessTokenValue = _a;
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
_b.label = 5;
case 5: return [2 /*return*/];
}
});
});
};
common.setOAuthToObject = setOAuthToObject;
/**
*
* @export
*/
var setSearchParams = function (url) {
var objects = [];
for (var _i = 1; _i < arguments.length; _i++) {
objects[_i - 1] = arguments[_i];
}
var searchParams = new URLSearchParams(url.search);
for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) {
var object = objects_1[_a];
for (var key in object) {
if (Array.isArray(object[key])) {
searchParams.delete(key);
for (var _b = 0, _c = object[key]; _b < _c.length; _b++) {
var item = _c[_b];
searchParams.append(key, item);
}
}
else {
searchParams.set(key, object[key]);
}
}
}
url.search = searchParams.toString();
};
common.setSearchParams = setSearchParams;
/**
*
* @export
*/
var serializeDataIfNeeded = function (value, requestOptions, configuration) {
var nonString = typeof value !== "string";
var needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(requestOptions.headers["Content-Type"])
: nonString;
return needsSerialization
? JSON.stringify(value !== undefined ? value : {})
: value || "";
};
common.serializeDataIfNeeded = serializeDataIfNeeded;
/**
*
* @export
*/
var toPathString = function (url) {
return url.pathname + url.search + url.hash;
};
common.toPathString = toPathString;
/**
*
* @export
*/
var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
return function (axios, basePath) {
if (axios === void 0) { axios = globalAxios; }
if (basePath === void 0) { basePath = BASE_PATH; }
axiosArgs.options = tslib_1$1.__assign(tslib_1$1.__assign({}, axiosArgs.options), {
options: {
"User-Agent": "".concat(process.env.npm_package_name, "/").concat(process.env.npm_package_version),
},
});
var axiosRequestArgs = tslib_1$1.__assign(tslib_1$1.__assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url });
return axios.request(axiosRequestArgs);
};
};
common.createRequestFunction = createRequestFunction;
/**
* Converts an input value to a string. When the input value is an object, it is converted to a JSON string.
* @export
*/
var valueToString = function valueToString(value) {
var out;
switch (typeof value) {
case "object":
out = JSON.stringify(value);
break;
default:
out = String(value);
break;
}
return out;
};
common.valueToString = valueToString;
var models = {};
var address = {};
(function (exports) {
/* 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.defineProperty(exports, "__esModule", { value: true });
exports.AddressObjectEnum = exports.Address = void 0;
/**
*
* @export
* @class Address
*/
var Address = /** @class */ (function () {
function Address(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;
}
}
Object.defineProperty(Address.prototype, "id", {
get: function () {
return (this._id || undefined);
},
set: function (newValue) {
if (newValue && !/^adr_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Address.prototype, "address_state", {
get: function () {
return (this._address_state || undefined);
},
set: function (newValue) {
if (newValue && !/^[a-zA-Z]{2}$/.test(newValue)) {
throw new Error("Invalid address_state provided");
}
this._address_state = newValue;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Address.prototype, "address_zip", {
get: function () {
return (this._address_zip || undefined);
},
set: function (newValue) {
if (newValue && !/^\d{5}(-\d{4})?$/.test(newValue)) {
throw new Error("Invalid address_zip provided");
}
this._address_zip = newValue;
},
enumerable: false,
configurable: true
});
Address.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return Address;
}());
exports.Address = Address;
(function (AddressObjectEnum) {
AddressObjectEnum["Address"] = "address";
})(exports.AddressObjectEnum || (exports.AddressObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
}(address));
var addressDeletion = {};
(function (exports) {
/* 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.defineProperty(exports, "__esModule", { value: true });
exports.AddressDeletionObjectEnum = exports.AddressDeletion = void 0;
/**
* Object returned upon deleting an address
* @export
* @class AddressDeletion
*/
var AddressDeletion = /** @class */ (function () {
function AddressDeletion(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;
}
}
Object.defineProperty(AddressDeletion.prototype, "id", {
get: function () {
return (this._id || undefined);
},
set: function (newValue) {
if (newValue && !/^adr_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
},
enumerable: false,
configurable: true
});
AddressDeletion.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return AddressDeletion;
}());
exports.AddressDeletion = AddressDeletion;
(function (AddressDeletionObjectEnum) {
AddressDeletionObjectEnum["AddressDeleted"] = "address_deleted";
})(exports.AddressDeletionObjectEnum || (exports.AddressDeletionObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
}(addressDeletion));
var addressDomestic = {};
/* 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.defineProperty(addressDomestic, "__esModule", { value: true });
addressDomestic.AddressDomestic = void 0;
/**
*
* @export
* @class AddressDomestic
*/
var AddressDomestic = /** @class */ (function () {
function AddressDomestic(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;
}
}
Object.defineProperty(AddressDomestic.prototype, "address_country", {
get: function () {
return (this._address_country || null || undefined);
},
set: function (newValue) {
if (newValue && !/US/.test(newValue)) {
throw new Error("Invalid address_country provided");
}
this._address_country = newValue;
},
enumerable: false,
configurable: true
});
AddressDomestic.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return AddressDomestic;
}());
addressDomestic.AddressDomestic = AddressDomestic;
var addressDomesticExpanded = {};
/* 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.defineProperty(addressDomesticExpanded, "__esModule", { value: true });
addressDomesticExpanded.AddressDomesticExpanded = void 0;
/**
*
* @export
* @class AddressDomesticExpanded
*/
var AddressDomesticExpanded = /** @class */ (function () {
function AddressDomesticExpanded(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;
}
}
Object.defineProperty(AddressDomesticExpanded.prototype, "address_country", {
get: function () {
return (this._address_country || undefined);
},
set: function (newValue) {
if (newValue && !/UNITED STATES/.test(newValue)) {
throw new Error("Invalid address_country provided");
}
this._address_country = newValue;
},
enumerable: false,
configurable: true
});
AddressDomesticExpanded.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return AddressDomesticExpanded;
}());
addressDomesticExpanded.AddressDomesticExpanded = AddressDomesticExpanded;
var addressEditable = {};
/* 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.defineProperty(addressEditable, "__esModule", { value: true });
addressEditable.AddressEditable = void 0;
/**
*
* @export
* @class AddressEditable
*/
var AddressEditable = /** @class */ (function () {
function AddressEditable(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;
}
}
AddressEditable.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return AddressEditable;
}());
addressEditable.AddressEditable = AddressEditable;
var addressList = {};
/* 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.defineProperty(addressList, "__esModule", { value: true });
addressList.AddressList = void 0;
/**
*
* @export
* @class AddressList
*/
var AddressList = /** @class */ (function () {
function AddressList(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;
}
}
Object.defineProperty(AddressList.prototype, "nextPageToken", {
get: function () {
var _a;
if (!this.next_url) {
return undefined;
}
return (_a = this.next_url
.split("?")[1]
.split("&")
.find(function (raw) { return raw.includes("after="); })) === null || _a === void 0 ? void 0 : _a.split("=")[1];
},
enumerable: false,
configurable: true
});
Object.defineProperty(AddressList.prototype, "previousPageToken", {
get: function () {
var _a;
if (!this.previous_url) {
return undefined;
}
return (_a = this.previous_url
.split("?")[1]
.split("&")
.find(function (raw) { return raw.includes("before="); })) === null || _a === void 0 ? void 0 : _a.split("=")[1];
},
enumerable: false,
configurable: true
});
AddressList.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return AddressList;
}());
addressList.AddressList = AddressList;
var bankAccount = {};
(function (exports) {
/* 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.defineProperty(exports, "__esModule", { value: true });
exports.BankAccountObjectEnum = exports.BankAccountAccountTypeEnum = exports.BankAccount = void 0;
/**
*
* @export
* @class BankAccount
*/
var BankAccount = /** @class */ (function () {
function BankAccount(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;
}
}
Object.defineProperty(BankAccount.prototype, "id", {
get: function () {
return this._id;
},
set: function (newValue) {
if (newValue && !/^bank_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
},
enumerable: false,
configurable: true
});
Object.defineProperty(BankAccount.prototype, "signature_url", {
get: function () {
return (this._signature_url || null || undefined);
},
set: function (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;
},
enumerable: false,
configurable: true
});
BankAccount.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return BankAccount;
}());
exports.BankAccount = BankAccount;
(function (BankAccountAccountTypeEnum) {
BankAccountAccountTypeEnum["Company"] = "company";
BankAccountAccountTypeEnum["Individual"] = "individual";
})(exports.BankAccountAccountTypeEnum || (exports.BankAccountAccountTypeEnum = {}));
(function (BankAccountObjectEnum) {
BankAccountObjectEnum["BankAccount"] = "bank_account";
})(exports.BankAccountObjectEnum || (exports.BankAccountObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
}(bankAccount));
var bankAccountDeletion = {};
(function (exports) {
/* 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.defineProperty(exports, "__esModule", { value: true });
exports.BankAccountDeletionObjectEnum = exports.BankAccountDeletion = void 0;
/**
* 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
*/
var BankAccountDeletion = /** @class */ (function () {
function BankAccountDeletion(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;
}
}
Object.defineProperty(BankAccountDeletion.prototype, "id", {
get: function () {
return (this._id || undefined);
},
set: function (newValue) {
if (newValue && !/^bank_[a-zA-Z0-9]+$/.test(newValue)) {
throw new Error("Invalid id provided");
}
this._id = newValue;
},
enumerable: false,
configurable: true
});
BankAccountDeletion.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return BankAccountDeletion;
}());
exports.BankAccountDeletion = BankAccountDeletion;
(function (BankAccountDeletionObjectEnum) {
BankAccountDeletionObjectEnum["BankAccountDeleted"] = "bank_account_deleted";
})(exports.BankAccountDeletionObjectEnum || (exports.BankAccountDeletionObjectEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
}(bankAccountDeletion));
var bankAccountList = {};
/* 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.defineProperty(bankAccountList, "__esModule", { value: true });
bankAccountList.BankAccountList = void 0;
/**
*
* @export
* @class BankAccountList
*/
var BankAccountList = /** @class */ (function () {
function BankAccountList(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;
}
}
Object.defineProperty(BankAccountList.prototype, "nextPageToken", {
get: function () {
var _a;
if (!this.next_url) {
return undefined;
}
return (_a = this.next_url
.split("?")[1]
.split("&")
.find(function (raw) { return raw.includes("after="); })) === null || _a === void 0 ? void 0 : _a.split("=")[1];
},
enumerable: false,
configurable: true
});
Object.defineProperty(BankAccountList.prototype, "previousPageToken", {
get: function () {
var _a;
if (!this.previous_url) {
return undefined;
}
return (_a = this.previous_url
.split("?")[1]
.split("&")
.find(function (raw) { return raw.includes("before="); })) === null || _a === void 0 ? void 0 : _a.split("=")[1];
},
enumerable: false,
configurable: true
});
BankAccountList.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return BankAccountList;
}());
bankAccountList.BankAccountList = BankAccountList;
var bankAccountVerify = {};
/* 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.defineProperty(bankAccountVerify, "__esModule", { value: true });
bankAccountVerify.BankAccountVerify = void 0;
/**
*
* @export
* @class BankAccountVerify
*/
var BankAccountVerify = /** @class */ (function () {
function BankAccountVerify(input) {
if (typeof (input === null || input === void 0 ? void 0 : input.amounts) !== "undefined") {
this.amounts = input.amounts;
}
}
BankAccountVerify.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return BankAccountVerify;
}());
bankAccountVerify.BankAccountVerify = BankAccountVerify;
var bankAccountWritable = {};
/* 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.defineProperty(bankAccountWritable, "__esModule", { value: true });
bankAccountWritable.BankAccountWritable = void 0;
/**
*
* @export
* @class BankAccountWritable
*/
var BankAccountWritable = /** @class */ (function () {
function BankAccountWritable(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;
}
}
BankAccountWritable.prototype.toJSON = function () {
var _a;
var out = {};
for (var _i = 0, _b = Object.entries(this); _i < _b.length; _i++) {
var _c = _b[_i], key = _c[0], value = _c[1];
out = Object.assign({}, out, (_a = {},
_a[key[0] === "_" ? key.substr(1, key.length) : key] = value,
_a));
}
return out;
};
return BankAccountWritable;
}());
bankAccountWritable.BankAccountWritable = BankAccountWritable;
var bankTypeEnum = {};
(function (exports) {
/* 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.defineProperty(exports, "__esModule", { value: true });
exports.BankTypeEnum = void 0;
(function (BankTypeEnum) {
BankTypeEnum["Company"] = "company";
BankTypeEnum["Individual"] = "individual";
})(exports.BankTypeEnum || (exports.BankTypeEnum = {}));
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
}(bankTypeEnum));
var billingGroup = {};
(function (exports) {
/* tslint:disable */
/* eslint-disable */
/**
* Lob
* The Lob API is organized around REST. Our API is d