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

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

Overview

The request for Datastore.Commit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ CommitRequest

Returns a new instance of CommitRequest



1091
1092
1093
# File 'generated/google/apis/datastore_v1/classes.rb', line 1091

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

Instance Attribute Details

#modeString

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

Returns:

  • (String)


1075
1076
1077
# File 'generated/google/apis/datastore_v1/classes.rb', line 1075

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


1089
1090
1091
# File 'generated/google/apis/datastore_v1/classes.rb', line 1089

def mutations
  @mutations
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)


1070
1071
1072
# File 'generated/google/apis/datastore_v1/classes.rb', line 1070

def transaction
  @transaction
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1096
1097
1098
1099
1100
# File 'generated/google/apis/datastore_v1/classes.rb', line 1096

def update!(**args)
  @transaction = args[:transaction] if args.key?(:transaction)
  @mode = args[:mode] if args.key?(:mode)
  @mutations = args[:mutations] if args.key?(:mutations)
end