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('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.appdata',
          '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.files.generateIds({
        // Maximum number of IDs to return.
        maxResults: 'placeholder-value',
        // The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. (Default: 'drive')
        space: 'placeholder-value',
        // The type of items which the IDs can be used for. Supported values are 'files' and 'shortcuts'. Note that 'shortcuts' are only supported in the drive 'space'. (Default: 'files')
        type: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "ids": [],
      //   "kind": "my_kind",
      //   "space": "my_space"
      // }
    }
    
    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.appdata',
          'https://www.googleapis.com/auth/drive.apps.readonly',
          'https://www.googleapis.com/auth/drive.file',
          'https://www.googleapis.com/auth/drive.metadata',
          'https://www.googleapis.com/auth/drive.metadata.readonly',
          'https://www.googleapis.com/auth/drive.photos.readonly',
          '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.files.list({
        // Groupings of files to which the query applies. Supported groupings are: 'user' (files created by, opened by, or shared directly with the user), 'drive' (files in the specified shared drive as indicated by the 'driveId'), 'domain' (files shared to the user's domain), and 'allDrives' (A combination of 'user' and 'drive' for all drives where the user is a member). When able, use 'user' or 'drive', instead of 'allDrives', for efficiency.
        corpora: 'placeholder-value',
        // The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead.
        corpus: 'placeholder-value',
        // ID of the shared drive to search.
        driveId: 'placeholder-value',
        // Whether both My Drive and shared drive items should be included in results.
        includeItemsFromAllDrives: 'placeholder-value',
        // Specifies which additional view's permissions to include in the response. Only 'published' is supported.
        includePermissionsForView: 'placeholder-value',
        // Deprecated use includeItemsFromAllDrives instead.
        includeTeamDriveItems: 'placeholder-value',
        // The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached.
        maxResults: 'placeholder-value',
        // A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.
        orderBy: 'placeholder-value',
        // Page token for files.
        pageToken: 'placeholder-value',
        // This parameter is deprecated and has no function.
        projection: 'placeholder-value',
        // Query string for searching files.
        q: 'placeholder-value',
        // A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'.
        spaces: 'placeholder-value',
        // Whether the requesting application supports both My Drives and shared drives.
        supportsAllDrives: 'placeholder-value',
        // Deprecated use supportsAllDrives instead.
        supportsTeamDrives: 'placeholder-value',
        // Deprecated use driveId instead.
        teamDriveId: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "etag": "my_etag",
      //   "incompleteSearch": false,
      //   "items": [],
      //   "kind": "my_kind",
      //   "nextLink": "my_nextLink",
      //   "nextPageToken": "my_nextPageToken",
      //   "selfLink": "my_selfLink"
      // }
    }
    
    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