Class: Google::Apis::DocsV1::WriteControl

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/docs_v1/classes.rb,
lib/google/apis/docs_v1/representations.rb,
lib/google/apis/docs_v1/representations.rb

Overview

Provides control over how write requests are executed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ WriteControl



7306
7307
7308
# File 'lib/google/apis/docs_v1/classes.rb', line 7306

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#required_revision_idString

The optional revision ID of the document the write request is applied to. If this is not the latest revision of the document, the request is not processed and returns a 400 bad request error. When a required revision ID is returned in a response, it indicates the revision ID of the document after the request was applied. Corresponds to the JSON property requiredRevisionId



7286
7287
7288
# File 'lib/google/apis/docs_v1/classes.rb', line 7286

def required_revision_id
  @required_revision_id
end

#target_revision_idString

The optional target revision ID of the document the write request is applied to. If collaborator changes have occurred after the document was read using the API, the changes produced by this write request are applied against the collaborator changes. This results in a new revision of the document that incorporates both the collaborator changes and the changes in the request, with the Docs server resolving conflicting changes. When using target revision ID, the API client can be thought of as another collaborator of the document. The target revision ID can only be used to write to recent versions of a document. If the target revision is too far behind the latest revision, the request is not processed and returns a 400 bad request error. The request should be tried again after retrieving the latest version of the document. Usually a revision ID remains valid for use as a target revision for several minutes after it's read, but for frequently edited documents this window might be shorter. Corresponds to the JSON property targetRevisionId



7304
7305
7306
# File 'lib/google/apis/docs_v1/classes.rb', line 7304

def target_revision_id
  @target_revision_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



7311
7312
7313
7314
# File 'lib/google/apis/docs_v1/classes.rb', line 7311

def update!(**args)
  @required_revision_id = args[:required_revision_id] if args.key?(:required_revision_id)
  @target_revision_id = args[:target_revision_id] if args.key?(:target_revision_id)
end