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

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.



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

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)


317
318
319
# File 'lib/google/apis/datastore_v1/classes.rb', line 317

def database_id
  @database_id
end

#modeString

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

Returns:

  • (String)


322
323
324
# File 'lib/google/apis/datastore_v1/classes.rb', line 322

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



332
333
334
# File 'lib/google/apis/datastore_v1/classes.rb', line 332

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



339
340
341
# File 'lib/google/apis/datastore_v1/classes.rb', line 339

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)


346
347
348
# File 'lib/google/apis/datastore_v1/classes.rb', line 346

def transaction
  @transaction
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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