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/eventarc.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 eventarc = google.eventarc('v1');
    
    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/cloud-platform'],
      });
    
      // 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 eventarc.projects.locations.channels.testIamPermissions({
        // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
        resource: 'projects/my-project/locations/my-location/channels/my-channel',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "permissions": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "permissions": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/networkconnectivity.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 networkconnectivity = google.networkconnectivity('v1alpha1');
    
    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/cloud-platform'],
      });
    
      // 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 networkconnectivity.projects.locations.spokes.testIamPermissions({
          // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
          resource: 'projects/my-project/locations/my-location/spokes/my-spoke',
    
          // Request body metadata
          requestBody: {
            // request body parameters
            // {
            //   "permissions": []
            // }
          },
        });
      console.log(res.data);
    
      // Example response
      // {
      //   "permissions": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/notebooks.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 notebooks = google.notebooks('v1');
    
    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/cloud-platform'],
      });
    
      // 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 notebooks.projects.locations.instances.testIamPermissions({
        // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
        resource: 'projects/my-project/locations/my-location/instances/my-instance',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "permissions": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "permissions": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/metastore.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 metastore = google.metastore('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/cloud-platform'],
      });
    
      // 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 metastore.projects.locations.services.testIamPermissions({
        // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
        resource: 'projects/my-project/locations/my-location/services/my-service',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "permissions": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "permissions": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/metastore.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 metastore = google.metastore('v1beta');
    
    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/cloud-platform'],
      });
    
      // 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 metastore.projects.locations.services.testIamPermissions({
        // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
        resource: 'projects/my-project/locations/my-location/services/my-service',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "permissions": []
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "permissions": []
      // }
    }
    
    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