Class: Google::Apis::DatastoreV1::CommitRequest
- Inherits:
-
Object
- Object
- Google::Apis::DatastoreV1::CommitRequest
- 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
The request for Datastore.Commit.
Instance Attribute Summary collapse
-
#database_id ⇒ String
The ID of the database against which to make the request.
-
#mode ⇒ String
The type of commit to perform.
-
#mutations ⇒ Array<Google::Apis::DatastoreV1::Mutation>
The mutations to perform.
-
#single_use_transaction ⇒ Google::Apis::DatastoreV1::TransactionOptions
Options for beginning a new transaction.
-
#transaction ⇒ String
The identifier of the transaction associated with the commit.
Instance Method Summary collapse
-
#initialize(**args) ⇒ CommitRequest
constructor
A new instance of CommitRequest.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ CommitRequest
Returns a new instance of CommitRequest.
345 346 347 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 345 def initialize(**args) update!(**args) end |
Instance Attribute Details
#database_id ⇒ String
The ID of the database against which to make the request. '(default)' is not
allowed; please use empty string '' to refer the default database.
Corresponds to the JSON property databaseId
314 315 316 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 314 def database_id @database_id end |
#mode ⇒ String
The type of commit to perform. Defaults to TRANSACTIONAL.
Corresponds to the JSON property mode
319 320 321 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 319 def mode @mode end |
#mutations ⇒ Array<Google::Apis::DatastoreV1::Mutation>
The mutations to perform. When mode is TRANSACTIONAL, mutations affecting a
single entity are applied in order. The following sequences of mutations
affecting a single entity are not permitted in a single Commit request: -
insert followed by insert - update followed by insert - upsert
followed by insert - delete followed by update When mode is
NON_TRANSACTIONAL, no two mutations may affect a single entity.
Corresponds to the JSON property mutations
329 330 331 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 329 def mutations @mutations end |
#single_use_transaction ⇒ Google::Apis::DatastoreV1::TransactionOptions
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.
Corresponds to the JSON property singleUseTransaction
336 337 338 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 336 def single_use_transaction @single_use_transaction end |
#transaction ⇒ String
The identifier of the transaction associated with the commit. A transaction
identifier is returned by a call to Datastore.BeginTransaction.
Corresponds to the JSON property transaction
NOTE: Values are automatically base64 encoded/decoded in the client library.
343 344 345 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 343 def transaction @transaction end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
350 351 352 353 354 355 356 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 350 def update!(**args) @database_id = args[:database_id] if args.key?(:database_id) @mode = args[:mode] if args.key?(:mode) @mutations = args[:mutations] if args.key?(:mutations) @single_use_transaction = args[:single_use_transaction] if args.key?(:single_use_transaction) @transaction = args[:transaction] if args.key?(:transaction) end |