Class: Google::Apis::DatastoreV1::Mutation
- Inherits:
-
Object
- Object
- Google::Apis::DatastoreV1::Mutation
- 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
A mutation to apply to an entity.
Instance Attribute Summary collapse
-
#base_version ⇒ Fixnum
The version of the entity that this mutation is being applied to.
-
#conflict_resolution_strategy ⇒ String
The strategy to use when a conflict is detected.
-
#delete ⇒ Google::Apis::DatastoreV1::Key
A unique identifier for an entity.
-
#insert ⇒ Google::Apis::DatastoreV1::Entity
A Datastore data object.
-
#property_mask ⇒ Google::Apis::DatastoreV1::PropertyMask
The set of arbitrarily nested property paths used to restrict an operation to only a subset of properties in an entity.
-
#property_transforms ⇒ Array<Google::Apis::DatastoreV1::PropertyTransform>
Optional.
-
#update ⇒ Google::Apis::DatastoreV1::Entity
A Datastore data object.
-
#update_time ⇒ String
The update time of the entity that this mutation is being applied to.
-
#upsert ⇒ Google::Apis::DatastoreV1::Entity
A Datastore data object.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Mutation
constructor
A new instance of Mutation.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Mutation
Returns a new instance of Mutation.
1940 1941 1942 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1940 def initialize(**args) update!(**args) end |
Instance Attribute Details
#base_version ⇒ Fixnum
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.
Corresponds to the JSON property baseVersion
1890 1891 1892 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1890 def base_version @base_version end |
#conflict_resolution_strategy ⇒ String
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.
Corresponds to the JSON property conflictResolutionStrategy
1896 1897 1898 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1896 def conflict_resolution_strategy @conflict_resolution_strategy end |
#delete ⇒ Google::Apis::DatastoreV1::Key
A unique identifier for an entity. If a key's partition ID or any of its path
kinds or names are reserved/read-only, the key is reserved/read-only. A
reserved/read-only key is forbidden in certain documented contexts.
Corresponds to the JSON property delete
1903 1904 1905 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1903 def delete @delete end |
#insert ⇒ Google::Apis::DatastoreV1::Entity
A Datastore data object. Must not exceed 1 MiB - 4 bytes.
Corresponds to the JSON property insert
1908 1909 1910 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1908 def insert @insert end |
#property_mask ⇒ Google::Apis::DatastoreV1::PropertyMask
The set of arbitrarily nested property paths used to restrict an operation to
only a subset of properties in an entity.
Corresponds to the JSON property propertyMask
1914 1915 1916 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1914 def property_mask @property_mask end |
#property_transforms ⇒ Array<Google::Apis::DatastoreV1::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.
Corresponds to the JSON property propertyTransforms
1922 1923 1924 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1922 def property_transforms @property_transforms end |
#update ⇒ Google::Apis::DatastoreV1::Entity
A Datastore data object. Must not exceed 1 MiB - 4 bytes.
Corresponds to the JSON property update
1927 1928 1929 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1927 def update @update end |
#update_time ⇒ String
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.
Corresponds to the JSON property updateTime
1933 1934 1935 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1933 def update_time @update_time end |
#upsert ⇒ Google::Apis::DatastoreV1::Entity
A Datastore data object. Must not exceed 1 MiB - 4 bytes.
Corresponds to the JSON property upsert
1938 1939 1940 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1938 def upsert @upsert end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 |
# File 'lib/google/apis/datastore_v1/classes.rb', line 1945 def update!(**args) @base_version = args[:base_version] if args.key?(:base_version) @conflict_resolution_strategy = args[:conflict_resolution_strategy] if args.key?(:conflict_resolution_strategy) @delete = args[:delete] if args.key?(:delete) @insert = args[:insert] if args.key?(:insert) @property_mask = args[:property_mask] if args.key?(:property_mask) @property_transforms = args[:property_transforms] if args.key?(:property_transforms) @update = args[:update] if args.key?(:update) @update_time = args[:update_time] if args.key?(:update_time) @upsert = args[:upsert] if args.key?(:upsert) end |