Class: Google::Apis::SpannerV1::Mutation

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

Overview

A modification to one or more Cloud Spanner rows. Mutations can be applied to a Cloud Spanner database by sending them in a Commit call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Mutation

Returns a new instance of Mutation.



2411
2412
2413
# File 'lib/google/apis/spanner_v1/classes.rb', line 2411

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

Instance Attribute Details

#deleteGoogle::Apis::SpannerV1::Delete

Arguments to delete operations. Corresponds to the JSON property delete



2389
2390
2391
# File 'lib/google/apis/spanner_v1/classes.rb', line 2389

def delete
  @delete
end

#insertGoogle::Apis::SpannerV1::Write

Arguments to insert, update, insert_or_update, and replace operations. Corresponds to the JSON property insert



2394
2395
2396
# File 'lib/google/apis/spanner_v1/classes.rb', line 2394

def insert
  @insert
end

#insert_or_updateGoogle::Apis::SpannerV1::Write

Arguments to insert, update, insert_or_update, and replace operations. Corresponds to the JSON property insertOrUpdate



2399
2400
2401
# File 'lib/google/apis/spanner_v1/classes.rb', line 2399

def insert_or_update
  @insert_or_update
end

#replaceGoogle::Apis::SpannerV1::Write

Arguments to insert, update, insert_or_update, and replace operations. Corresponds to the JSON property replace



2404
2405
2406
# File 'lib/google/apis/spanner_v1/classes.rb', line 2404

def replace
  @replace
end

#updateGoogle::Apis::SpannerV1::Write

Arguments to insert, update, insert_or_update, and replace operations. Corresponds to the JSON property update



2409
2410
2411
# File 'lib/google/apis/spanner_v1/classes.rb', line 2409

def update
  @update
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2416
2417
2418
2419
2420
2421
2422
# File 'lib/google/apis/spanner_v1/classes.rb', line 2416

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