Class: Google::Apis::DatastoreV1::Mutation

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Mutation

Returns a new instance of Mutation.



1949
1950
1951
# File 'lib/google/apis/datastore_v1/classes.rb', line 1949

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

Instance Attribute Details

#base_versionFixnum

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

Returns:

  • (Fixnum)


1899
1900
1901
# File 'lib/google/apis/datastore_v1/classes.rb', line 1899

def base_version
  @base_version
end

#conflict_resolution_strategyString

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

Returns:

  • (String)


1905
1906
1907
# File 'lib/google/apis/datastore_v1/classes.rb', line 1905

def conflict_resolution_strategy
  @conflict_resolution_strategy
end

#deleteGoogle::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



1912
1913
1914
# File 'lib/google/apis/datastore_v1/classes.rb', line 1912

def delete
  @delete
end

#insertGoogle::Apis::DatastoreV1::Entity

A Datastore data object. Must not exceed 1 MiB - 4 bytes. Corresponds to the JSON property insert



1917
1918
1919
# File 'lib/google/apis/datastore_v1/classes.rb', line 1917

def insert
  @insert
end

#property_maskGoogle::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



1923
1924
1925
# File 'lib/google/apis/datastore_v1/classes.rb', line 1923

def property_mask
  @property_mask
end

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



1931
1932
1933
# File 'lib/google/apis/datastore_v1/classes.rb', line 1931

def property_transforms
  @property_transforms
end

#updateGoogle::Apis::DatastoreV1::Entity

A Datastore data object. Must not exceed 1 MiB - 4 bytes. Corresponds to the JSON property update



1936
1937
1938
# File 'lib/google/apis/datastore_v1/classes.rb', line 1936

def update
  @update
end

#update_timeString

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

Returns:

  • (String)


1942
1943
1944
# File 'lib/google/apis/datastore_v1/classes.rb', line 1942

def update_time
  @update_time
end

#upsertGoogle::Apis::DatastoreV1::Entity

A Datastore data object. Must not exceed 1 MiB - 4 bytes. Corresponds to the JSON property upsert



1947
1948
1949
# File 'lib/google/apis/datastore_v1/classes.rb', line 1947

def upsert
  @upsert
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
# File 'lib/google/apis/datastore_v1/classes.rb', line 1954

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