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.regionalinventory.insert({
        // The ID of the account that contains the product. This account cannot be a multi-client account.
        merchantId: 'placeholder-value',
        // The REST ID of the product for which to update the regional inventory.
        productId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "availability": "my_availability",
          //   "customAttributes": [],
          //   "kind": "my_kind",
          //   "price": {},
          //   "regionId": "my_regionId",
          //   "salePrice": {},
          //   "salePriceEffectiveDate": "my_salePriceEffectiveDate"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "availability": "my_availability",
      //   "customAttributes": [],
      //   "kind": "my_kind",
      //   "price": {},
      //   "regionId": "my_regionId",
      //   "salePrice": {},
      //   "salePriceEffectiveDate": "my_salePriceEffectiveDate"
      // }
    }
    
    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.localinventory.insert({
        // The ID of the account that contains the product. This account cannot be a multi-client account.
        merchantId: 'placeholder-value',
        // The REST ID of the product for which to update local inventory.
        productId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "availability": "my_availability",
          //   "instoreProductLocation": "my_instoreProductLocation",
          //   "kind": "my_kind",
          //   "pickupMethod": "my_pickupMethod",
          //   "pickupSla": "my_pickupSla",
          //   "price": {},
          //   "quantity": 0,
          //   "salePrice": {},
          //   "salePriceEffectiveDate": "my_salePriceEffectiveDate",
          //   "storeCode": "my_storeCode"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "availability": "my_availability",
      //   "instoreProductLocation": "my_instoreProductLocation",
      //   "kind": "my_kind",
      //   "pickupMethod": "my_pickupMethod",
      //   "pickupSla": "my_pickupSla",
      //   "price": {},
      //   "quantity": 0,
      //   "salePrice": {},
      //   "salePriceEffectiveDate": "my_salePriceEffectiveDate",
      //   "storeCode": "my_storeCode"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.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/adsensehost'],
      });
    
      // 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 adsensehost.accounts.adunits.insert({
        // Account which will contain the ad unit.
        accountId: 'placeholder-value',
        // Ad client into which to insert the ad unit.
        adClientId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "code": "my_code",
          //   "contentAdsSettings": {},
          //   "customStyle": {},
          //   "id": "my_id",
          //   "kind": "my_kind",
          //   "mobileContentAdsSettings": {},
          //   "name": "my_name",
          //   "status": "my_status"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "code": "my_code",
      //   "contentAdsSettings": {},
      //   "customStyle": {},
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "mobileContentAdsSettings": {},
      //   "name": "my_name",
      //   "status": "my_status"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2');
    
    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/drive',
          'https://www.googleapis.com/auth/drive.file',
        ],
      });
    
      // 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 drive.replies.insert({
        // The ID of the comment.
        commentId: 'placeholder-value',
        // The ID of the file.
        fileId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "author": {},
          //   "content": "my_content",
          //   "createdDate": "my_createdDate",
          //   "deleted": false,
          //   "htmlContent": "my_htmlContent",
          //   "kind": "my_kind",
          //   "modifiedDate": "my_modifiedDate",
          //   "replyId": "my_replyId",
          //   "verb": "my_verb"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "author": {},
      //   "content": "my_content",
      //   "createdDate": "my_createdDate",
      //   "deleted": false,
      //   "htmlContent": "my_htmlContent",
      //   "kind": "my_kind",
      //   "modifiedDate": "my_modifiedDate",
      //   "replyId": "my_replyId",
      //   "verb": "my_verb"
      // }
    }
    
    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');
    
    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.accounts.insert({
        // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).
        dryRun: 'placeholder-value',
        // The ID of the managing account. This must be a multi-client account.
        merchantId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "adultContent": false,
          //   "adwordsLinks": [],
          //   "businessInformation": {},
          //   "googleMyBusinessLink": {},
          //   "id": "my_id",
          //   "kind": "my_kind",
          //   "name": "my_name",
          //   "reviewsUrl": "my_reviewsUrl",
          //   "sellerId": "my_sellerId",
          //   "users": [],
          //   "websiteUrl": "my_websiteUrl",
          //   "youtubeChannelLinks": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "adultContent": false,
      //   "adwordsLinks": [],
      //   "businessInformation": {},
      //   "googleMyBusinessLink": {},
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "reviewsUrl": "my_reviewsUrl",
      //   "sellerId": "my_sellerId",
      //   "users": [],
      //   "websiteUrl": "my_websiteUrl",
      //   "youtubeChannelLinks": []
      // }
    }
    
    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