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.



1973
1974
1975
# File 'lib/google/apis/datastore_v1/classes.rb', line 1973

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)


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

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)


1929
1930
1931
# File 'lib/google/apis/datastore_v1/classes.rb', line 1929

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



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

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



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

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



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

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



1955
1956
1957
# File 'lib/google/apis/datastore_v1/classes.rb', line 1955

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



1960
1961
1962
# File 'lib/google/apis/datastore_v1/classes.rb', line 1960

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)


1966
1967
1968
# File 'lib/google/apis/datastore_v1/classes.rb', line 1966

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



1971
1972
1973
# File 'lib/google/apis/datastore_v1/classes.rb', line 1971

def upsert
  @upsert
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
# File 'lib/google/apis/datastore_v1/classes.rb', line 1978

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