@paciolan/cybersource-sdk
Version:
CyberSource REST API Typescript SDK
557 lines • 52.6 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerShippingAddressApi = exports.CustomerShippingAddressApiFactory = exports.CustomerShippingAddressApiFp = exports.CustomerShippingAddressApiAxiosParamCreator = void 0;
/* tslint:disable */
/* eslint-disable */
/**
* CyberSource Merged Spec
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
*
* OpenAPI spec version: 0.0.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
const axios_1 = __importDefault(require("axios"));
const AuthenticationHeader_1 = require("../authentication/core/AuthenticationHeader");
// Some imports not used depending on template conditions
// @ts-ignore
const base_1 = require("../base");
/**
* CustomerShippingAddressApi - axios parameter creator
* @export
*/
const CustomerShippingAddressApiAxiosParamCreator = function (configuration) {
return {
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Deleting a Customers Shipping Address**<br>Your system can use this API to delete an existing Shipping Address for a Customer.<br>If a customer has more than one Shipping Address then the default Shipping Address cannot be deleted without first selecting a [new default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body).
* @summary Delete a Customer Shipping Address
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteCustomerShippingAddress: (customerId, shippingAddressId, profileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'customerId' is not null or undefined
if (customerId === null || customerId === undefined) {
throw new base_1.RequiredError('customerId', 'Required parameter customerId was null or undefined when calling deleteCustomerShippingAddress.');
}
// verify required parameter 'shippingAddressId' is not null or undefined
if (shippingAddressId === null || shippingAddressId === undefined) {
throw new base_1.RequiredError('shippingAddressId', 'Required parameter shippingAddressId was null or undefined when calling deleteCustomerShippingAddress.');
}
const localVarPath = `/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}`
.replace(`{${"customerId"}}`, encodeURIComponent(String(customerId)))
.replace(`{${"shippingAddressId"}}`, encodeURIComponent(String(shippingAddressId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Retrieving a Customer Shipping Address**<br>Your system can use this API to retrieve an existing Shipping Address for a Customer.<br>To perform a payment with a particular Shipping Address simply specify the [Shipping Address Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Retrieve a Customer Shipping Address
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCustomerShippingAddress: (customerId, shippingAddressId, profileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'customerId' is not null or undefined
if (customerId === null || customerId === undefined) {
throw new base_1.RequiredError('customerId', 'Required parameter customerId was null or undefined when calling getCustomerShippingAddress.');
}
// verify required parameter 'shippingAddressId' is not null or undefined
if (shippingAddressId === null || shippingAddressId === undefined) {
throw new base_1.RequiredError('shippingAddressId', 'Required parameter shippingAddressId was null or undefined when calling getCustomerShippingAddress.');
}
const localVarPath = `/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}`
.replace(`{${"customerId"}}`, encodeURIComponent(String(customerId)))
.replace(`{${"shippingAddressId"}}`, encodeURIComponent(String(shippingAddressId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Retrieving all Customer Shipping Addresses**<br>Your system can use this API to retrieve all existing Shipping Addresses for a Customer.
* @summary List Shipping Addresses for a Customer
* @param {string} customerId The Id of a Customer.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {number} [offset] Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0.
* @param {number} [limit] The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCustomerShippingAddressesList: (customerId, profileId, offset, limit, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'customerId' is not null or undefined
if (customerId === null || customerId === undefined) {
throw new base_1.RequiredError('customerId', 'Required parameter customerId was null or undefined when calling getCustomerShippingAddressesList.');
}
const localVarPath = `/tms/v2/customers/{customerId}/shipping-addresses`
.replace(`{${"customerId"}}`, encodeURIComponent(String(customerId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (offset !== undefined) {
localVarQueryParameter['offset'] = offset;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Updating a Customers Shipping Address**<br>Your system can use this API to update an existing Shipping Addresses for a Customer, including selecting a [default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body) for use in payments.
* @summary Update a Customer Shipping Address
* @param {ShippingaddressesShippingAddressIdBody} body
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {string} [ifMatch] Contains an ETag value from a GET request to make the request conditional.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchCustomersShippingAddress: (body, customerId, shippingAddressId, profileId, ifMatch, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling patchCustomersShippingAddress.');
}
// verify required parameter 'customerId' is not null or undefined
if (customerId === null || customerId === undefined) {
throw new base_1.RequiredError('customerId', 'Required parameter customerId was null or undefined when calling patchCustomersShippingAddress.');
}
// verify required parameter 'shippingAddressId' is not null or undefined
if (shippingAddressId === null || shippingAddressId === undefined) {
throw new base_1.RequiredError('shippingAddressId', 'Required parameter shippingAddressId was null or undefined when calling patchCustomersShippingAddress.');
}
const localVarPath = `/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}`
.replace(`{${"customerId"}}`, encodeURIComponent(String(customerId)))
.replace(`{${"shippingAddressId"}}`, encodeURIComponent(String(shippingAddressId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
if (ifMatch !== undefined && ifMatch !== null) {
localVarHeaderParameter['if-match'] = String(ifMatch);
}
localVarHeaderParameter['Content-Type'] = 'application/json;charset=utf-8';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Creating a Customer Shipping Address**<br>Your system can use this API to create an existing Customers default or non default Shipping Address.<br>You can also create additional Customer Shipping Addresses via the [Payments API](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-create-default-payment-instrument-shipping-address-for-existing-customer_liveconsole-tab-request-body).
* @summary Create a Customer Shipping Address
* @param {CustomerIdShippingaddressesBody} body
* @param {string} customerId The Id of a Customer.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postCustomerShippingAddress: (body, customerId, profileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling postCustomerShippingAddress.');
}
// verify required parameter 'customerId' is not null or undefined
if (customerId === null || customerId === undefined) {
throw new base_1.RequiredError('customerId', 'Required parameter customerId was null or undefined when calling postCustomerShippingAddress.');
}
const localVarPath = `/tms/v2/customers/{customerId}/shipping-addresses`
.replace(`{${"customerId"}}`, encodeURIComponent(String(customerId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
localVarHeaderParameter['Content-Type'] = 'application/json;charset=utf-8';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
};
};
exports.CustomerShippingAddressApiAxiosParamCreator = CustomerShippingAddressApiAxiosParamCreator;
/**
* CustomerShippingAddressApi - functional programming interface
* @export
*/
const CustomerShippingAddressApiFp = function (configuration) {
return {
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Deleting a Customers Shipping Address**<br>Your system can use this API to delete an existing Shipping Address for a Customer.<br>If a customer has more than one Shipping Address then the default Shipping Address cannot be deleted without first selecting a [new default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body).
* @summary Delete a Customer Shipping Address
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteCustomerShippingAddress(customerId, shippingAddressId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.CustomerShippingAddressApiAxiosParamCreator)(configuration).deleteCustomerShippingAddress(customerId, shippingAddressId, profileId, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Retrieving a Customer Shipping Address**<br>Your system can use this API to retrieve an existing Shipping Address for a Customer.<br>To perform a payment with a particular Shipping Address simply specify the [Shipping Address Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Retrieve a Customer Shipping Address
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCustomerShippingAddress(customerId, shippingAddressId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.CustomerShippingAddressApiAxiosParamCreator)(configuration).getCustomerShippingAddress(customerId, shippingAddressId, profileId, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Retrieving all Customer Shipping Addresses**<br>Your system can use this API to retrieve all existing Shipping Addresses for a Customer.
* @summary List Shipping Addresses for a Customer
* @param {string} customerId The Id of a Customer.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {number} [offset] Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0.
* @param {number} [limit] The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCustomerShippingAddressesList(customerId, profileId, offset, limit, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.CustomerShippingAddressApiAxiosParamCreator)(configuration).getCustomerShippingAddressesList(customerId, profileId, offset, limit, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Updating a Customers Shipping Address**<br>Your system can use this API to update an existing Shipping Addresses for a Customer, including selecting a [default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body) for use in payments.
* @summary Update a Customer Shipping Address
* @param {ShippingaddressesShippingAddressIdBody} body
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {string} [ifMatch] Contains an ETag value from a GET request to make the request conditional.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchCustomersShippingAddress(body, customerId, shippingAddressId, profileId, ifMatch, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.CustomerShippingAddressApiAxiosParamCreator)(configuration).patchCustomersShippingAddress(body, customerId, shippingAddressId, profileId, ifMatch, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Creating a Customer Shipping Address**<br>Your system can use this API to create an existing Customers default or non default Shipping Address.<br>You can also create additional Customer Shipping Addresses via the [Payments API](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-create-default-payment-instrument-shipping-address-for-existing-customer_liveconsole-tab-request-body).
* @summary Create a Customer Shipping Address
* @param {CustomerIdShippingaddressesBody} body
* @param {string} customerId The Id of a Customer.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postCustomerShippingAddress(body, customerId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.CustomerShippingAddressApiAxiosParamCreator)(configuration).postCustomerShippingAddress(body, customerId, profileId, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
};
};
exports.CustomerShippingAddressApiFp = CustomerShippingAddressApiFp;
/**
* CustomerShippingAddressApi - factory interface
* @export
*/
const CustomerShippingAddressApiFactory = function (configuration, basePath, axios) {
return {
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Deleting a Customers Shipping Address**<br>Your system can use this API to delete an existing Shipping Address for a Customer.<br>If a customer has more than one Shipping Address then the default Shipping Address cannot be deleted without first selecting a [new default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body).
* @summary Delete a Customer Shipping Address
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteCustomerShippingAddress(customerId, shippingAddressId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.CustomerShippingAddressApiFp)(configuration).deleteCustomerShippingAddress(customerId, shippingAddressId, profileId, options).then((request) => request(axios, basePath));
});
},
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Retrieving a Customer Shipping Address**<br>Your system can use this API to retrieve an existing Shipping Address for a Customer.<br>To perform a payment with a particular Shipping Address simply specify the [Shipping Address Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Retrieve a Customer Shipping Address
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCustomerShippingAddress(customerId, shippingAddressId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.CustomerShippingAddressApiFp)(configuration).getCustomerShippingAddress(customerId, shippingAddressId, profileId, options).then((request) => request(axios, basePath));
});
},
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Retrieving all Customer Shipping Addresses**<br>Your system can use this API to retrieve all existing Shipping Addresses for a Customer.
* @summary List Shipping Addresses for a Customer
* @param {string} customerId The Id of a Customer.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {number} [offset] Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0.
* @param {number} [limit] The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCustomerShippingAddressesList(customerId, profileId, offset, limit, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.CustomerShippingAddressApiFp)(configuration).getCustomerShippingAddressesList(customerId, profileId, offset, limit, options).then((request) => request(axios, basePath));
});
},
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Updating a Customers Shipping Address**<br>Your system can use this API to update an existing Shipping Addresses for a Customer, including selecting a [default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body) for use in payments.
* @summary Update a Customer Shipping Address
* @param {ShippingaddressesShippingAddressIdBody} body
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {string} [ifMatch] Contains an ETag value from a GET request to make the request conditional.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchCustomersShippingAddress(body, customerId, shippingAddressId, profileId, ifMatch, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.CustomerShippingAddressApiFp)(configuration).patchCustomersShippingAddress(body, customerId, shippingAddressId, profileId, ifMatch, options).then((request) => request(axios, basePath));
});
},
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Creating a Customer Shipping Address**<br>Your system can use this API to create an existing Customers default or non default Shipping Address.<br>You can also create additional Customer Shipping Addresses via the [Payments API](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-create-default-payment-instrument-shipping-address-for-existing-customer_liveconsole-tab-request-body).
* @summary Create a Customer Shipping Address
* @param {CustomerIdShippingaddressesBody} body
* @param {string} customerId The Id of a Customer.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postCustomerShippingAddress(body, customerId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.CustomerShippingAddressApiFp)(configuration).postCustomerShippingAddress(body, customerId, profileId, options).then((request) => request(axios, basePath));
});
},
};
};
exports.CustomerShippingAddressApiFactory = CustomerShippingAddressApiFactory;
/**
* CustomerShippingAddressApi - object-oriented interface
* @export
* @class CustomerShippingAddressApi
* @extends {BaseAPI}
*/
class CustomerShippingAddressApi extends base_1.BaseAPI {
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Deleting a Customers Shipping Address**<br>Your system can use this API to delete an existing Shipping Address for a Customer.<br>If a customer has more than one Shipping Address then the default Shipping Address cannot be deleted without first selecting a [new default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body).
* @summary Delete a Customer Shipping Address
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CustomerShippingAddressApi
*/
deleteCustomerShippingAddress(customerId, shippingAddressId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.CustomerShippingAddressApiFp)(this.configuration).deleteCustomerShippingAddress(customerId, shippingAddressId, profileId, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Retrieving a Customer Shipping Address**<br>Your system can use this API to retrieve an existing Shipping Address for a Customer.<br>To perform a payment with a particular Shipping Address simply specify the [Shipping Address Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Retrieve a Customer Shipping Address
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CustomerShippingAddressApi
*/
getCustomerShippingAddress(customerId, shippingAddressId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.CustomerShippingAddressApiFp)(this.configuration).getCustomerShippingAddress(customerId, shippingAddressId, profileId, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Retrieving all Customer Shipping Addresses**<br>Your system can use this API to retrieve all existing Shipping Addresses for a Customer.
* @summary List Shipping Addresses for a Customer
* @param {string} customerId The Id of a Customer.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {number} [offset] Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0.
* @param {number} [limit] The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CustomerShippingAddressApi
*/
getCustomerShippingAddressesList(customerId, profileId, offset, limit, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.CustomerShippingAddressApiFp)(this.configuration).getCustomerShippingAddressesList(customerId, profileId, offset, limit, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* | | | | | --- | --- | --- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.| |**Updating a Customers Shipping Address**<br>Your system can use this API to update an existing Shipping Addresses for a Customer, including selecting a [default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body) for use in payments.
* @summary Update a Customer Shipping Address
* @param {ShippingaddressesShippingAddressIdBody} body
* @param {string} customerId The Id of a Customer.
* @param {string} shippingAddressId The Id of a shipping address.
* @param {string} [profileId] The Id