Class: Google::Cloud::Datastore::V1::CommitRequest

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/datastore/v1/datastore.rb

Overview

The request for Datastore.Commit.

Defined Under Namespace

Modules: Mode

Instance Attribute Summary collapse

Instance Attribute Details

#database_id::String

Returns The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default database.

Returns:

  • (::String)

    The ID of the database against which to make the request.

    '(default)' is not allowed; please use empty string '' to refer the default database.



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'proto_docs/google/datastore/v1/datastore.rb', line 323

class CommitRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # 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

#mode::Google::Cloud::Datastore::V1::CommitRequest::Mode

Returns The type of commit to perform. Defaults to TRANSACTIONAL.

Returns:



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'proto_docs/google/datastore/v1/datastore.rb', line 323

class CommitRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # 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::Cloud::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.

Returns:

  • (::Array<::Google::Cloud::Datastore::V1::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.



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'proto_docs/google/datastore/v1/datastore.rb', line 323

class CommitRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # 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 Required. The ID of the project against which to make the request.

Returns:

  • (::String)

    Required. The ID of the project against which to make the request.



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'proto_docs/google/datastore/v1/datastore.rb', line 323

class CommitRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # 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

#single_use_transaction::Google::Cloud::Datastore::V1::TransactionOptions

Returns Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

Note: The following fields are mutually exclusive: single_use_transaction, transaction. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'proto_docs/google/datastore/v1/datastore.rb', line 323

class CommitRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

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

Note: The following fields are mutually exclusive: transaction, single_use_transaction. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::String)

    The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.

    Note: The following fields are mutually exclusive: transaction, single_use_transaction. If a field in that set is populated, all other fields in the set will automatically be cleared.



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'proto_docs/google/datastore/v1/datastore.rb', line 323

class CommitRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # 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