Class: Google::Apis::DatastoreV1::CommitRequest

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
more...

Overview

The request for Datastore.Commit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CommitRequest

Returns a new instance of CommitRequest.

[View source]

350
351
352
# File 'lib/google/apis/datastore_v1/classes.rb', line 350

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

Instance Attribute Details

#database_idString

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

Returns:

  • (String)

319
320
321
# File 'lib/google/apis/datastore_v1/classes.rb', line 319

def database_id
  @database_id
end

#modeString

The type of commit to perform. Defaults to TRANSACTIONAL. Corresponds to the JSON property mode

Returns:

  • (String)

324
325
326
# File 'lib/google/apis/datastore_v1/classes.rb', line 324

def mode
  @mode
end

#mutationsArray<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


334
335
336
# File 'lib/google/apis/datastore_v1/classes.rb', line 334

def mutations
  @mutations
end

#single_use_transactionGoogle::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


341
342
343
# File 'lib/google/apis/datastore_v1/classes.rb', line 341

def single_use_transaction
  @single_use_transaction
end

#transactionString

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.

Returns:

  • (String)

348
349
350
# File 'lib/google/apis/datastore_v1/classes.rb', line 348

def transaction
  @transaction
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object

[View source]

355
356
357
358
359
360
361
# File 'lib/google/apis/datastore_v1/classes.rb', line 355

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