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

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

Overview

Provides control over how write requests are executed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ WriteControl

Returns a new instance of WriteControl.



6464
6465
6466
# File 'generated/google/apis/docs_v1/classes.rb', line 6464

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

Instance Attribute Details

#required_revision_idString

The revision ID of the document that the write request will be applied to. If this is not the latest revision of the document, the request will not be processed and will return 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

Returns:

  • (String)


6442
6443
6444
# File 'generated/google/apis/docs_v1/classes.rb', line 6442

def required_revision_id
  @required_revision_id
end

#target_revision_idString

The target revision ID of the document that the write request will be applied to. If collaborator changes have occurred after the document was read using the API, the changes produced by this write request will be transformed against the collaborator changes. This results in a new revision of the document which incorporates both the changes in the request and the collaborator changes, and the Docs server will resolve conflicting changes. When using target_revision_id, the API client can be thought of as another collaborator of the document. The target revision ID may only be used to write to recent versions of a document. If the target revision is too far behind the latest revision, the request will not be processed and will return a 400 bad request error and the request should be retried after reading the latest version of the document. In most cases a revision_id will remain valid for use as a target revision for several minutes after it is read, but for frequently-edited documents this window may be shorter. Corresponds to the JSON property targetRevisionId

Returns:

  • (String)


6462
6463
6464
# File 'generated/google/apis/docs_v1/classes.rb', line 6462

def target_revision_id
  @target_revision_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6469
6470
6471
6472
# File 'generated/google/apis/docs_v1/classes.rb', line 6469

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