Hierarchy

  • Resource$Comments

Constructors

Properties

Methods

Constructors

  • Parameters

    • context: APIRequestContext

    Returns Resource$Comments

Properties

context: APIRequestContext

Methods

  • Creates a new comment on a file.

    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.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.comments.create({
    // The ID of the file.
    fileId: 'placeholder-value',

    // Request body metadata
    requestBody: {
    // request body parameters
    // {
    // "anchor": "my_anchor",
    // "author": {},
    // "content": "my_content",
    // "createdTime": "my_createdTime",
    // "deleted": false,
    // "htmlContent": "my_htmlContent",
    // "id": "my_id",
    // "kind": "my_kind",
    // "modifiedTime": "my_modifiedTime",
    // "quotedFileContent": {},
    // "replies": [],
    // "resolved": false
    // }
    },
    });
    console.log(res.data);

    // Example response
    // {
    // "anchor": "my_anchor",
    // "author": {},
    // "content": "my_content",
    // "createdTime": "my_createdTime",
    // "deleted": false,
    // "htmlContent": "my_htmlContent",
    // "id": "my_id",
    // "kind": "my_kind",
    // "modifiedTime": "my_modifiedTime",
    // "quotedFileContent": {},
    // "replies": [],
    // "resolved": false
    // }
    }

    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$Comment>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Deletes a comment.

    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.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.comments.delete({
    // The ID of the comment.
    commentId: 'placeholder-value',
    // The ID of the file.
    fileId: '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 comment 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.file',
    '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.comments.get({
    // The ID of the comment.
    commentId: 'placeholder-value',
    // The ID of the file.
    fileId: 'placeholder-value',
    // Whether to return deleted comments. Deleted comments will not include their original content.
    includeDeleted: 'placeholder-value',
    });
    console.log(res.data);

    // Example response
    // {
    // "anchor": "my_anchor",
    // "author": {},
    // "content": "my_content",
    // "createdTime": "my_createdTime",
    // "deleted": false,
    // "htmlContent": "my_htmlContent",
    // "id": "my_id",
    // "kind": "my_kind",
    // "modifiedTime": "my_modifiedTime",
    // "quotedFileContent": {},
    // "replies": [],
    // "resolved": false
    // }
    }

    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$Comment>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Lists a file's comments.

    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.file',
    '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.comments.list({
    // The ID of the file.
    fileId: 'placeholder-value',
    // Whether to include deleted comments. Deleted comments will not include their original content.
    includeDeleted: 'placeholder-value',
    // The maximum number of comments to return per page.
    pageSize: 'placeholder-value',
    // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
    pageToken: 'placeholder-value',
    // The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time).
    startModifiedTime: 'placeholder-value',
    });
    console.log(res.data);

    // Example response
    // {
    // "comments": [],
    // "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$CommentList>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Updates a comment with patch semantics.

    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.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.comments.update({
    // The ID of the comment.
    commentId: 'placeholder-value',
    // The ID of the file.
    fileId: 'placeholder-value',

    // Request body metadata
    requestBody: {
    // request body parameters
    // {
    // "anchor": "my_anchor",
    // "author": {},
    // "content": "my_content",
    // "createdTime": "my_createdTime",
    // "deleted": false,
    // "htmlContent": "my_htmlContent",
    // "id": "my_id",
    // "kind": "my_kind",
    // "modifiedTime": "my_modifiedTime",
    // "quotedFileContent": {},
    // "replies": [],
    // "resolved": false
    // }
    },
    });
    console.log(res.data);

    // Example response
    // {
    // "anchor": "my_anchor",
    // "author": {},
    // "content": "my_content",
    // "createdTime": "my_createdTime",
    // "deleted": false,
    // "htmlContent": "my_htmlContent",
    // "id": "my_id",
    // "kind": "my_kind",
    // "modifiedTime": "my_modifiedTime",
    // "quotedFileContent": {},
    // "replies": [],
    // "resolved": false
    // }
    }

    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$Comment>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

Generated using TypeDoc