Method: Google::Apis::DocsV1::DocsService#batch_update_document

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

#batch_update_document(document_id, batch_update_document_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocsV1::BatchUpdateDocumentResponse

Applies one or more updates to the document. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests. For example, suppose you call batchUpdate with four updates, and only the third one returns information. The response would have two empty replies, the reply to the third request, and another empty reply, in that order. Because other users may be editing the document, the document might not exactly reflect your changes: your changes may be altered with respect to collaborator changes. If there are no collaborators, the document should reflect your changes. In any case, the updates in your request are guaranteed to be applied together atomically.

Parameters:

  • document_id (String)

    The ID of the document to update.

  • batch_update_document_request_object (Google::Apis::DocsV1::BatchUpdateDocumentRequest) (defaults to: nil)
  • 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



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/google/apis/docs_v1/service.rb', line 87

def batch_update_document(document_id, batch_update_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/documents/{documentId}:batchUpdate', options)
  command.request_representation = Google::Apis::DocsV1::BatchUpdateDocumentRequest::Representation
  command.request_object = batch_update_document_request_object
  command.response_representation = Google::Apis::DocsV1::BatchUpdateDocumentResponse::Representation
  command.response_class = Google::Apis::DocsV1::BatchUpdateDocumentResponse
  command.params['documentId'] = document_id unless document_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end