Class: Google::Apis::DatastoreV1::TransactionOptions

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

Overview

Options for beginning a new transaction. Transactions can be created explicitly with calls to Datastore.BeginTransaction or implicitly by setting ReadOptions.new_transaction in read requests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TransactionOptions

Returns a new instance of TransactionOptions.



3008
3009
3010
# File 'lib/google/apis/datastore_v1/classes.rb', line 3008

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

Instance Attribute Details

#read_onlyGoogle::Apis::DatastoreV1::ReadOnly

Options specific to read-only transactions. Corresponds to the JSON property readOnly



3001
3002
3003
# File 'lib/google/apis/datastore_v1/classes.rb', line 3001

def read_only
  @read_only
end

#read_writeGoogle::Apis::DatastoreV1::ReadWrite

Options specific to read / write transactions. Corresponds to the JSON property readWrite



3006
3007
3008
# File 'lib/google/apis/datastore_v1/classes.rb', line 3006

def read_write
  @read_write
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3013
3014
3015
3016
# File 'lib/google/apis/datastore_v1/classes.rb', line 3013

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