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.pubsubnotificationsettings.get({
        // The ID of the account for which to get pubsub notification settings.
        merchantId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "cloudTopicName": "my_cloudTopicName",
      //   "kind": "my_kind",
      //   "registeredEvents": []
      // }
    }
    
    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.pubsubnotificationsettings.update({
        // The ID of the account.
        merchantId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "cloudTopicName": "my_cloudTopicName",
          //   "kind": "my_kind",
          //   "registeredEvents": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "cloudTopicName": "my_cloudTopicName",
      //   "kind": "my_kind",
      //   "registeredEvents": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/analyticsadmin.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 analyticsadmin = google.analyticsadmin('v1alpha');
    
    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/analytics.edit'],
      });
    
      // 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 analyticsadmin.properties.updateGoogleSignalsSettings({
        // Output only. Resource name of this setting. Format: properties/{property_id\}/googleSignalsSettings Example: "properties/1000/googleSignalsSettings"
        name: 'properties/my-propertie/googleSignalsSettings',
        // Required. The list of fields to be updated. Field names must be in snake case (e.g., "field_to_update"). Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.
        updateMask: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "consent": "my_consent",
          //   "name": "my_name",
          //   "state": "my_state"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "consent": "my_consent",
      //   "name": "my_name",
      //   "state": "my_state"
      // }
    }
    
    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.shippingsettings.update({
        // The ID of the account for which to get/update shipping settings.
        accountId: 'placeholder-value',
        // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account.
        merchantId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "accountId": "my_accountId",
          //   "postalCodeGroups": [],
          //   "services": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "accountId": "my_accountId",
      //   "postalCodeGroups": [],
      //   "services": []
      // }
    }
    
    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.shippingsettings.update({
        // The ID of the account for which to get/update shipping settings.
        accountId: 'placeholder-value',
        // 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. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account.
        merchantId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "accountId": "my_accountId",
          //   "postalCodeGroups": [],
          //   "services": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "accountId": "my_accountId",
      //   "postalCodeGroups": [],
      //   "services": []
      // }
    }
    
    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