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

Returns a new instance of WriteControl.



6850
6851
6852
# File 'lib/google/apis/docs_v1/classes.rb', line 6850

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

Returns:

  • (String)


6830
6831
6832
# File 'lib/google/apis/docs_v1/classes.rb', line 6830

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

Returns:

  • (String)


6848
6849
6850
# File 'lib/google/apis/docs_v1/classes.rb', line 6848

def target_revision_id
  @target_revision_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6855
6856
6857
6858
# File 'lib/google/apis/docs_v1/classes.rb', line 6855

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