How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • // 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.create({
        // Required. The id of the merchant who owns the repricing rule.
        merchantId: 'placeholder-value',
        // Required. The id of the rule to create.
        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;
    });
    
    Docs
  • // 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.repricingreports.list({
        // Gets Repricing reports on and before this date in the merchant's timezone. You can only retrieve data up to 7 days ago (default) or earlier. Format: YYYY-MM-DD.
        endDate: 'placeholder-value',
        // Required. Id of the merchant who owns the Repricing rule.
        merchantId: 'placeholder-value',
        // Maximum number of daily reports to return. Each report includes data from a single 24-hour period. The page size defaults to 50 and values above 1000 are coerced to 1000. This service may return fewer days than this value, for example, if the time between your start and end date is less than page size.
        pageSize: 'placeholder-value',
        // Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token.
        pageToken: 'placeholder-value',
        // Required. Id of the Repricing rule.
        ruleId: 'placeholder-value',
        // Gets Repricing reports on and after this date in the merchant's timezone, up to one year ago. Do not use a start date later than 7 days ago (default). Format: YYYY-MM-DD.
        startDate: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "nextPageToken": "my_nextPageToken",
      //   "repricingRuleReports": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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;
    });
    
    Docs
  • // 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.ordertrackingsignals.create({
        // The ID of the merchant for which the order signal is created.
        merchantId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "customerShippingFee": {},
          //   "deliveryPostalCode": "my_deliveryPostalCode",
          //   "deliveryRegionCode": "my_deliveryRegionCode",
          //   "lineItems": [],
          //   "merchantId": "my_merchantId",
          //   "orderCreatedTime": {},
          //   "orderId": "my_orderId",
          //   "orderTrackingSignalId": "my_orderTrackingSignalId",
          //   "shipmentLineItemMapping": [],
          //   "shippingInfo": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "customerShippingFee": {},
      //   "deliveryPostalCode": "my_deliveryPostalCode",
      //   "deliveryRegionCode": "my_deliveryRegionCode",
      //   "lineItems": [],
      //   "merchantId": "my_merchantId",
      //   "orderCreatedTime": {},
      //   "orderId": "my_orderId",
      //   "orderTrackingSignalId": "my_orderTrackingSignalId",
      //   "shipmentLineItemMapping": [],
      //   "shippingInfo": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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.regions.create({
        // Required. The id of the merchant for which to create region definition.
        merchantId: 'placeholder-value',
        // Required. The id of the region to create.
        regionId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "displayName": "my_displayName",
          //   "geotargetArea": {},
          //   "merchantId": "my_merchantId",
          //   "postalCodeArea": {},
          //   "regionId": "my_regionId",
          //   "regionalInventoryEligible": false,
          //   "shippingEligible": false
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "displayName": "my_displayName",
      //   "geotargetArea": {},
      //   "merchantId": "my_merchantId",
      //   "postalCodeArea": {},
      //   "regionId": "my_regionId",
      //   "regionalInventoryEligible": false,
      //   "shippingEligible": false
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples