Hierarchy

  • Resource$Drives

Constructors

Properties

Methods

Constructors

  • Parameters

    • context: APIRequestContext

    Returns Resource$Drives

Properties

context: APIRequestContext

Methods

  • Creates a new shared drive.

    Example

    // 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.create({
    // An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned.
    requestId: 'placeholder-value',

    // Request body metadata
    requestBody: {
    // request body parameters
    // {
    // "backgroundImageFile": {},
    // "backgroundImageLink": "my_backgroundImageLink",
    // "capabilities": {},
    // "colorRgb": "my_colorRgb",
    // "createdTime": "my_createdTime",
    // "hidden": false,
    // "id": "my_id",
    // "kind": "my_kind",
    // "name": "my_name",
    // "orgUnitId": "my_orgUnitId",
    // "restrictions": {},
    // "themeId": "my_themeId"
    // }
    },
    });
    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",
    // "orgUnitId": "my_orgUnitId",
    // "restrictions": {},
    // "themeId": "my_themeId"
    // }
    }

    main().catch(e => {
    console.error(e);
    throw e;
    });

    Returns

    A promise if used with async/await, or void if used with a callback.

    Parameters

    Returns GaxiosPromise<Readable>

  • Parameters

    Returns GaxiosPromise<Schema$Drive>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.

    Example

    // 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.delete({
    // Whether any items inside the shared drive should also be deleted. This option is only supported when useDomainAdminAccess is also set to true.
    allowItemDeletion: 'placeholder-value',
    // The ID of the shared drive.
    driveId: 'placeholder-value',
    // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.
    useDomainAdminAccess: 'placeholder-value',
    });
    console.log(res.data);
    }

    main().catch(e => {
    console.error(e);
    throw e;
    });

    Returns

    A promise if used with async/await, or void if used with a callback.

    Parameters

    Returns GaxiosPromise<Readable>

  • Parameters

    Returns GaxiosPromise<void>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • callback: BodyResponseCallback<void>

    Returns void

  • Gets a shared drive's metadata by ID.

    Example

    // 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.get({
    // The ID of the shared drive.
    driveId: 'placeholder-value',
    // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.
    useDomainAdminAccess: '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",
    // "orgUnitId": "my_orgUnitId",
    // "restrictions": {},
    // "themeId": "my_themeId"
    // }
    }

    main().catch(e => {
    console.error(e);
    throw e;
    });

    Returns

    A promise if used with async/await, or void if used with a callback.

    Parameters

    Returns GaxiosPromise<Readable>

  • Parameters

    Returns GaxiosPromise<Schema$Drive>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Hides a shared drive from the default view.

    Example

    // 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",
    // "orgUnitId": "my_orgUnitId",
    // "restrictions": {},
    // "themeId": "my_themeId"
    // }
    }

    main().catch(e => {
    console.error(e);
    throw e;
    });

    Returns

    A promise if used with async/await, or void if used with a callback.

    Parameters

    Returns GaxiosPromise<Readable>

  • Parameters

    Returns GaxiosPromise<Schema$Drive>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Lists the user's shared drives.

    Example

    // 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;
    });

    Returns

    A promise if used with async/await, or void if used with a callback.

    Parameters

    Returns GaxiosPromise<Readable>

  • Parameters

    Returns GaxiosPromise<Schema$DriveList>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Restores a shared drive to the default view.

    Example

    // 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",
    // "orgUnitId": "my_orgUnitId",
    // "restrictions": {},
    // "themeId": "my_themeId"
    // }
    }

    main().catch(e => {
    console.error(e);
    throw e;
    });

    Returns

    A promise if used with async/await, or void if used with a callback.

    Parameters

    Returns GaxiosPromise<Readable>

  • Parameters

    Returns GaxiosPromise<Schema$Drive>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Updates the metadate for a shared drive.

    Example

    // 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.update({
    // The ID of the shared drive.
    driveId: 'placeholder-value',
    // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.
    useDomainAdminAccess: 'placeholder-value',

    // Request body metadata
    requestBody: {
    // request body parameters
    // {
    // "backgroundImageFile": {},
    // "backgroundImageLink": "my_backgroundImageLink",
    // "capabilities": {},
    // "colorRgb": "my_colorRgb",
    // "createdTime": "my_createdTime",
    // "hidden": false,
    // "id": "my_id",
    // "kind": "my_kind",
    // "name": "my_name",
    // "orgUnitId": "my_orgUnitId",
    // "restrictions": {},
    // "themeId": "my_themeId"
    // }
    },
    });
    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",
    // "orgUnitId": "my_orgUnitId",
    // "restrictions": {},
    // "themeId": "my_themeId"
    // }
    }

    main().catch(e => {
    console.error(e);
    throw e;
    });

    Returns

    A promise if used with async/await, or void if used with a callback.

    Parameters

    Returns GaxiosPromise<Readable>

  • Parameters

    Returns GaxiosPromise<Schema$Drive>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

Generated using TypeDoc