googleapis
Version:
Google APIs Client Library for Node.js
662 lines • 23.5 kB
JavaScript
;
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var apirequest_1 = require("../../lib/apirequest");
// TODO: We will eventually get the `any` in here cleared out, but in the
// interim we want to turn on no-implicit-any.
// tslint:disable: no-any
// tslint:disable: class-name
// tslint:disable: variable-name
// tslint:disable: jsdoc-format
/**
* Content API for Shopping
*
* Manages product items, inventory, and Merchant Center accounts for Google
* Shopping.
*
* @example
* const google = require('googleapis');
* const content = google.content('v2sandbox');
*
* @namespace content
* @type {Function}
* @version v2sandbox
* @variation v2sandbox
* @param {object=} options Options for Content
*/
var Content = /** @class */ (function () {
function Content(options, google) {
this.root = this;
this._options = options || {};
this.google = google;
this.getRoot.bind(this);
this.orders = new Resource$Orders(this);
}
Content.prototype.getRoot = function () {
return this.root;
};
return Content;
}());
exports.Content = Content;
var Resource$Orders = /** @class */ (function () {
function Resource$Orders(root) {
this.root = root;
this.getRoot.bind(this);
}
Resource$Orders.prototype.getRoot = function () {
return this.root;
};
Resource$Orders.prototype.acknowledge = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/acknowledge')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.advancetestorder = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/testorders/{orderId}/advance')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.cancel = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/cancel')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.cancellineitem = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/cancelLineItem')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.createtestorder = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl + '/content/v2sandbox/{merchantId}/testorders')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId'],
pathParams: ['merchantId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.custombatch = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl + '/content/v2sandbox/orders/batch')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: [],
pathParams: [],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.get = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl + '/content/v2sandbox/{merchantId}/orders/{orderId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.getbymerchantorderid = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/ordersbymerchantid/{merchantOrderId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['merchantId', 'merchantOrderId'],
pathParams: ['merchantId', 'merchantOrderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.gettestordertemplate = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/testordertemplates/{templateName}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['merchantId', 'templateName'],
pathParams: ['merchantId', 'templateName'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.instorerefundlineitem = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/inStoreRefundLineItem')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.list = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl + '/content/v2sandbox/{merchantId}/orders')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['merchantId'],
pathParams: ['merchantId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.refund = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/refund')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.rejectreturnlineitem = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/rejectReturnLineItem')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.returnlineitem = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/returnLineItem')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.returnrefundlineitem = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/returnRefundLineItem')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.setlineitemmetadata = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/setLineItemMetadata')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.shiplineitems = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/shipLineItems')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.updatelineitemshippingdetails = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/updateLineItemShippingDetails')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.updatemerchantorderid = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/updateMerchantOrderId')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
Resource$Orders.prototype.updateshipment = function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (typeof params === 'function') {
callback = params;
params = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/content/v2sandbox/{merchantId}/orders/{orderId}/updateShipment')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['merchantId', 'orderId'],
pathParams: ['merchantId', 'orderId'],
context: this.getRoot()
};
if (callback) {
apirequest_1.createAPIRequest(parameters, callback);
}
else {
return apirequest_1.createAPIRequest(parameters);
}
};
return Resource$Orders;
}());
exports.Resource$Orders = Resource$Orders;
//# sourceMappingURL=v2sandbox.js.map