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('v1beta1');
    
    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.triggers.get({
        // Required. The name of the trigger to get.
        name: 'projects/my-project/locations/my-location/triggers/my-trigger',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "createTime": "my_createTime",
      //   "destination": {},
      //   "etag": "my_etag",
      //   "labels": {},
      //   "matchingCriteria": [],
      //   "name": "my_name",
      //   "serviceAccount": "my_serviceAccount",
      //   "transport": {},
      //   "updateTime": "my_updateTime"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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.triggers.setIamPolicy({
        // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
        resource: 'projects/my-project/locations/my-location/triggers/my-trigger',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "policy": {},
          //   "updateMask": "my_updateMask"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "auditConfigs": [],
      //   "bindings": [],
      //   "etag": "my_etag",
      //   "version": 0
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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('v1beta1');
    
    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.triggers.create({
        // Required. The parent collection in which to add this trigger.
        parent: 'projects/my-project/locations/my-location',
        // Required. The user-provided ID to be assigned to the trigger.
        triggerId: 'placeholder-value',
        // Required. If set, validate the request and preview the review, but do not actually post it.
        validateOnly: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "createTime": "my_createTime",
          //   "destination": {},
          //   "etag": "my_etag",
          //   "labels": {},
          //   "matchingCriteria": [],
          //   "name": "my_name",
          //   "serviceAccount": "my_serviceAccount",
          //   "transport": {},
          //   "updateTime": "my_updateTime"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "done": false,
      //   "error": {},
      //   "metadata": {},
      //   "name": "my_name",
      //   "response": {}
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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.triggers.create({
        // Required. The parent collection in which to add this trigger.
        parent: 'projects/my-project/locations/my-location',
        // Required. The user-provided ID to be assigned to the trigger.
        triggerId: 'placeholder-value',
        // Required. If set, validate the request and preview the review, but do not actually post it.
        validateOnly: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "createTime": "my_createTime",
          //   "destination": {},
          //   "etag": "my_etag",
          //   "eventFilters": [],
          //   "labels": {},
          //   "name": "my_name",
          //   "serviceAccount": "my_serviceAccount",
          //   "transport": {},
          //   "uid": "my_uid",
          //   "updateTime": "my_updateTime"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "done": false,
      //   "error": {},
      //   "metadata": {},
      //   "name": "my_name",
      //   "response": {}
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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('v1beta1');
    
    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.triggers.delete({
        // If set to true, and the trigger is not found, the request will succeed but no action will be taken on the server.
        allowMissing: 'placeholder-value',
        // If provided, the trigger will only be deleted if the etag matches the current etag on the resource.
        etag: 'placeholder-value',
        // Required. The name of the trigger to be deleted.
        name: 'projects/my-project/locations/my-location/triggers/my-trigger',
        // Required. If set, validate the request and preview the review, but do not actually post it.
        validateOnly: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "done": false,
      //   "error": {},
      //   "metadata": {},
      //   "name": "my_name",
      //   "response": {}
      // }
    }
    
    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