Class: Google::Datastore::V1::CommitRequest
- Inherits:
-
Object
- Object
- Google::Datastore::V1::CommitRequest
- Defined in:
- lib/google/cloud/datastore/v1/doc/google/datastore/v1/datastore.rb
Overview
The request for Datastore::Commit.
Defined Under Namespace
Modules: Mode
Instance Attribute Summary collapse
-
#mode ⇒ Google::Datastore::V1::CommitRequest::Mode
The type of commit to perform.
-
#mutations ⇒ Array<Google::Datastore::V1::Mutation>
The mutations to perform.
-
#project_id ⇒ String
The ID of the project against which to make the request.
-
#transaction ⇒ String
The identifier of the transaction associated with the commit.
Instance Attribute Details
#mode ⇒ Google::Datastore::V1::CommitRequest::Mode
Returns The type of commit to perform. Defaults to +TRANSACTIONAL+.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/google/cloud/datastore/v1/doc/google/datastore/v1/datastore.rb', line 131 class CommitRequest # The modes available for commits. module Mode # Unspecified. This value must not be used. MODE_UNSPECIFIED = 0 # Transactional: The mutations are either all applied, or none are applied. # Learn about transactions {here}[https://cloud.google.com/datastore/docs/concepts/transactions]. TRANSACTIONAL = 1 # Non-transactional: The mutations may not apply as all or none. NON_TRANSACTIONAL = 2 end end |
#mutations ⇒ Array<Google::Datastore::V1::Mutation>
Returns 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.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/google/cloud/datastore/v1/doc/google/datastore/v1/datastore.rb', line 131 class CommitRequest # The modes available for commits. module Mode # Unspecified. This value must not be used. MODE_UNSPECIFIED = 0 # Transactional: The mutations are either all applied, or none are applied. # Learn about transactions {here}[https://cloud.google.com/datastore/docs/concepts/transactions]. TRANSACTIONAL = 1 # Non-transactional: The mutations may not apply as all or none. NON_TRANSACTIONAL = 2 end end |
#project_id ⇒ String
Returns The ID of the project against which to make the request.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/google/cloud/datastore/v1/doc/google/datastore/v1/datastore.rb', line 131 class CommitRequest # The modes available for commits. module Mode # Unspecified. This value must not be used. MODE_UNSPECIFIED = 0 # Transactional: The mutations are either all applied, or none are applied. # Learn about transactions {here}[https://cloud.google.com/datastore/docs/concepts/transactions]. TRANSACTIONAL = 1 # Non-transactional: The mutations may not apply as all or none. NON_TRANSACTIONAL = 2 end end |
#transaction ⇒ String
Returns The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore::BeginTransaction.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/google/cloud/datastore/v1/doc/google/datastore/v1/datastore.rb', line 131 class CommitRequest # The modes available for commits. module Mode # Unspecified. This value must not be used. MODE_UNSPECIFIED = 0 # Transactional: The mutations are either all applied, or none are applied. # Learn about transactions {here}[https://cloud.google.com/datastore/docs/concepts/transactions]. TRANSACTIONAL = 1 # Non-transactional: The mutations may not apply as all or none. NON_TRANSACTIONAL = 2 end end |