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

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/datastore_v1/classes.rb,
generated/google/apis/datastore_v1/representations.rb,
generated/google/apis/datastore_v1/representations.rb

Overview

A mutation to apply to an entity.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Mutation

Returns a new instance of Mutation



1238
1239
1240
# File 'generated/google/apis/datastore_v1/classes.rb', line 1238

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)


1204
1205
1206
# File 'generated/google/apis/datastore_v1/classes.rb', line 1204

def base_version
  @base_version
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



1236
1237
1238
# File 'generated/google/apis/datastore_v1/classes.rb', line 1236

def delete
  @delete
end

#insertGoogle::Apis::DatastoreV1::Entity

A Datastore data object. An entity is limited to 1 megabyte when stored. That roughly corresponds to a limit of 1 megabyte for the serialized form of this message. Corresponds to the JSON property insert



1212
1213
1214
# File 'generated/google/apis/datastore_v1/classes.rb', line 1212

def insert
  @insert
end

#updateGoogle::Apis::DatastoreV1::Entity

A Datastore data object. An entity is limited to 1 megabyte when stored. That roughly corresponds to a limit of 1 megabyte for the serialized form of this message. Corresponds to the JSON property update



1220
1221
1222
# File 'generated/google/apis/datastore_v1/classes.rb', line 1220

def update
  @update
end

#upsertGoogle::Apis::DatastoreV1::Entity

A Datastore data object. An entity is limited to 1 megabyte when stored. That roughly corresponds to a limit of 1 megabyte for the serialized form of this message. Corresponds to the JSON property upsert



1228
1229
1230
# File 'generated/google/apis/datastore_v1/classes.rb', line 1228

def upsert
  @upsert
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1243
1244
1245
1246
1247
1248
1249
# File 'generated/google/apis/datastore_v1/classes.rb', line 1243

def update!(**args)
  @base_version = args[:base_version] if args.key?(:base_version)
  @insert = args[:insert] if args.key?(:insert)
  @update = args[:update] if args.key?(:update)
  @upsert = args[:upsert] if args.key?(:upsert)
  @delete = args[:delete] if args.key?(:delete)
end