Class: Google::Cloud::Datastore::V1::Mutation

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

Overview

A mutation to apply to an entity.

Defined Under Namespace

Modules: ConflictResolutionStrategy

Instance Attribute Summary collapse

Instance Attribute Details

#base_version::Integer

Returns The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts.

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

Returns:

  • (::Integer)

    The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts.

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



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end

#conflict_resolution_strategy::Google::Cloud::Datastore::V1::Mutation::ConflictResolutionStrategy

Returns The strategy to use when a conflict is detected. Defaults to SERVER_VALUE. If this is set, then conflict_detection_strategy must also be set.

Returns:



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end

#delete::Google::Cloud::Datastore::V1::Key

Returns The key of the entity to delete. The entity may or may not already exist. Must have a complete key path and must not be reserved/read-only.

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

Returns:

  • (::Google::Cloud::Datastore::V1::Key)

    The key of the entity to delete. The entity may or may not already exist. Must have a complete key path and must not be reserved/read-only.

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



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end

#insert::Google::Cloud::Datastore::V1::Entity

Returns The entity to insert. The entity must not already exist. The entity key's final path element may be incomplete.

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

Returns:

  • (::Google::Cloud::Datastore::V1::Entity)

    The entity to insert. The entity must not already exist. The entity key's final path element may be incomplete.

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



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end

#property_mask::Google::Cloud::Datastore::V1::PropertyMask

Returns The properties to write in this mutation. None of the properties in the mask may have a reserved name, except for __key__. This field is ignored for delete.

If the entity already exists, only properties referenced in the mask are updated, others are left untouched. Properties referenced in the mask but not in the entity are deleted.

Returns:

  • (::Google::Cloud::Datastore::V1::PropertyMask)

    The properties to write in this mutation. None of the properties in the mask may have a reserved name, except for __key__. This field is ignored for delete.

    If the entity already exists, only properties referenced in the mask are updated, others are left untouched. Properties referenced in the mask but not in the entity are deleted.



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end

#property_transforms::Array<::Google::Cloud::Datastore::V1::PropertyTransform>

Returns Optional. The transforms to perform on the entity.

This field can be set only when the operation is insert, update, or upsert. If present, the transforms are be applied to the entity regardless of the property mask, in order, after the operation.

Returns:

  • (::Array<::Google::Cloud::Datastore::V1::PropertyTransform>)

    Optional. The transforms to perform on the entity.

    This field can be set only when the operation is insert, update, or upsert. If present, the transforms are be applied to the entity regardless of the property mask, in order, after the operation.



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end

#update::Google::Cloud::Datastore::V1::Entity

Returns The entity to update. The entity must already exist. Must have a complete key path.

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

Returns:

  • (::Google::Cloud::Datastore::V1::Entity)

    The entity to update. The entity must already exist. Must have a complete key path.

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



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end

#update_time::Google::Protobuf::Timestamp

Returns The update time of the entity that this mutation is being applied to. If this does not match the current update time on the server, the mutation conflicts.

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

Returns:

  • (::Google::Protobuf::Timestamp)

    The update time of the entity that this mutation is being applied to. If this does not match the current update time on the server, the mutation conflicts.

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



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end

#upsert::Google::Cloud::Datastore::V1::Entity

Returns The entity to upsert. The entity may or may not already exist. The entity key's final path element may be incomplete.

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

Returns:

  • (::Google::Cloud::Datastore::V1::Entity)

    The entity to upsert. The entity may or may not already exist. The entity key's final path element may be incomplete.

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



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'proto_docs/google/datastore/v1/datastore.rb', line 478

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

  # The possible ways to resolve a conflict detected in a mutation.
  module ConflictResolutionStrategy
    # Unspecified. Defaults to `SERVER_VALUE`.
    STRATEGY_UNSPECIFIED = 0

    # The server entity is kept.
    SERVER_VALUE = 1

    # The whole commit request fails.
    FAIL = 3
  end
end