Method: Google::Apis::DocsV1::DocsService#get_document

Defined in:
lib/google/apis/docs_v1/service.rb

#get_document(document_id, include_tabs_content: nil, suggestions_view_mode: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocsV1::Document

Gets the latest version of the specified document.

Parameters:

  • document_id (String)

    The ID of the document to retrieve.

  • include_tabs_content (Boolean) (defaults to: nil)

    Whether to populate the Document.tabs field instead of the text content fields like body and documentStyle on Document. - When True: Document content populates in the Document.tabs field instead of the text content fields in Document. - When False: The content of the document's first tab populates the content fields in Document excluding Document.tabs. If a document has only one tab, then that tab is used to populate the document content. Document.tabs will be empty.

  • suggestions_view_mode (String) (defaults to: nil)

    The suggestions view mode to apply to the document. This allows viewing the document with all suggestions inline, accepted or rejected. If one is not specified, DEFAULT_FOR_CURRENT_ACCESS is used.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



163
164
165
166
167
168
169
170
171
172
173
# File 'lib/google/apis/docs_v1/service.rb', line 163

def get_document(document_id, include_tabs_content: nil, suggestions_view_mode: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/documents/{documentId}', options)
  command.response_representation = Google::Apis::DocsV1::Document::Representation
  command.response_class = Google::Apis::DocsV1::Document
  command.params['documentId'] = document_id unless document_id.nil?
  command.query['includeTabsContent'] = include_tabs_content unless include_tabs_content.nil?
  command.query['suggestionsViewMode'] = suggestions_view_mode unless suggestions_view_mode.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end