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.



367
368
369
# File 'lib/google/apis/datastore_v1/classes.rb', line 367

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)


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

def database_id
  @database_id
end

#modeString

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

Returns:

  • (String)


336
337
338
# File 'lib/google/apis/datastore_v1/classes.rb', line 336

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



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

def mutations
  @mutations
end

#request_optionsGoogle::Apis::DatastoreV1::RequestOptions

Options for a request. Corresponds to the JSON property requestOptions



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

def request_options
  @request_options
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



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

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)


365
366
367
# File 'lib/google/apis/datastore_v1/classes.rb', line 365

def transaction
  @transaction
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



372
373
374
375
376
377
378
379
# File 'lib/google/apis/datastore_v1/classes.rb', line 372

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)
  @request_options = args[:request_options] if args.key?(:request_options)
  @single_use_transaction = args[:single_use_transaction] if args.key?(:single_use_transaction)
  @transaction = args[:transaction] if args.key?(:transaction)
end