// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.repricingrules.delete({
// Required. The id of the merchant who owns the repricing rule.
merchantId: 'placeholder-value',
// Required. The id of the rule to Delete.
ruleId: 'placeholder-value',
});
console.log(res.data);
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.repricingrules.list({
// [CLDR country code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) (e.g. "US"), used as a filter on repricing rules.
countryCode: 'placeholder-value',
// The two-letter ISO 639-1 language code associated with the repricing rule, used as a filter.
languageCode: 'placeholder-value',
// Required. The id of the merchant who owns the repricing rule.
merchantId: 'placeholder-value',
// The maximum number of repricing rules to return. The service may return fewer than this value. If unspecified, at most 50 rules will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
pageSize: 'placeholder-value',
// A page token, received from a previous `ListRepricingRules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListRepricingRules` must match the call that provided the page token.
pageToken: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "nextPageToken": "my_nextPageToken",
// "repricingRules": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.returnpolicy.delete({
// The Merchant Center account from which to delete the given return policy.
merchantId: 'placeholder-value',
// Return policy ID generated by Google.
returnPolicyId: 'placeholder-value',
});
console.log(res.data);
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.returnpolicyonline.delete({
// Required. The id of the merchant for which to retrieve the return policy online object.
merchantId: 'placeholder-value',
// Required. The id of the return policy to delete.
returnPolicyId: 'placeholder-value',
});
console.log(res.data);
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.repricingrules.patch({
// Required. The id of the merchant who owns the repricing rule.
merchantId: 'placeholder-value',
// Required. The id of the rule to update.
ruleId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "cogsBasedRule": {},
// "countryCode": "my_countryCode",
// "effectiveTimePeriod": {},
// "eligibleOfferMatcher": {},
// "languageCode": "my_languageCode",
// "merchantId": "my_merchantId",
// "paused": false,
// "restriction": {},
// "ruleId": "my_ruleId",
// "statsBasedRule": {},
// "title": "my_title",
// "type": "my_type"
// }
},
});
console.log(res.data);
// Example response
// {
// "cogsBasedRule": {},
// "countryCode": "my_countryCode",
// "effectiveTimePeriod": {},
// "eligibleOfferMatcher": {},
// "languageCode": "my_languageCode",
// "merchantId": "my_merchantId",
// "paused": false,
// "restriction": {},
// "ruleId": "my_ruleId",
// "statsBasedRule": {},
// "title": "my_title",
// "type": "my_type"
// }
}
main().catch(e => {
console.error(e);
throw e;
});