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.



1878
1879
1880
# File 'lib/google/apis/datastore_v1/classes.rb', line 1878

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)


1828
1829
1830
# File 'lib/google/apis/datastore_v1/classes.rb', line 1828

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)


1834
1835
1836
# File 'lib/google/apis/datastore_v1/classes.rb', line 1834

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



1841
1842
1843
# File 'lib/google/apis/datastore_v1/classes.rb', line 1841

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



1846
1847
1848
# File 'lib/google/apis/datastore_v1/classes.rb', line 1846

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



1852
1853
1854
# File 'lib/google/apis/datastore_v1/classes.rb', line 1852

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



1860
1861
1862
# File 'lib/google/apis/datastore_v1/classes.rb', line 1860

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



1865
1866
1867
# File 'lib/google/apis/datastore_v1/classes.rb', line 1865

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)


1871
1872
1873
# File 'lib/google/apis/datastore_v1/classes.rb', line 1871

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



1876
1877
1878
# File 'lib/google/apis/datastore_v1/classes.rb', line 1876

def upsert
  @upsert
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
# File 'lib/google/apis/datastore_v1/classes.rb', line 1883

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