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/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('v3');
    
    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'],
      });
    
      // 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.drives.hide({
        // The ID of the shared drive.
        driveId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "backgroundImageFile": {},
      //   "backgroundImageLink": "my_backgroundImageLink",
      //   "capabilities": {},
      //   "colorRgb": "my_colorRgb",
      //   "createdTime": "my_createdTime",
      //   "hidden": false,
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "restrictions": {},
      //   "themeId": "my_themeId"
      // }
    }
    
    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'],
      });
    
      // 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.drives.hide({
        // The ID of the shared drive.
        driveId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "backgroundImageFile": {},
      //   "backgroundImageLink": "my_backgroundImageLink",
      //   "capabilities": {},
      //   "colorRgb": "my_colorRgb",
      //   "createdDate": "my_createdDate",
      //   "hidden": false,
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "restrictions": {},
      //   "themeId": "my_themeId"
      // }
    }
    
    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'],
      });
    
      // 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.drives.unhide({
        // The ID of the shared drive.
        driveId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "backgroundImageFile": {},
      //   "backgroundImageLink": "my_backgroundImageLink",
      //   "capabilities": {},
      //   "colorRgb": "my_colorRgb",
      //   "createdDate": "my_createdDate",
      //   "hidden": false,
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "restrictions": {},
      //   "themeId": "my_themeId"
      // }
    }
    
    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('v3');
    
    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'],
      });
    
      // 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.drives.unhide({
        // The ID of the shared drive.
        driveId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "backgroundImageFile": {},
      //   "backgroundImageLink": "my_backgroundImageLink",
      //   "capabilities": {},
      //   "colorRgb": "my_colorRgb",
      //   "createdTime": "my_createdTime",
      //   "hidden": false,
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "restrictions": {},
      //   "themeId": "my_themeId"
      // }
    }
    
    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('v3');
    
    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.readonly',
        ],
      });
    
      // 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.drives.list({
        // Maximum number of shared drives to return per page.
        pageSize: 'placeholder-value',
        // Page token for shared drives.
        pageToken: 'placeholder-value',
        // Query string for searching shared drives.
        q: 'placeholder-value',
        // Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned.
        useDomainAdminAccess: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "drives": [],
      //   "kind": "my_kind",
      //   "nextPageToken": "my_nextPageToken"
      // }
    }
    
    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