google-apis-spanner_v1 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,10 +22,201 @@ module Google
22
22
  module Apis
23
23
  module SpannerV1
24
24
 
25
+ # AsymmetricAutoscalingOption specifies the scaling of replicas identified by
26
+ # the given selection.
27
+ class AsymmetricAutoscalingOption
28
+ include Google::Apis::Core::Hashable
29
+
30
+ # Overrides the top-level autoscaling configuration for the replicas identified
31
+ # by `replica_selection`. All fields in this message are optional. Any
32
+ # unspecified fields will use the corresponding values from the top-level
33
+ # autoscaling configuration.
34
+ # Corresponds to the JSON property `overrides`
35
+ # @return [Google::Apis::SpannerV1::AutoscalingConfigOverrides]
36
+ attr_accessor :overrides
37
+
38
+ # ReplicaSelection identifies replicas with common properties.
39
+ # Corresponds to the JSON property `replicaSelection`
40
+ # @return [Google::Apis::SpannerV1::InstanceReplicaSelection]
41
+ attr_accessor :replica_selection
42
+
43
+ def initialize(**args)
44
+ update!(**args)
45
+ end
46
+
47
+ # Update properties of this object
48
+ def update!(**args)
49
+ @overrides = args[:overrides] if args.key?(:overrides)
50
+ @replica_selection = args[:replica_selection] if args.key?(:replica_selection)
51
+ end
52
+ end
53
+
54
+ # Autoscaling configuration for an instance.
55
+ class AutoscalingConfig
56
+ include Google::Apis::Core::Hashable
57
+
58
+ # Optional. Optional asymmetric autoscaling options. Replicas matching the
59
+ # replica selection criteria will be autoscaled independently from other
60
+ # replicas. The autoscaler will scale the replicas based on the utilization of
61
+ # replicas identified by the replica selection. Replica selections should not
62
+ # overlap with each other. Other replicas (those do not match any replica
63
+ # selection) will be autoscaled together and will have the same compute capacity
64
+ # allocated to them.
65
+ # Corresponds to the JSON property `asymmetricAutoscalingOptions`
66
+ # @return [Array<Google::Apis::SpannerV1::AsymmetricAutoscalingOption>]
67
+ attr_accessor :asymmetric_autoscaling_options
68
+
69
+ # The autoscaling limits for the instance. Users can define the minimum and
70
+ # maximum compute capacity allocated to the instance, and the autoscaler will
71
+ # only scale within that range. Users can either use nodes or processing units
72
+ # to specify the limits, but should use the same unit to set both the min_limit
73
+ # and max_limit.
74
+ # Corresponds to the JSON property `autoscalingLimits`
75
+ # @return [Google::Apis::SpannerV1::AutoscalingLimits]
76
+ attr_accessor :autoscaling_limits
77
+
78
+ # The autoscaling targets for an instance.
79
+ # Corresponds to the JSON property `autoscalingTargets`
80
+ # @return [Google::Apis::SpannerV1::AutoscalingTargets]
81
+ attr_accessor :autoscaling_targets
82
+
83
+ def initialize(**args)
84
+ update!(**args)
85
+ end
86
+
87
+ # Update properties of this object
88
+ def update!(**args)
89
+ @asymmetric_autoscaling_options = args[:asymmetric_autoscaling_options] if args.key?(:asymmetric_autoscaling_options)
90
+ @autoscaling_limits = args[:autoscaling_limits] if args.key?(:autoscaling_limits)
91
+ @autoscaling_targets = args[:autoscaling_targets] if args.key?(:autoscaling_targets)
92
+ end
93
+ end
94
+
95
+ # Overrides the top-level autoscaling configuration for the replicas identified
96
+ # by `replica_selection`. All fields in this message are optional. Any
97
+ # unspecified fields will use the corresponding values from the top-level
98
+ # autoscaling configuration.
99
+ class AutoscalingConfigOverrides
100
+ include Google::Apis::Core::Hashable
101
+
102
+ # The autoscaling limits for the instance. Users can define the minimum and
103
+ # maximum compute capacity allocated to the instance, and the autoscaler will
104
+ # only scale within that range. Users can either use nodes or processing units
105
+ # to specify the limits, but should use the same unit to set both the min_limit
106
+ # and max_limit.
107
+ # Corresponds to the JSON property `autoscalingLimits`
108
+ # @return [Google::Apis::SpannerV1::AutoscalingLimits]
109
+ attr_accessor :autoscaling_limits
110
+
111
+ # Optional. If specified, overrides the autoscaling target
112
+ # high_priority_cpu_utilization_percent in the top-level autoscaling
113
+ # configuration for the selected replicas.
114
+ # Corresponds to the JSON property `autoscalingTargetHighPriorityCpuUtilizationPercent`
115
+ # @return [Fixnum]
116
+ attr_accessor :autoscaling_target_high_priority_cpu_utilization_percent
117
+
118
+ def initialize(**args)
119
+ update!(**args)
120
+ end
121
+
122
+ # Update properties of this object
123
+ def update!(**args)
124
+ @autoscaling_limits = args[:autoscaling_limits] if args.key?(:autoscaling_limits)
125
+ @autoscaling_target_high_priority_cpu_utilization_percent = args[:autoscaling_target_high_priority_cpu_utilization_percent] if args.key?(:autoscaling_target_high_priority_cpu_utilization_percent)
126
+ end
127
+ end
128
+
129
+ # The autoscaling limits for the instance. Users can define the minimum and
130
+ # maximum compute capacity allocated to the instance, and the autoscaler will
131
+ # only scale within that range. Users can either use nodes or processing units
132
+ # to specify the limits, but should use the same unit to set both the min_limit
133
+ # and max_limit.
134
+ class AutoscalingLimits
135
+ include Google::Apis::Core::Hashable
136
+
137
+ # Maximum number of nodes allocated to the instance. If set, this number should
138
+ # be greater than or equal to min_nodes.
139
+ # Corresponds to the JSON property `maxNodes`
140
+ # @return [Fixnum]
141
+ attr_accessor :max_nodes
142
+
143
+ # Maximum number of processing units allocated to the instance. If set, this
144
+ # number should be multiples of 1000 and be greater than or equal to
145
+ # min_processing_units.
146
+ # Corresponds to the JSON property `maxProcessingUnits`
147
+ # @return [Fixnum]
148
+ attr_accessor :max_processing_units
149
+
150
+ # Minimum number of nodes allocated to the instance. If set, this number should
151
+ # be greater than or equal to 1.
152
+ # Corresponds to the JSON property `minNodes`
153
+ # @return [Fixnum]
154
+ attr_accessor :min_nodes
155
+
156
+ # Minimum number of processing units allocated to the instance. If set, this
157
+ # number should be multiples of 1000.
158
+ # Corresponds to the JSON property `minProcessingUnits`
159
+ # @return [Fixnum]
160
+ attr_accessor :min_processing_units
161
+
162
+ def initialize(**args)
163
+ update!(**args)
164
+ end
165
+
166
+ # Update properties of this object
167
+ def update!(**args)
168
+ @max_nodes = args[:max_nodes] if args.key?(:max_nodes)
169
+ @max_processing_units = args[:max_processing_units] if args.key?(:max_processing_units)
170
+ @min_nodes = args[:min_nodes] if args.key?(:min_nodes)
171
+ @min_processing_units = args[:min_processing_units] if args.key?(:min_processing_units)
172
+ end
173
+ end
174
+
175
+ # The autoscaling targets for an instance.
176
+ class AutoscalingTargets
177
+ include Google::Apis::Core::Hashable
178
+
179
+ # Required. The target high priority cpu utilization percentage that the
180
+ # autoscaler should be trying to achieve for the instance. This number is on a
181
+ # scale from 0 (no utilization) to 100 (full utilization). The valid range is [
182
+ # 10, 90] inclusive.
183
+ # Corresponds to the JSON property `highPriorityCpuUtilizationPercent`
184
+ # @return [Fixnum]
185
+ attr_accessor :high_priority_cpu_utilization_percent
186
+
187
+ # Required. The target storage utilization percentage that the autoscaler should
188
+ # be trying to achieve for the instance. This number is on a scale from 0 (no
189
+ # utilization) to 100 (full utilization). The valid range is [10, 99] inclusive.
190
+ # Corresponds to the JSON property `storageUtilizationPercent`
191
+ # @return [Fixnum]
192
+ attr_accessor :storage_utilization_percent
193
+
194
+ def initialize(**args)
195
+ update!(**args)
196
+ end
197
+
198
+ # Update properties of this object
199
+ def update!(**args)
200
+ @high_priority_cpu_utilization_percent = args[:high_priority_cpu_utilization_percent] if args.key?(:high_priority_cpu_utilization_percent)
201
+ @storage_utilization_percent = args[:storage_utilization_percent] if args.key?(:storage_utilization_percent)
202
+ end
203
+ end
204
+
25
205
  # A backup of a Cloud Spanner database.
26
206
  class Backup
27
207
  include Google::Apis::Core::Hashable
28
208
 
209
+ # Output only. List of backup schedule URIs that are associated with creating
210
+ # this backup. This is only applicable for scheduled backups, and is empty for
211
+ # on-demand backups. To optimize for storage, whenever possible, multiple
212
+ # schedules are collapsed together to create one backup. In such cases, this
213
+ # field captures the list of all backup schedule URIs that are associated with
214
+ # creating this backup. If collapsing is not done, then this field captures the
215
+ # single backup schedule URI associated with creating this backup.
216
+ # Corresponds to the JSON property `backupSchedules`
217
+ # @return [Array<String>]
218
+ attr_accessor :backup_schedules
219
+
29
220
  # Output only. The time the CreateBackup request is received. If the request
30
221
  # does not specify `version_time`, the `version_time` of the backup will be
31
222
  # equivalent to the `create_time`.
@@ -50,6 +241,27 @@ module Google
50
241
  # @return [Google::Apis::SpannerV1::EncryptionInfo]
51
242
  attr_accessor :encryption_info
52
243
 
244
+ # Output only. The encryption information for the backup, whether it is
245
+ # protected by one or more KMS keys. The information includes all Cloud KMS key
246
+ # versions used to encrypt the backup. The `encryption_status` field inside of
247
+ # each `EncryptionInfo` is not populated. At least one of the key versions must
248
+ # be available for the backup to be restored. If a key version is revoked in the
249
+ # middle of a restore, the restore behavior is undefined.
250
+ # Corresponds to the JSON property `encryptionInformation`
251
+ # @return [Array<Google::Apis::SpannerV1::EncryptionInfo>]
252
+ attr_accessor :encryption_information
253
+
254
+ # Output only. For a backup in an incremental backup chain, this is the storage
255
+ # space needed to keep the data that has changed since the previous backup. For
256
+ # all other backups, this is always the size of the backup. This value may
257
+ # change if backups on the same chain get deleted or expired. This field can be
258
+ # used to calculate the total storage space used by a set of backups. For
259
+ # example, the total space used by all backups of a database can be computed by
260
+ # summing up this field.
261
+ # Corresponds to the JSON property `exclusiveSizeBytes`
262
+ # @return [Fixnum]
263
+ attr_accessor :exclusive_size_bytes
264
+
53
265
  # Required for the CreateBackup operation. The expiration time of the backup,
54
266
  # with microseconds granularity that must be at least 6 hours and at most 366
55
267
  # days from the time the CreateBackup request is processed. Once the `
@@ -59,6 +271,25 @@ module Google
59
271
  # @return [String]
60
272
  attr_accessor :expire_time
61
273
 
274
+ # Output only. The number of bytes that will be freed by deleting this backup.
275
+ # This value will be zero if, for example, this backup is part of an incremental
276
+ # backup chain and younger backups in the chain require that we keep its data.
277
+ # For backups not in an incremental backup chain, this is always the size of the
278
+ # backup. This value may change if backups on the same chain get created,
279
+ # deleted or expired.
280
+ # Corresponds to the JSON property `freeableSizeBytes`
281
+ # @return [Fixnum]
282
+ attr_accessor :freeable_size_bytes
283
+
284
+ # Output only. Populated only for backups in an incremental backup chain.
285
+ # Backups share the same chain id if and only if they belong to the same
286
+ # incremental backup chain. Use this field to determine which backups are part
287
+ # of the same incremental backup chain. The ordering of backups in the chain can
288
+ # be determined by ordering the backup `version_time`.
289
+ # Corresponds to the JSON property `incrementalBackupChainId`
290
+ # @return [String]
291
+ attr_accessor :incremental_backup_chain_id
292
+
62
293
  # Output only. The max allowed expiration time of the backup, with microseconds
63
294
  # granularity. A backup's expiration time can be configured in multiple APIs:
64
295
  # CreateBackup, UpdateBackup, CopyBackup. When updating or copying an existing
@@ -79,6 +310,16 @@ module Google
79
310
  # @return [String]
80
311
  attr_accessor :name
81
312
 
313
+ # Output only. Data deleted at a time older than this is guaranteed not to be
314
+ # retained in order to support this backup. For a backup in an incremental
315
+ # backup chain, this is the version time of the oldest backup that exists or
316
+ # ever existed in the chain. For all other backups, this is the version time of
317
+ # the backup. This field can be used to understand what data is being retained
318
+ # by the backup system.
319
+ # Corresponds to the JSON property `oldestVersionTime`
320
+ # @return [String]
321
+ attr_accessor :oldest_version_time
322
+
82
323
  # Output only. The names of the destination backups being created by copying
83
324
  # this source backup. The backup names are of the form `projects//instances//
84
325
  # backups/`. Referencing backups may exist in different instances. The existence
@@ -99,7 +340,9 @@ module Google
99
340
  # @return [Array<String>]
100
341
  attr_accessor :referencing_databases
101
342
 
102
- # Output only. Size of the backup in bytes.
343
+ # Output only. Size of the backup in bytes. For a backup in an incremental
344
+ # backup chain, this is the sum of the `exclusive_size_bytes` of itself and all
345
+ # older backups in the chain.
103
346
  # Corresponds to the JSON property `sizeBytes`
104
347
  # @return [Fixnum]
105
348
  attr_accessor :size_bytes
@@ -122,13 +365,19 @@ module Google
122
365
 
123
366
  # Update properties of this object
124
367
  def update!(**args)
368
+ @backup_schedules = args[:backup_schedules] if args.key?(:backup_schedules)
125
369
  @create_time = args[:create_time] if args.key?(:create_time)
126
370
  @database = args[:database] if args.key?(:database)
127
371
  @database_dialect = args[:database_dialect] if args.key?(:database_dialect)
128
372
  @encryption_info = args[:encryption_info] if args.key?(:encryption_info)
373
+ @encryption_information = args[:encryption_information] if args.key?(:encryption_information)
374
+ @exclusive_size_bytes = args[:exclusive_size_bytes] if args.key?(:exclusive_size_bytes)
129
375
  @expire_time = args[:expire_time] if args.key?(:expire_time)
376
+ @freeable_size_bytes = args[:freeable_size_bytes] if args.key?(:freeable_size_bytes)
377
+ @incremental_backup_chain_id = args[:incremental_backup_chain_id] if args.key?(:incremental_backup_chain_id)
130
378
  @max_expire_time = args[:max_expire_time] if args.key?(:max_expire_time)
131
379
  @name = args[:name] if args.key?(:name)
380
+ @oldest_version_time = args[:oldest_version_time] if args.key?(:oldest_version_time)
132
381
  @referencing_backups = args[:referencing_backups] if args.key?(:referencing_backups)
133
382
  @referencing_databases = args[:referencing_databases] if args.key?(:referencing_databases)
134
383
  @size_bytes = args[:size_bytes] if args.key?(:size_bytes)
@@ -177,6 +426,95 @@ module Google
177
426
  end
178
427
  end
179
428
 
429
+ # BackupSchedule expresses the automated backup creation specification for a
430
+ # Spanner database.
431
+ class BackupSchedule
432
+ include Google::Apis::Core::Hashable
433
+
434
+ # Encryption configuration for the backup to create.
435
+ # Corresponds to the JSON property `encryptionConfig`
436
+ # @return [Google::Apis::SpannerV1::CreateBackupEncryptionConfig]
437
+ attr_accessor :encryption_config
438
+
439
+ # The specification for full backups. A full backup stores the entire contents
440
+ # of the database at a given version time.
441
+ # Corresponds to the JSON property `fullBackupSpec`
442
+ # @return [Google::Apis::SpannerV1::FullBackupSpec]
443
+ attr_accessor :full_backup_spec
444
+
445
+ # The specification for incremental backup chains. An incremental backup stores
446
+ # the delta of changes between a previous backup and the database contents at a
447
+ # given version time. An incremental backup chain consists of a full backup and
448
+ # zero or more successive incremental backups. The first backup created for an
449
+ # incremental backup chain is always a full backup.
450
+ # Corresponds to the JSON property `incrementalBackupSpec`
451
+ # @return [Google::Apis::SpannerV1::IncrementalBackupSpec]
452
+ attr_accessor :incremental_backup_spec
453
+
454
+ # Identifier. Output only for the CreateBackupSchedule operation. Required for
455
+ # the UpdateBackupSchedule operation. A globally unique identifier for the
456
+ # backup schedule which cannot be changed. Values are of the form `projects//
457
+ # instances//databases//backupSchedules/a-z*[a-z0-9]` The final segment of the
458
+ # name must be between 2 and 60 characters in length.
459
+ # Corresponds to the JSON property `name`
460
+ # @return [String]
461
+ attr_accessor :name
462
+
463
+ # Optional. The retention duration of a backup that must be at least 6 hours and
464
+ # at most 366 days. The backup is eligible to be automatically deleted once the
465
+ # retention period has elapsed.
466
+ # Corresponds to the JSON property `retentionDuration`
467
+ # @return [String]
468
+ attr_accessor :retention_duration
469
+
470
+ # Defines specifications of the backup schedule.
471
+ # Corresponds to the JSON property `spec`
472
+ # @return [Google::Apis::SpannerV1::BackupScheduleSpec]
473
+ attr_accessor :spec
474
+
475
+ # Output only. The timestamp at which the schedule was last updated. If the
476
+ # schedule has never been updated, this field contains the timestamp when the
477
+ # schedule was first created.
478
+ # Corresponds to the JSON property `updateTime`
479
+ # @return [String]
480
+ attr_accessor :update_time
481
+
482
+ def initialize(**args)
483
+ update!(**args)
484
+ end
485
+
486
+ # Update properties of this object
487
+ def update!(**args)
488
+ @encryption_config = args[:encryption_config] if args.key?(:encryption_config)
489
+ @full_backup_spec = args[:full_backup_spec] if args.key?(:full_backup_spec)
490
+ @incremental_backup_spec = args[:incremental_backup_spec] if args.key?(:incremental_backup_spec)
491
+ @name = args[:name] if args.key?(:name)
492
+ @retention_duration = args[:retention_duration] if args.key?(:retention_duration)
493
+ @spec = args[:spec] if args.key?(:spec)
494
+ @update_time = args[:update_time] if args.key?(:update_time)
495
+ end
496
+ end
497
+
498
+ # Defines specifications of the backup schedule.
499
+ class BackupScheduleSpec
500
+ include Google::Apis::Core::Hashable
501
+
502
+ # CrontabSpec can be used to specify the version time and frequency at which the
503
+ # backup should be created.
504
+ # Corresponds to the JSON property `cronSpec`
505
+ # @return [Google::Apis::SpannerV1::CrontabSpec]
506
+ attr_accessor :cron_spec
507
+
508
+ def initialize(**args)
509
+ update!(**args)
510
+ end
511
+
512
+ # Update properties of this object
513
+ def update!(**args)
514
+ @cron_spec = args[:cron_spec] if args.key?(:cron_spec)
515
+ end
516
+ end
517
+
180
518
  # The request for BatchCreateSessions.
181
519
  class BatchCreateSessionsRequest
182
520
  include Google::Apis::Core::Hashable
@@ -224,10 +562,95 @@ module Google
224
562
  end
225
563
  end
226
564
 
565
+ # The request for BatchWrite.
566
+ class BatchWriteRequest
567
+ include Google::Apis::Core::Hashable
568
+
569
+ # Optional. When `exclude_txn_from_change_streams` is set to `true`: *
570
+ # Modifications from all transactions in this batch write operation will not be
571
+ # recorded in change streams with DDL option `allow_txn_exclusion=true` that are
572
+ # tracking columns modified by these transactions. * Modifications from all
573
+ # transactions in this batch write operation will be recorded in change streams
574
+ # with DDL option `allow_txn_exclusion=false or not set` that are tracking
575
+ # columns modified by these transactions. When `exclude_txn_from_change_streams`
576
+ # is set to `false` or not set, Modifications from all transactions in this
577
+ # batch write operation will be recorded in all change streams that are tracking
578
+ # columns modified by these transactions.
579
+ # Corresponds to the JSON property `excludeTxnFromChangeStreams`
580
+ # @return [Boolean]
581
+ attr_accessor :exclude_txn_from_change_streams
582
+ alias_method :exclude_txn_from_change_streams?, :exclude_txn_from_change_streams
583
+
584
+ # Required. The groups of mutations to be applied.
585
+ # Corresponds to the JSON property `mutationGroups`
586
+ # @return [Array<Google::Apis::SpannerV1::MutationGroup>]
587
+ attr_accessor :mutation_groups
588
+
589
+ # Common request options for various APIs.
590
+ # Corresponds to the JSON property `requestOptions`
591
+ # @return [Google::Apis::SpannerV1::RequestOptions]
592
+ attr_accessor :request_options
593
+
594
+ def initialize(**args)
595
+ update!(**args)
596
+ end
597
+
598
+ # Update properties of this object
599
+ def update!(**args)
600
+ @exclude_txn_from_change_streams = args[:exclude_txn_from_change_streams] if args.key?(:exclude_txn_from_change_streams)
601
+ @mutation_groups = args[:mutation_groups] if args.key?(:mutation_groups)
602
+ @request_options = args[:request_options] if args.key?(:request_options)
603
+ end
604
+ end
605
+
606
+ # The result of applying a batch of mutations.
607
+ class BatchWriteResponse
608
+ include Google::Apis::Core::Hashable
609
+
610
+ # The commit timestamp of the transaction that applied this batch. Present if `
611
+ # status` is `OK`, absent otherwise.
612
+ # Corresponds to the JSON property `commitTimestamp`
613
+ # @return [String]
614
+ attr_accessor :commit_timestamp
615
+
616
+ # The mutation groups applied in this batch. The values index into the `
617
+ # mutation_groups` field in the corresponding `BatchWriteRequest`.
618
+ # Corresponds to the JSON property `indexes`
619
+ # @return [Array<Fixnum>]
620
+ attr_accessor :indexes
621
+
622
+ # The `Status` type defines a logical error model that is suitable for different
623
+ # programming environments, including REST APIs and RPC APIs. It is used by [
624
+ # gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
625
+ # data: error code, error message, and error details. You can find out more
626
+ # about this error model and how to work with it in the [API Design Guide](https:
627
+ # //cloud.google.com/apis/design/errors).
628
+ # Corresponds to the JSON property `status`
629
+ # @return [Google::Apis::SpannerV1::Status]
630
+ attr_accessor :status
631
+
632
+ def initialize(**args)
633
+ update!(**args)
634
+ end
635
+
636
+ # Update properties of this object
637
+ def update!(**args)
638
+ @commit_timestamp = args[:commit_timestamp] if args.key?(:commit_timestamp)
639
+ @indexes = args[:indexes] if args.key?(:indexes)
640
+ @status = args[:status] if args.key?(:status)
641
+ end
642
+ end
643
+
227
644
  # The request for BeginTransaction.
228
645
  class BeginTransactionRequest
229
646
  include Google::Apis::Core::Hashable
230
647
 
648
+ # A modification to one or more Cloud Spanner rows. Mutations can be applied to
649
+ # a Cloud Spanner database by sending them in a Commit call.
650
+ # Corresponds to the JSON property `mutationKey`
651
+ # @return [Google::Apis::SpannerV1::Mutation]
652
+ attr_accessor :mutation_key
653
+
231
654
  # Transactions: Each session can have at most one active transaction at a time (
232
655
  # note that standalone reads and queries use a transaction internally and do
233
656
  # count towards the one transaction limit). After the active transaction is
@@ -244,7 +667,7 @@ module Google
244
667
  # such that the read is guaranteed to see the effects of all transactions that
245
668
  # have committed before the start of the read). Snapshot read-only transactions
246
669
  # do not need to be committed. Queries on change streams must be performed with
247
- # the snapshot read-only transaction mode, specifying a strong read. Please see
670
+ # the snapshot read-only transaction mode, specifying a strong read. See
248
671
  # TransactionOptions.ReadOnly.strong for more details. 3. Partitioned DML. This
249
672
  # type of transaction is used to execute a single Partitioned DML statement.
250
673
  # Partitioned DML partitions the key space and runs the DML statement over each
@@ -280,87 +703,92 @@ module Google
280
703
  # committing the retry, the client should execute the retry in the same session
281
704
  # as the original attempt. The original session's lock priority increases with
282
705
  # each consecutive abort, meaning that each attempt has a slightly better chance
283
- # of success than the previous. Under some circumstances (for example, many
284
- # transactions attempting to modify the same row(s)), a transaction can abort
285
- # many times in a short period before successfully committing. Thus, it is not a
286
- # good idea to cap the number of retries a transaction can attempt; instead, it
287
- # is better to limit the total amount of time spent retrying. Idle transactions:
288
- # A transaction is considered idle if it has no outstanding reads or SQL queries
289
- # and has not started a read or SQL query within the last 10 seconds. Idle
290
- # transactions can be aborted by Cloud Spanner so that they don't hold on to
291
- # locks indefinitely. If an idle transaction is aborted, the commit will fail
292
- # with error `ABORTED`. If this behavior is undesirable, periodically executing
293
- # a simple SQL query in the transaction (for example, `SELECT 1`) prevents the
294
- # transaction from becoming idle. Snapshot read-only transactions: Snapshot read-
295
- # only transactions provides a simpler method than locking read-write
296
- # transactions for doing several consistent reads. However, this type of
297
- # transaction does not support writes. Snapshot transactions do not take locks.
298
- # Instead, they work by choosing a Cloud Spanner timestamp, then executing all
299
- # reads at that timestamp. Since they do not acquire locks, they do not block
300
- # concurrent read-write transactions. Unlike locking read-write transactions,
301
- # snapshot read-only transactions never abort. They can fail if the chosen read
302
- # timestamp is garbage collected; however, the default garbage collection policy
303
- # is generous enough that most applications do not need to worry about this in
304
- # practice. Snapshot read-only transactions do not need to call Commit or
305
- # Rollback (and in fact are not permitted to do so). To execute a snapshot
306
- # transaction, the client specifies a timestamp bound, which tells Cloud Spanner
307
- # how to choose a read timestamp. The types of timestamp bound are: - Strong (
308
- # the default). - Bounded staleness. - Exact staleness. If the Cloud Spanner
309
- # database to be read is geographically distributed, stale read-only
310
- # transactions can execute more quickly than strong or read-write transactions,
311
- # because they are able to execute far from the leader replica. Each type of
312
- # timestamp bound is discussed in detail below. Strong: Strong reads are
313
- # guaranteed to see the effects of all transactions that have committed before
314
- # the start of the read. Furthermore, all rows yielded by a single read are
315
- # consistent with each other -- if any part of the read observes a transaction,
316
- # all parts of the read see the transaction. Strong reads are not repeatable:
317
- # two consecutive strong read-only transactions might return inconsistent
318
- # results if there are concurrent writes. If consistency across reads is
319
- # required, the reads should be executed within a transaction or at an exact
320
- # read timestamp. Queries on change streams (see below for more details) must
321
- # also specify the strong read timestamp bound. See TransactionOptions.ReadOnly.
322
- # strong. Exact staleness: These timestamp bounds execute reads at a user-
323
- # specified timestamp. Reads at a timestamp are guaranteed to see a consistent
324
- # prefix of the global transaction history: they observe modifications done by
325
- # all transactions with a commit timestamp less than or equal to the read
326
- # timestamp, and observe none of the modifications done by transactions with a
327
- # larger commit timestamp. They will block until all conflicting transactions
328
- # that may be assigned commit timestamps <= the read timestamp have finished.
329
- # The timestamp can either be expressed as an absolute Cloud Spanner commit
330
- # timestamp or a staleness relative to the current time. These modes do not
331
- # require a "negotiation phase" to pick a timestamp. As a result, they execute
332
- # slightly faster than the equivalent boundedly stale concurrency modes. On the
333
- # other hand, boundedly stale reads usually return fresher results. See
334
- # TransactionOptions.ReadOnly.read_timestamp and TransactionOptions.ReadOnly.
335
- # exact_staleness. Bounded staleness: Bounded staleness modes allow Cloud
336
- # Spanner to pick the read timestamp, subject to a user-provided staleness bound.
337
- # Cloud Spanner chooses the newest timestamp within the staleness bound that
338
- # allows execution of the reads at the closest available replica without
339
- # blocking. All rows yielded are consistent with each other -- if any part of
340
- # the read observes a transaction, all parts of the read see the transaction.
341
- # Boundedly stale reads are not repeatable: two stale reads, even if they use
342
- # the same staleness bound, can execute at different timestamps and thus return
343
- # inconsistent results. Boundedly stale reads execute in two phases: the first
344
- # phase negotiates a timestamp among all replicas needed to serve the read. In
345
- # the second phase, reads are executed at the negotiated timestamp. As a result
346
- # of the two phase execution, bounded staleness reads are usually a little
347
- # slower than comparable exact staleness reads. However, they are typically able
348
- # to return fresher results, and are more likely to execute at the closest
349
- # replica. Because the timestamp negotiation requires up-front knowledge of
350
- # which rows will be read, it can only be used with single-use read-only
351
- # transactions. See TransactionOptions.ReadOnly.max_staleness and
352
- # TransactionOptions.ReadOnly.min_read_timestamp. Old read timestamps and
353
- # garbage collection: Cloud Spanner continuously garbage collects deleted and
354
- # overwritten data in the background to reclaim storage space. This process is
355
- # known as "version GC". By default, version GC reclaims versions after they are
356
- # one hour old. Because of this, Cloud Spanner cannot perform reads at read
357
- # timestamps more than one hour in the past. This restriction also applies to in-
358
- # progress reads and/or SQL queries whose timestamp become too old while
359
- # executing. Reads and SQL queries with too-old read timestamps fail with the
360
- # error `FAILED_PRECONDITION`. You can configure and extend the `
361
- # VERSION_RETENTION_PERIOD` of a database up to a period as long as one week,
362
- # which allows Cloud Spanner to perform reads up to one week in the past.
363
- # Querying change Streams: A Change Stream is a schema object that can be
706
+ # of success than the previous. Note that the lock priority is preserved per
707
+ # session (not per transaction). Lock priority is set by the first read or write
708
+ # in the first attempt of a read-write transaction. If the application starts a
709
+ # new session to retry the whole transaction, the transaction loses its original
710
+ # lock priority. Moreover, the lock priority is only preserved if the
711
+ # transaction fails with an `ABORTED` error. Under some circumstances (for
712
+ # example, many transactions attempting to modify the same row(s)), a
713
+ # transaction can abort many times in a short period before successfully
714
+ # committing. Thus, it is not a good idea to cap the number of retries a
715
+ # transaction can attempt; instead, it is better to limit the total amount of
716
+ # time spent retrying. Idle transactions: A transaction is considered idle if it
717
+ # has no outstanding reads or SQL queries and has not started a read or SQL
718
+ # query within the last 10 seconds. Idle transactions can be aborted by Cloud
719
+ # Spanner so that they don't hold on to locks indefinitely. If an idle
720
+ # transaction is aborted, the commit will fail with error `ABORTED`. If this
721
+ # behavior is undesirable, periodically executing a simple SQL query in the
722
+ # transaction (for example, `SELECT 1`) prevents the transaction from becoming
723
+ # idle. Snapshot read-only transactions: Snapshot read-only transactions
724
+ # provides a simpler method than locking read-write transactions for doing
725
+ # several consistent reads. However, this type of transaction does not support
726
+ # writes. Snapshot transactions do not take locks. Instead, they work by
727
+ # choosing a Cloud Spanner timestamp, then executing all reads at that timestamp.
728
+ # Since they do not acquire locks, they do not block concurrent read-write
729
+ # transactions. Unlike locking read-write transactions, snapshot read-only
730
+ # transactions never abort. They can fail if the chosen read timestamp is
731
+ # garbage collected; however, the default garbage collection policy is generous
732
+ # enough that most applications do not need to worry about this in practice.
733
+ # Snapshot read-only transactions do not need to call Commit or Rollback (and in
734
+ # fact are not permitted to do so). To execute a snapshot transaction, the
735
+ # client specifies a timestamp bound, which tells Cloud Spanner how to choose a
736
+ # read timestamp. The types of timestamp bound are: - Strong (the default). -
737
+ # Bounded staleness. - Exact staleness. If the Cloud Spanner database to be read
738
+ # is geographically distributed, stale read-only transactions can execute more
739
+ # quickly than strong or read-write transactions, because they are able to
740
+ # execute far from the leader replica. Each type of timestamp bound is discussed
741
+ # in detail below. Strong: Strong reads are guaranteed to see the effects of all
742
+ # transactions that have committed before the start of the read. Furthermore,
743
+ # all rows yielded by a single read are consistent with each other -- if any
744
+ # part of the read observes a transaction, all parts of the read see the
745
+ # transaction. Strong reads are not repeatable: two consecutive strong read-only
746
+ # transactions might return inconsistent results if there are concurrent writes.
747
+ # If consistency across reads is required, the reads should be executed within a
748
+ # transaction or at an exact read timestamp. Queries on change streams (see
749
+ # below for more details) must also specify the strong read timestamp bound. See
750
+ # TransactionOptions.ReadOnly.strong. Exact staleness: These timestamp bounds
751
+ # execute reads at a user-specified timestamp. Reads at a timestamp are
752
+ # guaranteed to see a consistent prefix of the global transaction history: they
753
+ # observe modifications done by all transactions with a commit timestamp less
754
+ # than or equal to the read timestamp, and observe none of the modifications
755
+ # done by transactions with a larger commit timestamp. They will block until all
756
+ # conflicting transactions that may be assigned commit timestamps <= the read
757
+ # timestamp have finished. The timestamp can either be expressed as an absolute
758
+ # Cloud Spanner commit timestamp or a staleness relative to the current time.
759
+ # These modes do not require a "negotiation phase" to pick a timestamp. As a
760
+ # result, they execute slightly faster than the equivalent boundedly stale
761
+ # concurrency modes. On the other hand, boundedly stale reads usually return
762
+ # fresher results. See TransactionOptions.ReadOnly.read_timestamp and
763
+ # TransactionOptions.ReadOnly.exact_staleness. Bounded staleness: Bounded
764
+ # staleness modes allow Cloud Spanner to pick the read timestamp, subject to a
765
+ # user-provided staleness bound. Cloud Spanner chooses the newest timestamp
766
+ # within the staleness bound that allows execution of the reads at the closest
767
+ # available replica without blocking. All rows yielded are consistent with each
768
+ # other -- if any part of the read observes a transaction, all parts of the read
769
+ # see the transaction. Boundedly stale reads are not repeatable: two stale reads,
770
+ # even if they use the same staleness bound, can execute at different
771
+ # timestamps and thus return inconsistent results. Boundedly stale reads execute
772
+ # in two phases: the first phase negotiates a timestamp among all replicas
773
+ # needed to serve the read. In the second phase, reads are executed at the
774
+ # negotiated timestamp. As a result of the two phase execution, bounded
775
+ # staleness reads are usually a little slower than comparable exact staleness
776
+ # reads. However, they are typically able to return fresher results, and are
777
+ # more likely to execute at the closest replica. Because the timestamp
778
+ # negotiation requires up-front knowledge of which rows will be read, it can
779
+ # only be used with single-use read-only transactions. See TransactionOptions.
780
+ # ReadOnly.max_staleness and TransactionOptions.ReadOnly.min_read_timestamp. Old
781
+ # read timestamps and garbage collection: Cloud Spanner continuously garbage
782
+ # collects deleted and overwritten data in the background to reclaim storage
783
+ # space. This process is known as "version GC". By default, version GC reclaims
784
+ # versions after they are one hour old. Because of this, Cloud Spanner cannot
785
+ # perform reads at read timestamps more than one hour in the past. This
786
+ # restriction also applies to in-progress reads and/or SQL queries whose
787
+ # timestamp become too old while executing. Reads and SQL queries with too-old
788
+ # read timestamps fail with the error `FAILED_PRECONDITION`. You can configure
789
+ # and extend the `VERSION_RETENTION_PERIOD` of a database up to a period as long
790
+ # as one week, which allows Cloud Spanner to perform reads up to one week in the
791
+ # past. Querying change Streams: A Change Stream is a schema object that can be
364
792
  # configured to watch data changes on the entire database, a set of tables, or a
365
793
  # set of columns in a database. When a change stream is created, Spanner
366
794
  # automatically defines a corresponding SQL Table-Valued Function (TVF) that can
@@ -396,12 +824,12 @@ module Google
396
824
  # of the table. Rather, the statement is applied atomically to partitions of the
397
825
  # table, in independent transactions. Secondary index rows are updated
398
826
  # atomically with the base table rows. - Partitioned DML does not guarantee
399
- # exactly-once execution semantics against a partition. The statement will be
400
- # applied at least once to each partition. It is strongly recommended that the
401
- # DML statement should be idempotent to avoid unexpected results. For instance,
402
- # it is potentially dangerous to run a statement such as `UPDATE table SET
403
- # column = column + 1` as it could be run multiple times against some rows. -
404
- # The partitions are committed automatically - there is no support for Commit or
827
+ # exactly-once execution semantics against a partition. The statement is applied
828
+ # at least once to each partition. It is strongly recommended that the DML
829
+ # statement should be idempotent to avoid unexpected results. For instance, it
830
+ # is potentially dangerous to run a statement such as `UPDATE table SET column =
831
+ # column + 1` as it could be run multiple times against some rows. - The
832
+ # partitions are committed automatically - there is no support for Commit or
405
833
  # Rollback. If the call returns an error, or if the client issuing the
406
834
  # ExecuteSql call dies, it is possible that some rows had the statement executed
407
835
  # on them successfully. It is also possible that statement was never executed
@@ -430,6 +858,7 @@ module Google
430
858
 
431
859
  # Update properties of this object
432
860
  def update!(**args)
861
+ @mutation_key = args[:mutation_key] if args.key?(:mutation_key)
433
862
  @options = args[:options] if args.key?(:options)
434
863
  @request_options = args[:request_options] if args.key?(:request_options)
435
864
  end
@@ -462,37 +891,64 @@ module Google
462
891
  # members` can have the following values: * `allUsers`: A special identifier
463
892
  # that represents anyone who is on the internet; with or without a Google
464
893
  # account. * `allAuthenticatedUsers`: A special identifier that represents
465
- # anyone who is authenticated with a Google account or a service account. * `
466
- # user:`emailid``: An email address that represents a specific Google account.
467
- # For example, `alice@example.com` . * `serviceAccount:`emailid``: An email
468
- # address that represents a Google service account. For example, `my-other-app@
469
- # appspot.gserviceaccount.com`. * `serviceAccount:`projectid`.svc.id.goog[`
470
- # namespace`/`kubernetes-sa`]`: An identifier for a [Kubernetes service account](
471
- # https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-
472
- # accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`
473
- # . * `group:`emailid``: An email address that represents a Google group. For
474
- # example, `admins@example.com`. * `deleted:user:`emailid`?uid=`uniqueid``: An
475
- # email address (plus unique identifier) representing a user that has been
476
- # recently deleted. For example, `alice@example.com?uid=123456789012345678901`.
477
- # If the user is recovered, this value reverts to `user:`emailid`` and the
478
- # recovered user retains the role in the binding. * `deleted:serviceAccount:`
479
- # emailid`?uid=`uniqueid``: An email address (plus unique identifier)
480
- # representing a service account that has been recently deleted. For example, `
481
- # my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
482
- # service account is undeleted, this value reverts to `serviceAccount:`emailid``
483
- # and the undeleted service account retains the role in the binding. * `deleted:
484
- # group:`emailid`?uid=`uniqueid``: An email address (plus unique identifier)
485
- # representing a Google group that has been recently deleted. For example, `
486
- # admins@example.com?uid=123456789012345678901`. If the group is recovered, this
487
- # value reverts to `group:`emailid`` and the recovered group retains the role in
488
- # the binding. * `domain:`domain``: The G Suite domain (primary) that represents
489
- # all the users of that domain. For example, `google.com` or `example.com`.
894
+ # anyone who is authenticated with a Google account or a service account. Does
895
+ # not include identities that come from external identity providers (IdPs)
896
+ # through identity federation. * `user:`emailid``: An email address that
897
+ # represents a specific Google account. For example, `alice@example.com` . * `
898
+ # serviceAccount:`emailid``: An email address that represents a Google service
899
+ # account. For example, `my-other-app@appspot.gserviceaccount.com`. * `
900
+ # serviceAccount:`projectid`.svc.id.goog[`namespace`/`kubernetes-sa`]`: An
901
+ # identifier for a [Kubernetes service account](https://cloud.google.com/
902
+ # kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-
903
+ # project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:`emailid``: An
904
+ # email address that represents a Google group. For example, `admins@example.com`
905
+ # . * `domain:`domain``: The G Suite domain (primary) that represents all the
906
+ # users of that domain. For example, `google.com` or `example.com`. * `principal:
907
+ # //iam.googleapis.com/locations/global/workforcePools/`pool_id`/subject/`
908
+ # subject_attribute_value``: A single identity in a workforce identity pool. * `
909
+ # principalSet://iam.googleapis.com/locations/global/workforcePools/`pool_id`/
910
+ # group/`group_id``: All workforce identities in a group. * `principalSet://iam.
911
+ # googleapis.com/locations/global/workforcePools/`pool_id`/attribute.`
912
+ # attribute_name`/`attribute_value``: All workforce identities with a specific
913
+ # attribute value. * `principalSet://iam.googleapis.com/locations/global/
914
+ # workforcePools/`pool_id`/*`: All identities in a workforce identity pool. * `
915
+ # principal://iam.googleapis.com/projects/`project_number`/locations/global/
916
+ # workloadIdentityPools/`pool_id`/subject/`subject_attribute_value``: A single
917
+ # identity in a workload identity pool. * `principalSet://iam.googleapis.com/
918
+ # projects/`project_number`/locations/global/workloadIdentityPools/`pool_id`/
919
+ # group/`group_id``: A workload identity pool group. * `principalSet://iam.
920
+ # googleapis.com/projects/`project_number`/locations/global/
921
+ # workloadIdentityPools/`pool_id`/attribute.`attribute_name`/`attribute_value``:
922
+ # All identities in a workload identity pool with a certain attribute. * `
923
+ # principalSet://iam.googleapis.com/projects/`project_number`/locations/global/
924
+ # workloadIdentityPools/`pool_id`/*`: All identities in a workload identity pool.
925
+ # * `deleted:user:`emailid`?uid=`uniqueid``: An email address (plus unique
926
+ # identifier) representing a user that has been recently deleted. For example, `
927
+ # alice@example.com?uid=123456789012345678901`. If the user is recovered, this
928
+ # value reverts to `user:`emailid`` and the recovered user retains the role in
929
+ # the binding. * `deleted:serviceAccount:`emailid`?uid=`uniqueid``: An email
930
+ # address (plus unique identifier) representing a service account that has been
931
+ # recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=
932
+ # 123456789012345678901`. If the service account is undeleted, this value
933
+ # reverts to `serviceAccount:`emailid`` and the undeleted service account
934
+ # retains the role in the binding. * `deleted:group:`emailid`?uid=`uniqueid``:
935
+ # An email address (plus unique identifier) representing a Google group that has
936
+ # been recently deleted. For example, `admins@example.com?uid=
937
+ # 123456789012345678901`. If the group is recovered, this value reverts to `
938
+ # group:`emailid`` and the recovered group retains the role in the binding. * `
939
+ # deleted:principal://iam.googleapis.com/locations/global/workforcePools/`
940
+ # pool_id`/subject/`subject_attribute_value``: Deleted single identity in a
941
+ # workforce identity pool. For example, `deleted:principal://iam.googleapis.com/
942
+ # locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`.
490
943
  # Corresponds to the JSON property `members`
491
944
  # @return [Array<String>]
492
945
  attr_accessor :members
493
946
 
494
947
  # Role that is assigned to the list of `members`, or principals. For example, `
495
- # roles/viewer`, `roles/editor`, or `roles/owner`.
948
+ # roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM
949
+ # roles and permissions, see the [IAM documentation](https://cloud.google.com/
950
+ # iam/docs/roles-overview). For a list of the available pre-defined roles, see [
951
+ # here](https://cloud.google.com/iam/docs/understanding-roles).
496
952
  # Corresponds to the JSON property `role`
497
953
  # @return [String]
498
954
  attr_accessor :role
@@ -509,6 +965,74 @@ module Google
509
965
  end
510
966
  end
511
967
 
968
+ # Metadata type for the long-running operation returned by ChangeQuorum.
969
+ class ChangeQuorumMetadata
970
+ include Google::Apis::Core::Hashable
971
+
972
+ # If set, the time at which this operation failed or was completed successfully.
973
+ # Corresponds to the JSON property `endTime`
974
+ # @return [String]
975
+ attr_accessor :end_time
976
+
977
+ # The request for ChangeQuorum.
978
+ # Corresponds to the JSON property `request`
979
+ # @return [Google::Apis::SpannerV1::ChangeQuorumRequest]
980
+ attr_accessor :request
981
+
982
+ # Time the request was received.
983
+ # Corresponds to the JSON property `startTime`
984
+ # @return [String]
985
+ attr_accessor :start_time
986
+
987
+ def initialize(**args)
988
+ update!(**args)
989
+ end
990
+
991
+ # Update properties of this object
992
+ def update!(**args)
993
+ @end_time = args[:end_time] if args.key?(:end_time)
994
+ @request = args[:request] if args.key?(:request)
995
+ @start_time = args[:start_time] if args.key?(:start_time)
996
+ end
997
+ end
998
+
999
+ # The request for ChangeQuorum.
1000
+ class ChangeQuorumRequest
1001
+ include Google::Apis::Core::Hashable
1002
+
1003
+ # Optional. The etag is the hash of the `QuorumInfo`. The `ChangeQuorum`
1004
+ # operation is only performed if the etag matches that of the `QuorumInfo` in
1005
+ # the current database resource. Otherwise the API returns an `ABORTED` error.
1006
+ # The etag is used for optimistic concurrency control as a way to help prevent
1007
+ # simultaneous change quorum requests that could create a race condition.
1008
+ # Corresponds to the JSON property `etag`
1009
+ # @return [String]
1010
+ attr_accessor :etag
1011
+
1012
+ # Required. Name of the database in which to apply `ChangeQuorum`. Values are of
1013
+ # the form `projects//instances//databases/`.
1014
+ # Corresponds to the JSON property `name`
1015
+ # @return [String]
1016
+ attr_accessor :name
1017
+
1018
+ # Information about the database quorum type. This only applies to dual-region
1019
+ # instance configs.
1020
+ # Corresponds to the JSON property `quorumType`
1021
+ # @return [Google::Apis::SpannerV1::QuorumType]
1022
+ attr_accessor :quorum_type
1023
+
1024
+ def initialize(**args)
1025
+ update!(**args)
1026
+ end
1027
+
1028
+ # Update properties of this object
1029
+ def update!(**args)
1030
+ @etag = args[:etag] if args.key?(:etag)
1031
+ @name = args[:name] if args.key?(:name)
1032
+ @quorum_type = args[:quorum_type] if args.key?(:quorum_type)
1033
+ end
1034
+ end
1035
+
512
1036
  # Metadata associated with a parent-child relationship appearing in a PlanNode.
513
1037
  class ChildLink
514
1038
  include Google::Apis::Core::Hashable
@@ -552,12 +1076,28 @@ module Google
552
1076
  class CommitRequest
553
1077
  include Google::Apis::Core::Hashable
554
1078
 
1079
+ # Optional. The amount of latency this request is configured to incur in order
1080
+ # to improve throughput. If this field is not set, Spanner assumes requests are
1081
+ # relatively latency sensitive and automatically determines an appropriate delay
1082
+ # time. You can specify a commit delay value between 0 and 500 ms.
1083
+ # Corresponds to the JSON property `maxCommitDelay`
1084
+ # @return [String]
1085
+ attr_accessor :max_commit_delay
1086
+
555
1087
  # The mutations to be executed when this transaction commits. All mutations are
556
1088
  # applied atomically, in the order they appear in this list.
557
1089
  # Corresponds to the JSON property `mutations`
558
1090
  # @return [Array<Google::Apis::SpannerV1::Mutation>]
559
1091
  attr_accessor :mutations
560
1092
 
1093
+ # When a read-write transaction is executed on a multiplexed session, this
1094
+ # precommit token is sent back to the client as a part of the [Transaction]
1095
+ # message in the BeginTransaction response and also as a part of the [ResultSet]
1096
+ # and [PartialResultSet] responses.
1097
+ # Corresponds to the JSON property `precommitToken`
1098
+ # @return [Google::Apis::SpannerV1::MultiplexedSessionPrecommitToken]
1099
+ attr_accessor :precommit_token
1100
+
561
1101
  # Common request options for various APIs.
562
1102
  # Corresponds to the JSON property `requestOptions`
563
1103
  # @return [Google::Apis::SpannerV1::RequestOptions]
@@ -586,7 +1126,7 @@ module Google
586
1126
  # such that the read is guaranteed to see the effects of all transactions that
587
1127
  # have committed before the start of the read). Snapshot read-only transactions
588
1128
  # do not need to be committed. Queries on change streams must be performed with
589
- # the snapshot read-only transaction mode, specifying a strong read. Please see
1129
+ # the snapshot read-only transaction mode, specifying a strong read. See
590
1130
  # TransactionOptions.ReadOnly.strong for more details. 3. Partitioned DML. This
591
1131
  # type of transaction is used to execute a single Partitioned DML statement.
592
1132
  # Partitioned DML partitions the key space and runs the DML statement over each
@@ -622,87 +1162,92 @@ module Google
622
1162
  # committing the retry, the client should execute the retry in the same session
623
1163
  # as the original attempt. The original session's lock priority increases with
624
1164
  # each consecutive abort, meaning that each attempt has a slightly better chance
625
- # of success than the previous. Under some circumstances (for example, many
626
- # transactions attempting to modify the same row(s)), a transaction can abort
627
- # many times in a short period before successfully committing. Thus, it is not a
628
- # good idea to cap the number of retries a transaction can attempt; instead, it
629
- # is better to limit the total amount of time spent retrying. Idle transactions:
630
- # A transaction is considered idle if it has no outstanding reads or SQL queries
631
- # and has not started a read or SQL query within the last 10 seconds. Idle
632
- # transactions can be aborted by Cloud Spanner so that they don't hold on to
633
- # locks indefinitely. If an idle transaction is aborted, the commit will fail
634
- # with error `ABORTED`. If this behavior is undesirable, periodically executing
635
- # a simple SQL query in the transaction (for example, `SELECT 1`) prevents the
636
- # transaction from becoming idle. Snapshot read-only transactions: Snapshot read-
637
- # only transactions provides a simpler method than locking read-write
638
- # transactions for doing several consistent reads. However, this type of
639
- # transaction does not support writes. Snapshot transactions do not take locks.
640
- # Instead, they work by choosing a Cloud Spanner timestamp, then executing all
641
- # reads at that timestamp. Since they do not acquire locks, they do not block
642
- # concurrent read-write transactions. Unlike locking read-write transactions,
643
- # snapshot read-only transactions never abort. They can fail if the chosen read
644
- # timestamp is garbage collected; however, the default garbage collection policy
645
- # is generous enough that most applications do not need to worry about this in
646
- # practice. Snapshot read-only transactions do not need to call Commit or
647
- # Rollback (and in fact are not permitted to do so). To execute a snapshot
648
- # transaction, the client specifies a timestamp bound, which tells Cloud Spanner
649
- # how to choose a read timestamp. The types of timestamp bound are: - Strong (
650
- # the default). - Bounded staleness. - Exact staleness. If the Cloud Spanner
651
- # database to be read is geographically distributed, stale read-only
652
- # transactions can execute more quickly than strong or read-write transactions,
653
- # because they are able to execute far from the leader replica. Each type of
654
- # timestamp bound is discussed in detail below. Strong: Strong reads are
655
- # guaranteed to see the effects of all transactions that have committed before
656
- # the start of the read. Furthermore, all rows yielded by a single read are
657
- # consistent with each other -- if any part of the read observes a transaction,
658
- # all parts of the read see the transaction. Strong reads are not repeatable:
659
- # two consecutive strong read-only transactions might return inconsistent
660
- # results if there are concurrent writes. If consistency across reads is
661
- # required, the reads should be executed within a transaction or at an exact
662
- # read timestamp. Queries on change streams (see below for more details) must
663
- # also specify the strong read timestamp bound. See TransactionOptions.ReadOnly.
664
- # strong. Exact staleness: These timestamp bounds execute reads at a user-
665
- # specified timestamp. Reads at a timestamp are guaranteed to see a consistent
666
- # prefix of the global transaction history: they observe modifications done by
667
- # all transactions with a commit timestamp less than or equal to the read
668
- # timestamp, and observe none of the modifications done by transactions with a
669
- # larger commit timestamp. They will block until all conflicting transactions
670
- # that may be assigned commit timestamps <= the read timestamp have finished.
671
- # The timestamp can either be expressed as an absolute Cloud Spanner commit
672
- # timestamp or a staleness relative to the current time. These modes do not
673
- # require a "negotiation phase" to pick a timestamp. As a result, they execute
674
- # slightly faster than the equivalent boundedly stale concurrency modes. On the
675
- # other hand, boundedly stale reads usually return fresher results. See
676
- # TransactionOptions.ReadOnly.read_timestamp and TransactionOptions.ReadOnly.
677
- # exact_staleness. Bounded staleness: Bounded staleness modes allow Cloud
678
- # Spanner to pick the read timestamp, subject to a user-provided staleness bound.
679
- # Cloud Spanner chooses the newest timestamp within the staleness bound that
680
- # allows execution of the reads at the closest available replica without
681
- # blocking. All rows yielded are consistent with each other -- if any part of
682
- # the read observes a transaction, all parts of the read see the transaction.
683
- # Boundedly stale reads are not repeatable: two stale reads, even if they use
684
- # the same staleness bound, can execute at different timestamps and thus return
685
- # inconsistent results. Boundedly stale reads execute in two phases: the first
686
- # phase negotiates a timestamp among all replicas needed to serve the read. In
687
- # the second phase, reads are executed at the negotiated timestamp. As a result
688
- # of the two phase execution, bounded staleness reads are usually a little
689
- # slower than comparable exact staleness reads. However, they are typically able
690
- # to return fresher results, and are more likely to execute at the closest
691
- # replica. Because the timestamp negotiation requires up-front knowledge of
692
- # which rows will be read, it can only be used with single-use read-only
693
- # transactions. See TransactionOptions.ReadOnly.max_staleness and
694
- # TransactionOptions.ReadOnly.min_read_timestamp. Old read timestamps and
695
- # garbage collection: Cloud Spanner continuously garbage collects deleted and
696
- # overwritten data in the background to reclaim storage space. This process is
697
- # known as "version GC". By default, version GC reclaims versions after they are
698
- # one hour old. Because of this, Cloud Spanner cannot perform reads at read
699
- # timestamps more than one hour in the past. This restriction also applies to in-
700
- # progress reads and/or SQL queries whose timestamp become too old while
701
- # executing. Reads and SQL queries with too-old read timestamps fail with the
702
- # error `FAILED_PRECONDITION`. You can configure and extend the `
703
- # VERSION_RETENTION_PERIOD` of a database up to a period as long as one week,
704
- # which allows Cloud Spanner to perform reads up to one week in the past.
705
- # Querying change Streams: A Change Stream is a schema object that can be
1165
+ # of success than the previous. Note that the lock priority is preserved per
1166
+ # session (not per transaction). Lock priority is set by the first read or write
1167
+ # in the first attempt of a read-write transaction. If the application starts a
1168
+ # new session to retry the whole transaction, the transaction loses its original
1169
+ # lock priority. Moreover, the lock priority is only preserved if the
1170
+ # transaction fails with an `ABORTED` error. Under some circumstances (for
1171
+ # example, many transactions attempting to modify the same row(s)), a
1172
+ # transaction can abort many times in a short period before successfully
1173
+ # committing. Thus, it is not a good idea to cap the number of retries a
1174
+ # transaction can attempt; instead, it is better to limit the total amount of
1175
+ # time spent retrying. Idle transactions: A transaction is considered idle if it
1176
+ # has no outstanding reads or SQL queries and has not started a read or SQL
1177
+ # query within the last 10 seconds. Idle transactions can be aborted by Cloud
1178
+ # Spanner so that they don't hold on to locks indefinitely. If an idle
1179
+ # transaction is aborted, the commit will fail with error `ABORTED`. If this
1180
+ # behavior is undesirable, periodically executing a simple SQL query in the
1181
+ # transaction (for example, `SELECT 1`) prevents the transaction from becoming
1182
+ # idle. Snapshot read-only transactions: Snapshot read-only transactions
1183
+ # provides a simpler method than locking read-write transactions for doing
1184
+ # several consistent reads. However, this type of transaction does not support
1185
+ # writes. Snapshot transactions do not take locks. Instead, they work by
1186
+ # choosing a Cloud Spanner timestamp, then executing all reads at that timestamp.
1187
+ # Since they do not acquire locks, they do not block concurrent read-write
1188
+ # transactions. Unlike locking read-write transactions, snapshot read-only
1189
+ # transactions never abort. They can fail if the chosen read timestamp is
1190
+ # garbage collected; however, the default garbage collection policy is generous
1191
+ # enough that most applications do not need to worry about this in practice.
1192
+ # Snapshot read-only transactions do not need to call Commit or Rollback (and in
1193
+ # fact are not permitted to do so). To execute a snapshot transaction, the
1194
+ # client specifies a timestamp bound, which tells Cloud Spanner how to choose a
1195
+ # read timestamp. The types of timestamp bound are: - Strong (the default). -
1196
+ # Bounded staleness. - Exact staleness. If the Cloud Spanner database to be read
1197
+ # is geographically distributed, stale read-only transactions can execute more
1198
+ # quickly than strong or read-write transactions, because they are able to
1199
+ # execute far from the leader replica. Each type of timestamp bound is discussed
1200
+ # in detail below. Strong: Strong reads are guaranteed to see the effects of all
1201
+ # transactions that have committed before the start of the read. Furthermore,
1202
+ # all rows yielded by a single read are consistent with each other -- if any
1203
+ # part of the read observes a transaction, all parts of the read see the
1204
+ # transaction. Strong reads are not repeatable: two consecutive strong read-only
1205
+ # transactions might return inconsistent results if there are concurrent writes.
1206
+ # If consistency across reads is required, the reads should be executed within a
1207
+ # transaction or at an exact read timestamp. Queries on change streams (see
1208
+ # below for more details) must also specify the strong read timestamp bound. See
1209
+ # TransactionOptions.ReadOnly.strong. Exact staleness: These timestamp bounds
1210
+ # execute reads at a user-specified timestamp. Reads at a timestamp are
1211
+ # guaranteed to see a consistent prefix of the global transaction history: they
1212
+ # observe modifications done by all transactions with a commit timestamp less
1213
+ # than or equal to the read timestamp, and observe none of the modifications
1214
+ # done by transactions with a larger commit timestamp. They will block until all
1215
+ # conflicting transactions that may be assigned commit timestamps <= the read
1216
+ # timestamp have finished. The timestamp can either be expressed as an absolute
1217
+ # Cloud Spanner commit timestamp or a staleness relative to the current time.
1218
+ # These modes do not require a "negotiation phase" to pick a timestamp. As a
1219
+ # result, they execute slightly faster than the equivalent boundedly stale
1220
+ # concurrency modes. On the other hand, boundedly stale reads usually return
1221
+ # fresher results. See TransactionOptions.ReadOnly.read_timestamp and
1222
+ # TransactionOptions.ReadOnly.exact_staleness. Bounded staleness: Bounded
1223
+ # staleness modes allow Cloud Spanner to pick the read timestamp, subject to a
1224
+ # user-provided staleness bound. Cloud Spanner chooses the newest timestamp
1225
+ # within the staleness bound that allows execution of the reads at the closest
1226
+ # available replica without blocking. All rows yielded are consistent with each
1227
+ # other -- if any part of the read observes a transaction, all parts of the read
1228
+ # see the transaction. Boundedly stale reads are not repeatable: two stale reads,
1229
+ # even if they use the same staleness bound, can execute at different
1230
+ # timestamps and thus return inconsistent results. Boundedly stale reads execute
1231
+ # in two phases: the first phase negotiates a timestamp among all replicas
1232
+ # needed to serve the read. In the second phase, reads are executed at the
1233
+ # negotiated timestamp. As a result of the two phase execution, bounded
1234
+ # staleness reads are usually a little slower than comparable exact staleness
1235
+ # reads. However, they are typically able to return fresher results, and are
1236
+ # more likely to execute at the closest replica. Because the timestamp
1237
+ # negotiation requires up-front knowledge of which rows will be read, it can
1238
+ # only be used with single-use read-only transactions. See TransactionOptions.
1239
+ # ReadOnly.max_staleness and TransactionOptions.ReadOnly.min_read_timestamp. Old
1240
+ # read timestamps and garbage collection: Cloud Spanner continuously garbage
1241
+ # collects deleted and overwritten data in the background to reclaim storage
1242
+ # space. This process is known as "version GC". By default, version GC reclaims
1243
+ # versions after they are one hour old. Because of this, Cloud Spanner cannot
1244
+ # perform reads at read timestamps more than one hour in the past. This
1245
+ # restriction also applies to in-progress reads and/or SQL queries whose
1246
+ # timestamp become too old while executing. Reads and SQL queries with too-old
1247
+ # read timestamps fail with the error `FAILED_PRECONDITION`. You can configure
1248
+ # and extend the `VERSION_RETENTION_PERIOD` of a database up to a period as long
1249
+ # as one week, which allows Cloud Spanner to perform reads up to one week in the
1250
+ # past. Querying change Streams: A Change Stream is a schema object that can be
706
1251
  # configured to watch data changes on the entire database, a set of tables, or a
707
1252
  # set of columns in a database. When a change stream is created, Spanner
708
1253
  # automatically defines a corresponding SQL Table-Valued Function (TVF) that can
@@ -738,12 +1283,12 @@ module Google
738
1283
  # of the table. Rather, the statement is applied atomically to partitions of the
739
1284
  # table, in independent transactions. Secondary index rows are updated
740
1285
  # atomically with the base table rows. - Partitioned DML does not guarantee
741
- # exactly-once execution semantics against a partition. The statement will be
742
- # applied at least once to each partition. It is strongly recommended that the
743
- # DML statement should be idempotent to avoid unexpected results. For instance,
744
- # it is potentially dangerous to run a statement such as `UPDATE table SET
745
- # column = column + 1` as it could be run multiple times against some rows. -
746
- # The partitions are committed automatically - there is no support for Commit or
1286
+ # exactly-once execution semantics against a partition. The statement is applied
1287
+ # at least once to each partition. It is strongly recommended that the DML
1288
+ # statement should be idempotent to avoid unexpected results. For instance, it
1289
+ # is potentially dangerous to run a statement such as `UPDATE table SET column =
1290
+ # column + 1` as it could be run multiple times against some rows. - The
1291
+ # partitions are committed automatically - there is no support for Commit or
747
1292
  # Rollback. If the call returns an error, or if the client issuing the
748
1293
  # ExecuteSql call dies, it is possible that some rows had the statement executed
749
1294
  # on them successfully. It is also possible that statement was never executed
@@ -773,7 +1318,9 @@ module Google
773
1318
 
774
1319
  # Update properties of this object
775
1320
  def update!(**args)
1321
+ @max_commit_delay = args[:max_commit_delay] if args.key?(:max_commit_delay)
776
1322
  @mutations = args[:mutations] if args.key?(:mutations)
1323
+ @precommit_token = args[:precommit_token] if args.key?(:precommit_token)
777
1324
  @request_options = args[:request_options] if args.key?(:request_options)
778
1325
  @return_commit_stats = args[:return_commit_stats] if args.key?(:return_commit_stats)
779
1326
  @single_use_transaction = args[:single_use_transaction] if args.key?(:single_use_transaction)
@@ -795,6 +1342,14 @@ module Google
795
1342
  # @return [String]
796
1343
  attr_accessor :commit_timestamp
797
1344
 
1345
+ # When a read-write transaction is executed on a multiplexed session, this
1346
+ # precommit token is sent back to the client as a part of the [Transaction]
1347
+ # message in the BeginTransaction response and also as a part of the [ResultSet]
1348
+ # and [PartialResultSet] responses.
1349
+ # Corresponds to the JSON property `precommitToken`
1350
+ # @return [Google::Apis::SpannerV1::MultiplexedSessionPrecommitToken]
1351
+ attr_accessor :precommit_token
1352
+
798
1353
  def initialize(**args)
799
1354
  update!(**args)
800
1355
  end
@@ -803,6 +1358,7 @@ module Google
803
1358
  def update!(**args)
804
1359
  @commit_stats = args[:commit_stats] if args.key?(:commit_stats)
805
1360
  @commit_timestamp = args[:commit_timestamp] if args.key?(:commit_timestamp)
1361
+ @precommit_token = args[:precommit_token] if args.key?(:precommit_token)
806
1362
  end
807
1363
  end
808
1364
 
@@ -887,6 +1443,22 @@ module Google
887
1443
  # @return [String]
888
1444
  attr_accessor :kms_key_name
889
1445
 
1446
+ # Optional. Specifies the KMS configuration for the one or more keys used to
1447
+ # protect the backup. Values are of the form `projects//locations//keyRings//
1448
+ # cryptoKeys/`. KMS keys specified can be in any order. The keys referenced by `
1449
+ # kms_key_names` must fully cover all regions of the backup's instance
1450
+ # configuration. Some examples: * For regional (single-region) instance
1451
+ # configurations, specify a regional location KMS key. * For multi-region
1452
+ # instance configurations of type `GOOGLE_MANAGED`, either specify a multi-
1453
+ # region location KMS key or multiple regional location KMS keys that cover all
1454
+ # regions in the instance configuration. * For an instance configuration of type
1455
+ # `USER_MANAGED`, specify only regional location KMS keys to cover each region
1456
+ # in the instance configuration. Multi-region location KMS keys aren't supported
1457
+ # for `USER_MANAGED` type instance configurations.
1458
+ # Corresponds to the JSON property `kmsKeyNames`
1459
+ # @return [Array<String>]
1460
+ attr_accessor :kms_key_names
1461
+
890
1462
  def initialize(**args)
891
1463
  update!(**args)
892
1464
  end
@@ -895,6 +1467,7 @@ module Google
895
1467
  def update!(**args)
896
1468
  @encryption_type = args[:encryption_type] if args.key?(:encryption_type)
897
1469
  @kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
1470
+ @kms_key_names = args[:kms_key_names] if args.key?(:kms_key_names)
898
1471
  end
899
1472
  end
900
1473
 
@@ -990,6 +1563,49 @@ module Google
990
1563
  end
991
1564
  end
992
1565
 
1566
+ # Encryption configuration for the backup to create.
1567
+ class CreateBackupEncryptionConfig
1568
+ include Google::Apis::Core::Hashable
1569
+
1570
+ # Required. The encryption type of the backup.
1571
+ # Corresponds to the JSON property `encryptionType`
1572
+ # @return [String]
1573
+ attr_accessor :encryption_type
1574
+
1575
+ # Optional. The Cloud KMS key that will be used to protect the backup. This
1576
+ # field should be set only when encryption_type is `CUSTOMER_MANAGED_ENCRYPTION`.
1577
+ # Values are of the form `projects//locations//keyRings//cryptoKeys/`.
1578
+ # Corresponds to the JSON property `kmsKeyName`
1579
+ # @return [String]
1580
+ attr_accessor :kms_key_name
1581
+
1582
+ # Optional. Specifies the KMS configuration for the one or more keys used to
1583
+ # protect the backup. Values are of the form `projects//locations//keyRings//
1584
+ # cryptoKeys/`. The keys referenced by `kms_key_names` must fully cover all
1585
+ # regions of the backup's instance configuration. Some examples: * For regional (
1586
+ # single-region) instance configurations, specify a regional location KMS key. *
1587
+ # For multi-region instance configurations of type `GOOGLE_MANAGED`, either
1588
+ # specify a multi-region location KMS key or multiple regional location KMS keys
1589
+ # that cover all regions in the instance configuration. * For an instance
1590
+ # configuration of type `USER_MANAGED`, specify only regional location KMS keys
1591
+ # to cover each region in the instance configuration. Multi-region location KMS
1592
+ # keys aren't supported for `USER_MANAGED` type instance configurations.
1593
+ # Corresponds to the JSON property `kmsKeyNames`
1594
+ # @return [Array<String>]
1595
+ attr_accessor :kms_key_names
1596
+
1597
+ def initialize(**args)
1598
+ update!(**args)
1599
+ end
1600
+
1601
+ # Update properties of this object
1602
+ def update!(**args)
1603
+ @encryption_type = args[:encryption_type] if args.key?(:encryption_type)
1604
+ @kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
1605
+ @kms_key_names = args[:kms_key_names] if args.key?(:kms_key_names)
1606
+ end
1607
+ end
1608
+
993
1609
  # Metadata type for the operation returned by CreateBackup.
994
1610
  class CreateBackupMetadata
995
1611
  include Google::Apis::Core::Hashable
@@ -1085,6 +1701,21 @@ module Google
1085
1701
  # @return [Array<String>]
1086
1702
  attr_accessor :extra_statements
1087
1703
 
1704
+ # Optional. Proto descriptors used by `CREATE/ALTER PROTO BUNDLE` statements in '
1705
+ # extra_statements'. Contains a protobuf-serialized [`google.protobuf.
1706
+ # FileDescriptorSet`](https://github.com/protocolbuffers/protobuf/blob/main/src/
1707
+ # google/protobuf/descriptor.proto) descriptor set. To generate it, [install](
1708
+ # https://grpc.io/docs/protoc-installation/) and run `protoc` with --
1709
+ # include_imports and --descriptor_set_out. For example, to generate for moon/
1710
+ # shot/app.proto, run ``` $protoc --proto_path=/app_path --proto_path=/lib_path \
1711
+ # --include_imports \ --descriptor_set_out=descriptors.data \ moon/shot/app.
1712
+ # proto ``` For more details, see protobuffer [self description](https://
1713
+ # developers.google.com/protocol-buffers/docs/techniques#self-description).
1714
+ # Corresponds to the JSON property `protoDescriptors`
1715
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
1716
+ # @return [String]
1717
+ attr_accessor :proto_descriptors
1718
+
1088
1719
  def initialize(**args)
1089
1720
  update!(**args)
1090
1721
  end
@@ -1095,11 +1726,82 @@ module Google
1095
1726
  @database_dialect = args[:database_dialect] if args.key?(:database_dialect)
1096
1727
  @encryption_config = args[:encryption_config] if args.key?(:encryption_config)
1097
1728
  @extra_statements = args[:extra_statements] if args.key?(:extra_statements)
1729
+ @proto_descriptors = args[:proto_descriptors] if args.key?(:proto_descriptors)
1098
1730
  end
1099
1731
  end
1100
1732
 
1101
- # Metadata type for the operation returned by CreateInstance.
1102
- class CreateInstanceMetadata
1733
+ # Metadata type for the operation returned by CreateInstanceConfig.
1734
+ class CreateInstanceConfigMetadata
1735
+ include Google::Apis::Core::Hashable
1736
+
1737
+ # The time at which this operation was cancelled.
1738
+ # Corresponds to the JSON property `cancelTime`
1739
+ # @return [String]
1740
+ attr_accessor :cancel_time
1741
+
1742
+ # A possible configuration for a Cloud Spanner instance. Configurations define
1743
+ # the geographic placement of nodes and their replication.
1744
+ # Corresponds to the JSON property `instanceConfig`
1745
+ # @return [Google::Apis::SpannerV1::InstanceConfig]
1746
+ attr_accessor :instance_config
1747
+
1748
+ # Encapsulates progress related information for a Cloud Spanner long running
1749
+ # instance operations.
1750
+ # Corresponds to the JSON property `progress`
1751
+ # @return [Google::Apis::SpannerV1::InstanceOperationProgress]
1752
+ attr_accessor :progress
1753
+
1754
+ def initialize(**args)
1755
+ update!(**args)
1756
+ end
1757
+
1758
+ # Update properties of this object
1759
+ def update!(**args)
1760
+ @cancel_time = args[:cancel_time] if args.key?(:cancel_time)
1761
+ @instance_config = args[:instance_config] if args.key?(:instance_config)
1762
+ @progress = args[:progress] if args.key?(:progress)
1763
+ end
1764
+ end
1765
+
1766
+ # The request for CreateInstanceConfig.
1767
+ class CreateInstanceConfigRequest
1768
+ include Google::Apis::Core::Hashable
1769
+
1770
+ # A possible configuration for a Cloud Spanner instance. Configurations define
1771
+ # the geographic placement of nodes and their replication.
1772
+ # Corresponds to the JSON property `instanceConfig`
1773
+ # @return [Google::Apis::SpannerV1::InstanceConfig]
1774
+ attr_accessor :instance_config
1775
+
1776
+ # Required. The ID of the instance configuration to create. Valid identifiers
1777
+ # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
1778
+ # characters in length. The `custom-` prefix is required to avoid name conflicts
1779
+ # with Google-managed configurations.
1780
+ # Corresponds to the JSON property `instanceConfigId`
1781
+ # @return [String]
1782
+ attr_accessor :instance_config_id
1783
+
1784
+ # An option to validate, but not actually execute, a request, and provide the
1785
+ # same response.
1786
+ # Corresponds to the JSON property `validateOnly`
1787
+ # @return [Boolean]
1788
+ attr_accessor :validate_only
1789
+ alias_method :validate_only?, :validate_only
1790
+
1791
+ def initialize(**args)
1792
+ update!(**args)
1793
+ end
1794
+
1795
+ # Update properties of this object
1796
+ def update!(**args)
1797
+ @instance_config = args[:instance_config] if args.key?(:instance_config)
1798
+ @instance_config_id = args[:instance_config_id] if args.key?(:instance_config_id)
1799
+ @validate_only = args[:validate_only] if args.key?(:validate_only)
1800
+ end
1801
+ end
1802
+
1803
+ # Metadata type for the operation returned by CreateInstance.
1804
+ class CreateInstanceMetadata
1103
1805
  include Google::Apis::Core::Hashable
1104
1806
 
1105
1807
  # The time at which this operation was cancelled. If set, this operation is in
@@ -1114,6 +1816,11 @@ module Google
1114
1816
  # @return [String]
1115
1817
  attr_accessor :end_time
1116
1818
 
1819
+ # The expected fulfillment period of this create operation.
1820
+ # Corresponds to the JSON property `expectedFulfillmentPeriod`
1821
+ # @return [String]
1822
+ attr_accessor :expected_fulfillment_period
1823
+
1117
1824
  # An isolated set of Cloud Spanner resources on which databases can be hosted.
1118
1825
  # Corresponds to the JSON property `instance`
1119
1826
  # @return [Google::Apis::SpannerV1::Instance]
@@ -1132,11 +1839,79 @@ module Google
1132
1839
  def update!(**args)
1133
1840
  @cancel_time = args[:cancel_time] if args.key?(:cancel_time)
1134
1841
  @end_time = args[:end_time] if args.key?(:end_time)
1842
+ @expected_fulfillment_period = args[:expected_fulfillment_period] if args.key?(:expected_fulfillment_period)
1135
1843
  @instance = args[:instance] if args.key?(:instance)
1136
1844
  @start_time = args[:start_time] if args.key?(:start_time)
1137
1845
  end
1138
1846
  end
1139
1847
 
1848
+ # Metadata type for the operation returned by CreateInstancePartition.
1849
+ class CreateInstancePartitionMetadata
1850
+ include Google::Apis::Core::Hashable
1851
+
1852
+ # The time at which this operation was cancelled. If set, this operation is in
1853
+ # the process of undoing itself (which is guaranteed to succeed) and cannot be
1854
+ # cancelled again.
1855
+ # Corresponds to the JSON property `cancelTime`
1856
+ # @return [String]
1857
+ attr_accessor :cancel_time
1858
+
1859
+ # The time at which this operation failed or was completed successfully.
1860
+ # Corresponds to the JSON property `endTime`
1861
+ # @return [String]
1862
+ attr_accessor :end_time
1863
+
1864
+ # An isolated set of Cloud Spanner resources that databases can define
1865
+ # placements on.
1866
+ # Corresponds to the JSON property `instancePartition`
1867
+ # @return [Google::Apis::SpannerV1::InstancePartition]
1868
+ attr_accessor :instance_partition
1869
+
1870
+ # The time at which the CreateInstancePartition request was received.
1871
+ # Corresponds to the JSON property `startTime`
1872
+ # @return [String]
1873
+ attr_accessor :start_time
1874
+
1875
+ def initialize(**args)
1876
+ update!(**args)
1877
+ end
1878
+
1879
+ # Update properties of this object
1880
+ def update!(**args)
1881
+ @cancel_time = args[:cancel_time] if args.key?(:cancel_time)
1882
+ @end_time = args[:end_time] if args.key?(:end_time)
1883
+ @instance_partition = args[:instance_partition] if args.key?(:instance_partition)
1884
+ @start_time = args[:start_time] if args.key?(:start_time)
1885
+ end
1886
+ end
1887
+
1888
+ # The request for CreateInstancePartition.
1889
+ class CreateInstancePartitionRequest
1890
+ include Google::Apis::Core::Hashable
1891
+
1892
+ # An isolated set of Cloud Spanner resources that databases can define
1893
+ # placements on.
1894
+ # Corresponds to the JSON property `instancePartition`
1895
+ # @return [Google::Apis::SpannerV1::InstancePartition]
1896
+ attr_accessor :instance_partition
1897
+
1898
+ # Required. The ID of the instance partition to create. Valid identifiers are of
1899
+ # the form `a-z*[a-z0-9]` and must be between 2 and 64 characters in length.
1900
+ # Corresponds to the JSON property `instancePartitionId`
1901
+ # @return [String]
1902
+ attr_accessor :instance_partition_id
1903
+
1904
+ def initialize(**args)
1905
+ update!(**args)
1906
+ end
1907
+
1908
+ # Update properties of this object
1909
+ def update!(**args)
1910
+ @instance_partition = args[:instance_partition] if args.key?(:instance_partition)
1911
+ @instance_partition_id = args[:instance_partition_id] if args.key?(:instance_partition_id)
1912
+ end
1913
+ end
1914
+
1140
1915
  # The request for CreateInstance.
1141
1916
  class CreateInstanceRequest
1142
1917
  include Google::Apis::Core::Hashable
@@ -1182,6 +1957,53 @@ module Google
1182
1957
  end
1183
1958
  end
1184
1959
 
1960
+ # CrontabSpec can be used to specify the version time and frequency at which the
1961
+ # backup should be created.
1962
+ class CrontabSpec
1963
+ include Google::Apis::Core::Hashable
1964
+
1965
+ # Output only. Schedule backups will contain an externally consistent copy of
1966
+ # the database at the version time specified in `schedule_spec.cron_spec`.
1967
+ # However, Spanner may not initiate the creation of the scheduled backups at
1968
+ # that version time. Spanner will initiate the creation of scheduled backups
1969
+ # within the time window bounded by the version_time specified in `schedule_spec.
1970
+ # cron_spec` and version_time + `creation_window`.
1971
+ # Corresponds to the JSON property `creationWindow`
1972
+ # @return [String]
1973
+ attr_accessor :creation_window
1974
+
1975
+ # Required. Textual representation of the crontab. User can customize the backup
1976
+ # frequency and the backup version time using the cron expression. The version
1977
+ # time must be in UTC timzeone. The backup will contain an externally consistent
1978
+ # copy of the database at the version time. Allowed frequencies are 12 hour, 1
1979
+ # day, 1 week and 1 month. Examples of valid cron specifications: * `0 2/12 * * *
1980
+ # ` : every 12 hours at (2, 14) hours past midnight in UTC. * `0 2,14 * * * ` :
1981
+ # every 12 hours at (2,14) hours past midnight in UTC. * `0 2 * * * ` : once a
1982
+ # day at 2 past midnight in UTC. * `0 2 * * 0 ` : once a week every Sunday at 2
1983
+ # past midnight in UTC. * `0 2 8 * * ` : once a month on 8th day at 2 past
1984
+ # midnight in UTC.
1985
+ # Corresponds to the JSON property `text`
1986
+ # @return [String]
1987
+ attr_accessor :text
1988
+
1989
+ # Output only. The time zone of the times in `CrontabSpec.text`. Currently only
1990
+ # UTC is supported.
1991
+ # Corresponds to the JSON property `timeZone`
1992
+ # @return [String]
1993
+ attr_accessor :time_zone
1994
+
1995
+ def initialize(**args)
1996
+ update!(**args)
1997
+ end
1998
+
1999
+ # Update properties of this object
2000
+ def update!(**args)
2001
+ @creation_window = args[:creation_window] if args.key?(:creation_window)
2002
+ @text = args[:text] if args.key?(:text)
2003
+ @time_zone = args[:time_zone] if args.key?(:time_zone)
2004
+ end
2005
+ end
2006
+
1185
2007
  # A Cloud Spanner database.
1186
2008
  class Database
1187
2009
  include Google::Apis::Core::Hashable
@@ -1213,6 +2035,15 @@ module Google
1213
2035
  # @return [String]
1214
2036
  attr_accessor :earliest_version_time
1215
2037
 
2038
+ # Optional. Whether drop protection is enabled for this database. Defaults to
2039
+ # false, if not set. For more details, please see how to [prevent accidental
2040
+ # database deletion](https://cloud.google.com/spanner/docs/prevent-database-
2041
+ # deletion).
2042
+ # Corresponds to the JSON property `enableDropProtection`
2043
+ # @return [Boolean]
2044
+ attr_accessor :enable_drop_protection
2045
+ alias_method :enable_drop_protection?, :enable_drop_protection
2046
+
1216
2047
  # Encryption configuration for a Cloud Spanner database.
1217
2048
  # Corresponds to the JSON property `encryptionConfig`
1218
2049
  # @return [Google::Apis::SpannerV1::EncryptionConfig]
@@ -1220,7 +2051,7 @@ module Google
1220
2051
 
1221
2052
  # Output only. For databases that are using customer managed encryption, this
1222
2053
  # field contains the encryption information for the database, such as all Cloud
1223
- # KMS key versions that are in use. The `encryption_status' field inside of each
2054
+ # KMS key versions that are in use. The `encryption_status` field inside of each
1224
2055
  # `EncryptionInfo` is not populated. For databases that are using Google default
1225
2056
  # or other types of encryption, this field is empty. This field is propagated
1226
2057
  # lazily from the backend. There might be a delay from when a key version is
@@ -1237,6 +2068,18 @@ module Google
1237
2068
  # @return [String]
1238
2069
  attr_accessor :name
1239
2070
 
2071
+ # Information about the dual-region quorum.
2072
+ # Corresponds to the JSON property `quorumInfo`
2073
+ # @return [Google::Apis::SpannerV1::QuorumInfo]
2074
+ attr_accessor :quorum_info
2075
+
2076
+ # Output only. If true, the database is being updated. If false, there are no
2077
+ # ongoing update operations for the database.
2078
+ # Corresponds to the JSON property `reconciling`
2079
+ # @return [Boolean]
2080
+ attr_accessor :reconciling
2081
+ alias_method :reconciling?, :reconciling
2082
+
1240
2083
  # Information about the database restore.
1241
2084
  # Corresponds to the JSON property `restoreInfo`
1242
2085
  # @return [Google::Apis::SpannerV1::RestoreInfo]
@@ -1264,9 +2107,12 @@ module Google
1264
2107
  @database_dialect = args[:database_dialect] if args.key?(:database_dialect)
1265
2108
  @default_leader = args[:default_leader] if args.key?(:default_leader)
1266
2109
  @earliest_version_time = args[:earliest_version_time] if args.key?(:earliest_version_time)
2110
+ @enable_drop_protection = args[:enable_drop_protection] if args.key?(:enable_drop_protection)
1267
2111
  @encryption_config = args[:encryption_config] if args.key?(:encryption_config)
1268
2112
  @encryption_info = args[:encryption_info] if args.key?(:encryption_info)
1269
2113
  @name = args[:name] if args.key?(:name)
2114
+ @quorum_info = args[:quorum_info] if args.key?(:quorum_info)
2115
+ @reconciling = args[:reconciling] if args.key?(:reconciling)
1270
2116
  @restore_info = args[:restore_info] if args.key?(:restore_info)
1271
2117
  @state = args[:state] if args.key?(:state)
1272
2118
  @version_retention_period = args[:version_retention_period] if args.key?(:version_retention_period)
@@ -1278,8 +2124,8 @@ module Google
1278
2124
  include Google::Apis::Core::Hashable
1279
2125
 
1280
2126
  # Required. The name of the database role. Values are of the form `projects//
1281
- # instances//databases//databaseRoles/ `, where `` is as specified in the `
1282
- # CREATE ROLE` DDL statement.
2127
+ # instances//databases//databaseRoles/` where `` is as specified in the `CREATE
2128
+ # ROLE` DDL statement.
1283
2129
  # Corresponds to the JSON property `name`
1284
2130
  # @return [String]
1285
2131
  attr_accessor :name
@@ -1294,6 +2140,45 @@ module Google
1294
2140
  end
1295
2141
  end
1296
2142
 
2143
+ # Action information extracted from a DDL statement. This proto is used to
2144
+ # display the brief info of the DDL statement for the operation
2145
+ # UpdateDatabaseDdl.
2146
+ class DdlStatementActionInfo
2147
+ include Google::Apis::Core::Hashable
2148
+
2149
+ # The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc. This
2150
+ # field is a non-empty string.
2151
+ # Corresponds to the JSON property `action`
2152
+ # @return [String]
2153
+ attr_accessor :action
2154
+
2155
+ # The entity name(s) being operated on the DDL statement. E.g. 1. For statement "
2156
+ # CREATE TABLE t1(...)", `entity_names` = ["t1"]. 2. For statement "GRANT ROLE
2157
+ # r1, r2 ...", `entity_names` = ["r1", "r2"]. 3. For statement "ANALYZE", `
2158
+ # entity_names` = [].
2159
+ # Corresponds to the JSON property `entityNames`
2160
+ # @return [Array<String>]
2161
+ attr_accessor :entity_names
2162
+
2163
+ # The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc. This
2164
+ # field can be empty string for some DDL statement, e.g. for statement "ANALYZE",
2165
+ # `entity_type` = "".
2166
+ # Corresponds to the JSON property `entityType`
2167
+ # @return [String]
2168
+ attr_accessor :entity_type
2169
+
2170
+ def initialize(**args)
2171
+ update!(**args)
2172
+ end
2173
+
2174
+ # Update properties of this object
2175
+ def update!(**args)
2176
+ @action = args[:action] if args.key?(:action)
2177
+ @entity_names = args[:entity_names] if args.key?(:entity_names)
2178
+ @entity_type = args[:entity_type] if args.key?(:entity_type)
2179
+ end
2180
+ end
2181
+
1297
2182
  # Arguments to delete operations.
1298
2183
  class Delete
1299
2184
  include Google::Apis::Core::Hashable
@@ -1402,6 +2287,49 @@ module Google
1402
2287
  end
1403
2288
  end
1404
2289
 
2290
+ # The DirectedReadOptions can be used to indicate which replicas or regions
2291
+ # should be used for non-transactional reads or queries. DirectedReadOptions may
2292
+ # only be specified for a read-only transaction, otherwise the API will return
2293
+ # an `INVALID_ARGUMENT` error.
2294
+ class DirectedReadOptions
2295
+ include Google::Apis::Core::Hashable
2296
+
2297
+ # An ExcludeReplicas contains a repeated set of ReplicaSelection that should be
2298
+ # excluded from serving requests.
2299
+ # Corresponds to the JSON property `excludeReplicas`
2300
+ # @return [Google::Apis::SpannerV1::ExcludeReplicas]
2301
+ attr_accessor :exclude_replicas
2302
+
2303
+ # An IncludeReplicas contains a repeated set of ReplicaSelection which indicates
2304
+ # the order in which replicas should be considered.
2305
+ # Corresponds to the JSON property `includeReplicas`
2306
+ # @return [Google::Apis::SpannerV1::IncludeReplicas]
2307
+ attr_accessor :include_replicas
2308
+
2309
+ def initialize(**args)
2310
+ update!(**args)
2311
+ end
2312
+
2313
+ # Update properties of this object
2314
+ def update!(**args)
2315
+ @exclude_replicas = args[:exclude_replicas] if args.key?(:exclude_replicas)
2316
+ @include_replicas = args[:include_replicas] if args.key?(:include_replicas)
2317
+ end
2318
+ end
2319
+
2320
+ # Message type for a dual-region quorum. Currently this type has no options.
2321
+ class DualRegionQuorum
2322
+ include Google::Apis::Core::Hashable
2323
+
2324
+ def initialize(**args)
2325
+ update!(**args)
2326
+ end
2327
+
2328
+ # Update properties of this object
2329
+ def update!(**args)
2330
+ end
2331
+ end
2332
+
1405
2333
  # A generic empty message that you can re-use to avoid defining duplicated empty
1406
2334
  # messages in your APIs. A typical example is to use it as the request or the
1407
2335
  # response type of an API method. For instance: service Foo ` rpc Bar(google.
@@ -1428,6 +2356,21 @@ module Google
1428
2356
  # @return [String]
1429
2357
  attr_accessor :kms_key_name
1430
2358
 
2359
+ # Specifies the KMS configuration for one or more keys used to encrypt the
2360
+ # database. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
2361
+ # The keys referenced by `kms_key_names` must fully cover all regions of the
2362
+ # database's instance configuration. Some examples: * For regional (single-
2363
+ # region) instance configurations, specify a regional location KMS key. * For
2364
+ # multi-region instance configurations of type `GOOGLE_MANAGED`, either specify
2365
+ # a multi-region location KMS key or multiple regional location KMS keys that
2366
+ # cover all regions in the instance configuration. * For an instance
2367
+ # configuration of type `USER_MANAGED`, specify only regional location KMS keys
2368
+ # to cover each region in the instance configuration. Multi-region location KMS
2369
+ # keys aren't supported for `USER_MANAGED` type instance configurations.
2370
+ # Corresponds to the JSON property `kmsKeyNames`
2371
+ # @return [Array<String>]
2372
+ attr_accessor :kms_key_names
2373
+
1431
2374
  def initialize(**args)
1432
2375
  update!(**args)
1433
2376
  end
@@ -1435,6 +2378,7 @@ module Google
1435
2378
  # Update properties of this object
1436
2379
  def update!(**args)
1437
2380
  @kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
2381
+ @kms_key_names = args[:kms_key_names] if args.key?(:kms_key_names)
1438
2382
  end
1439
2383
  end
1440
2384
 
@@ -1475,6 +2419,26 @@ module Google
1475
2419
  end
1476
2420
  end
1477
2421
 
2422
+ # An ExcludeReplicas contains a repeated set of ReplicaSelection that should be
2423
+ # excluded from serving requests.
2424
+ class ExcludeReplicas
2425
+ include Google::Apis::Core::Hashable
2426
+
2427
+ # The directed read replica selector.
2428
+ # Corresponds to the JSON property `replicaSelections`
2429
+ # @return [Array<Google::Apis::SpannerV1::ReplicaSelection>]
2430
+ attr_accessor :replica_selections
2431
+
2432
+ def initialize(**args)
2433
+ update!(**args)
2434
+ end
2435
+
2436
+ # Update properties of this object
2437
+ def update!(**args)
2438
+ @replica_selections = args[:replica_selections] if args.key?(:replica_selections)
2439
+ end
2440
+ end
2441
+
1478
2442
  # The request for ExecuteBatchDml.
1479
2443
  class ExecuteBatchDmlRequest
1480
2444
  include Google::Apis::Core::Hashable
@@ -1540,6 +2504,14 @@ module Google
1540
2504
  class ExecuteBatchDmlResponse
1541
2505
  include Google::Apis::Core::Hashable
1542
2506
 
2507
+ # When a read-write transaction is executed on a multiplexed session, this
2508
+ # precommit token is sent back to the client as a part of the [Transaction]
2509
+ # message in the BeginTransaction response and also as a part of the [ResultSet]
2510
+ # and [PartialResultSet] responses.
2511
+ # Corresponds to the JSON property `precommitToken`
2512
+ # @return [Google::Apis::SpannerV1::MultiplexedSessionPrecommitToken]
2513
+ attr_accessor :precommit_token
2514
+
1543
2515
  # One ResultSet for each statement in the request that ran successfully, in the
1544
2516
  # same order as the statements in the request. Each ResultSet does not contain
1545
2517
  # any rows. The ResultSetStats in each ResultSet contain the number of rows
@@ -1565,6 +2537,7 @@ module Google
1565
2537
 
1566
2538
  # Update properties of this object
1567
2539
  def update!(**args)
2540
+ @precommit_token = args[:precommit_token] if args.key?(:precommit_token)
1568
2541
  @result_sets = args[:result_sets] if args.key?(:result_sets)
1569
2542
  @status = args[:status] if args.key?(:status)
1570
2543
  end
@@ -1574,6 +2547,23 @@ module Google
1574
2547
  class ExecuteSqlRequest
1575
2548
  include Google::Apis::Core::Hashable
1576
2549
 
2550
+ # If this is for a partitioned query and this field is set to `true`, the
2551
+ # request is executed with Spanner Data Boost independent compute resources. If
2552
+ # the field is set to `true` but the request does not set `partition_token`, the
2553
+ # API returns an `INVALID_ARGUMENT` error.
2554
+ # Corresponds to the JSON property `dataBoostEnabled`
2555
+ # @return [Boolean]
2556
+ attr_accessor :data_boost_enabled
2557
+ alias_method :data_boost_enabled?, :data_boost_enabled
2558
+
2559
+ # The DirectedReadOptions can be used to indicate which replicas or regions
2560
+ # should be used for non-transactional reads or queries. DirectedReadOptions may
2561
+ # only be specified for a read-only transaction, otherwise the API will return
2562
+ # an `INVALID_ARGUMENT` error.
2563
+ # Corresponds to the JSON property `directedReadOptions`
2564
+ # @return [Google::Apis::SpannerV1::DirectedReadOptions]
2565
+ attr_accessor :directed_read_options
2566
+
1577
2567
  # It is not always possible for Cloud Spanner to infer the right SQL type from a
1578
2568
  # JSON value. For example, values of type `BYTES` and values of type `STRING`
1579
2569
  # both appear in params as JSON strings. In these cases, `param_types` can be
@@ -1658,6 +2648,8 @@ module Google
1658
2648
 
1659
2649
  # Update properties of this object
1660
2650
  def update!(**args)
2651
+ @data_boost_enabled = args[:data_boost_enabled] if args.key?(:data_boost_enabled)
2652
+ @directed_read_options = args[:directed_read_options] if args.key?(:directed_read_options)
1661
2653
  @param_types = args[:param_types] if args.key?(:param_types)
1662
2654
  @params = args[:params] if args.key?(:params)
1663
2655
  @partition_token = args[:partition_token] if args.key?(:partition_token)
@@ -1793,10 +2785,34 @@ module Google
1793
2785
  end
1794
2786
  end
1795
2787
 
2788
+ # The specification for full backups. A full backup stores the entire contents
2789
+ # of the database at a given version time.
2790
+ class FullBackupSpec
2791
+ include Google::Apis::Core::Hashable
2792
+
2793
+ def initialize(**args)
2794
+ update!(**args)
2795
+ end
2796
+
2797
+ # Update properties of this object
2798
+ def update!(**args)
2799
+ end
2800
+ end
2801
+
1796
2802
  # The response for GetDatabaseDdl.
1797
2803
  class GetDatabaseDdlResponse
1798
2804
  include Google::Apis::Core::Hashable
1799
2805
 
2806
+ # Proto descriptors stored in the database. Contains a protobuf-serialized [
2807
+ # google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/
2808
+ # blob/main/src/google/protobuf/descriptor.proto). For more details, see
2809
+ # protobuffer [self description](https://developers.google.com/protocol-buffers/
2810
+ # docs/techniques#self-description).
2811
+ # Corresponds to the JSON property `protoDescriptors`
2812
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
2813
+ # @return [String]
2814
+ attr_accessor :proto_descriptors
2815
+
1800
2816
  # A list of formatted DDL statements defining the schema of the database
1801
2817
  # specified in the request.
1802
2818
  # Corresponds to the JSON property `statements`
@@ -1809,6 +2825,7 @@ module Google
1809
2825
 
1810
2826
  # Update properties of this object
1811
2827
  def update!(**args)
2828
+ @proto_descriptors = args[:proto_descriptors] if args.key?(:proto_descriptors)
1812
2829
  @statements = args[:statements] if args.key?(:statements)
1813
2830
  end
1814
2831
  end
@@ -1860,6 +2877,79 @@ module Google
1860
2877
  end
1861
2878
  end
1862
2879
 
2880
+ # An IncludeReplicas contains a repeated set of ReplicaSelection which indicates
2881
+ # the order in which replicas should be considered.
2882
+ class IncludeReplicas
2883
+ include Google::Apis::Core::Hashable
2884
+
2885
+ # If true, Spanner will not route requests to a replica outside the
2886
+ # include_replicas list when all of the specified replicas are unavailable or
2887
+ # unhealthy. Default value is `false`.
2888
+ # Corresponds to the JSON property `autoFailoverDisabled`
2889
+ # @return [Boolean]
2890
+ attr_accessor :auto_failover_disabled
2891
+ alias_method :auto_failover_disabled?, :auto_failover_disabled
2892
+
2893
+ # The directed read replica selector.
2894
+ # Corresponds to the JSON property `replicaSelections`
2895
+ # @return [Array<Google::Apis::SpannerV1::ReplicaSelection>]
2896
+ attr_accessor :replica_selections
2897
+
2898
+ def initialize(**args)
2899
+ update!(**args)
2900
+ end
2901
+
2902
+ # Update properties of this object
2903
+ def update!(**args)
2904
+ @auto_failover_disabled = args[:auto_failover_disabled] if args.key?(:auto_failover_disabled)
2905
+ @replica_selections = args[:replica_selections] if args.key?(:replica_selections)
2906
+ end
2907
+ end
2908
+
2909
+ # The specification for incremental backup chains. An incremental backup stores
2910
+ # the delta of changes between a previous backup and the database contents at a
2911
+ # given version time. An incremental backup chain consists of a full backup and
2912
+ # zero or more successive incremental backups. The first backup created for an
2913
+ # incremental backup chain is always a full backup.
2914
+ class IncrementalBackupSpec
2915
+ include Google::Apis::Core::Hashable
2916
+
2917
+ def initialize(**args)
2918
+ update!(**args)
2919
+ end
2920
+
2921
+ # Update properties of this object
2922
+ def update!(**args)
2923
+ end
2924
+ end
2925
+
2926
+ # Recommendation to add new indexes to run queries more efficiently.
2927
+ class IndexAdvice
2928
+ include Google::Apis::Core::Hashable
2929
+
2930
+ # Optional. DDL statements to add new indexes that will improve the query.
2931
+ # Corresponds to the JSON property `ddl`
2932
+ # @return [Array<String>]
2933
+ attr_accessor :ddl
2934
+
2935
+ # Optional. Estimated latency improvement factor. For example if the query
2936
+ # currently takes 500 ms to run and the estimated latency with new indexes is
2937
+ # 100 ms this field will be 5.
2938
+ # Corresponds to the JSON property `improvementFactor`
2939
+ # @return [Float]
2940
+ attr_accessor :improvement_factor
2941
+
2942
+ def initialize(**args)
2943
+ update!(**args)
2944
+ end
2945
+
2946
+ # Update properties of this object
2947
+ def update!(**args)
2948
+ @ddl = args[:ddl] if args.key?(:ddl)
2949
+ @improvement_factor = args[:improvement_factor] if args.key?(:improvement_factor)
2950
+ end
2951
+ end
2952
+
1863
2953
  # A message representing a (sparse) collection of hot keys for specific key
1864
2954
  # buckets.
1865
2955
  class IndexedHotKey
@@ -1887,11 +2977,332 @@ module Google
1887
2977
  class IndexedKeyRangeInfos
1888
2978
  include Google::Apis::Core::Hashable
1889
2979
 
1890
- # A (sparse) mapping from key bucket index to the KeyRangeInfos for that key
1891
- # bucket.
1892
- # Corresponds to the JSON property `keyRangeInfos`
1893
- # @return [Hash<String,Google::Apis::SpannerV1::KeyRangeInfos>]
1894
- attr_accessor :key_range_infos
2980
+ # A (sparse) mapping from key bucket index to the KeyRangeInfos for that key
2981
+ # bucket.
2982
+ # Corresponds to the JSON property `keyRangeInfos`
2983
+ # @return [Hash<String,Google::Apis::SpannerV1::KeyRangeInfos>]
2984
+ attr_accessor :key_range_infos
2985
+
2986
+ def initialize(**args)
2987
+ update!(**args)
2988
+ end
2989
+
2990
+ # Update properties of this object
2991
+ def update!(**args)
2992
+ @key_range_infos = args[:key_range_infos] if args.key?(:key_range_infos)
2993
+ end
2994
+ end
2995
+
2996
+ # An isolated set of Cloud Spanner resources on which databases can be hosted.
2997
+ class Instance
2998
+ include Google::Apis::Core::Hashable
2999
+
3000
+ # Autoscaling configuration for an instance.
3001
+ # Corresponds to the JSON property `autoscalingConfig`
3002
+ # @return [Google::Apis::SpannerV1::AutoscalingConfig]
3003
+ attr_accessor :autoscaling_config
3004
+
3005
+ # Required. The name of the instance's configuration. Values are of the form `
3006
+ # projects//instanceConfigs/`. See also InstanceConfig and ListInstanceConfigs.
3007
+ # Corresponds to the JSON property `config`
3008
+ # @return [String]
3009
+ attr_accessor :config
3010
+
3011
+ # Output only. The time at which the instance was created.
3012
+ # Corresponds to the JSON property `createTime`
3013
+ # @return [String]
3014
+ attr_accessor :create_time
3015
+
3016
+ # Optional. Controls the default backup behavior for new databases within the
3017
+ # instance. Note that `AUTOMATIC` is not permitted for free instances, as
3018
+ # backups and backup schedules are not allowed for free instances. In the `
3019
+ # GetInstance` or `ListInstances` response, if the value of
3020
+ # default_backup_schedule_type is unset or NONE, no default backup schedule will
3021
+ # be created for new databases within the instance.
3022
+ # Corresponds to the JSON property `defaultBackupScheduleType`
3023
+ # @return [String]
3024
+ attr_accessor :default_backup_schedule_type
3025
+
3026
+ # Required. The descriptive name for this instance as it appears in UIs. Must be
3027
+ # unique per project and between 4 and 30 characters in length.
3028
+ # Corresponds to the JSON property `displayName`
3029
+ # @return [String]
3030
+ attr_accessor :display_name
3031
+
3032
+ # Optional. The `Edition` of the current instance.
3033
+ # Corresponds to the JSON property `edition`
3034
+ # @return [String]
3035
+ attr_accessor :edition
3036
+
3037
+ # Deprecated. This field is not populated.
3038
+ # Corresponds to the JSON property `endpointUris`
3039
+ # @return [Array<String>]
3040
+ attr_accessor :endpoint_uris
3041
+
3042
+ # Free instance specific metadata that is kept even after an instance has been
3043
+ # upgraded for tracking purposes.
3044
+ # Corresponds to the JSON property `freeInstanceMetadata`
3045
+ # @return [Google::Apis::SpannerV1::FreeInstanceMetadata]
3046
+ attr_accessor :free_instance_metadata
3047
+
3048
+ # The `InstanceType` of the current instance.
3049
+ # Corresponds to the JSON property `instanceType`
3050
+ # @return [String]
3051
+ attr_accessor :instance_type
3052
+
3053
+ # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
3054
+ # resources into groups that reflect a customer's organizational needs and
3055
+ # deployment strategies. Cloud Labels can be used to filter collections of
3056
+ # resources. They can be used to control how resource metrics are aggregated.
3057
+ # And they can be used as arguments to policy management rules (e.g. route,
3058
+ # firewall, load balancing, etc.). * Label keys must be between 1 and 63
3059
+ # characters long and must conform to the following regular expression: `a-z`0,
3060
+ # 62``. * Label values must be between 0 and 63 characters long and must conform
3061
+ # to the regular expression `[a-z0-9_-]`0,63``. * No more than 64 labels can be
3062
+ # associated with a given resource. See https://goo.gl/xmQnxf for more
3063
+ # information on and examples of labels. If you plan to use labels in your own
3064
+ # code, please note that additional characters may be allowed in the future. And
3065
+ # so you are advised to use an internal label representation, such as JSON,
3066
+ # which doesn't rely upon specific characters being disallowed. For example,
3067
+ # representing labels as the string: name + "_" + value would prove problematic
3068
+ # if we were to allow "_" in a future release.
3069
+ # Corresponds to the JSON property `labels`
3070
+ # @return [Hash<String,String>]
3071
+ attr_accessor :labels
3072
+
3073
+ # Required. A unique identifier for the instance, which cannot be changed after
3074
+ # the instance is created. Values are of the form `projects//instances/a-z*[a-z0-
3075
+ # 9]`. The final segment of the name must be between 2 and 64 characters in
3076
+ # length.
3077
+ # Corresponds to the JSON property `name`
3078
+ # @return [String]
3079
+ attr_accessor :name
3080
+
3081
+ # The number of nodes allocated to this instance. At most, one of either `
3082
+ # node_count` or `processing_units` should be present in the message. Users can
3083
+ # set the `node_count` field to specify the target number of nodes allocated to
3084
+ # the instance. If autoscaling is enabled, `node_count` is treated as an `
3085
+ # OUTPUT_ONLY` field and reflects the current number of nodes allocated to the
3086
+ # instance. This might be zero in API responses for instances that are not yet
3087
+ # in the `READY` state. For more information, see [Compute capacity, nodes, and
3088
+ # processing units](https://cloud.google.com/spanner/docs/compute-capacity).
3089
+ # Corresponds to the JSON property `nodeCount`
3090
+ # @return [Fixnum]
3091
+ attr_accessor :node_count
3092
+
3093
+ # The number of processing units allocated to this instance. At most, one of
3094
+ # either `processing_units` or `node_count` should be present in the message.
3095
+ # Users can set the `processing_units` field to specify the target number of
3096
+ # processing units allocated to the instance. If autoscaling is enabled, `
3097
+ # processing_units` is treated as an `OUTPUT_ONLY` field and reflects the
3098
+ # current number of processing units allocated to the instance. This might be
3099
+ # zero in API responses for instances that are not yet in the `READY` state. For
3100
+ # more information, see [Compute capacity, nodes and processing units](https://
3101
+ # cloud.google.com/spanner/docs/compute-capacity).
3102
+ # Corresponds to the JSON property `processingUnits`
3103
+ # @return [Fixnum]
3104
+ attr_accessor :processing_units
3105
+
3106
+ # Output only. Lists the compute capacity per ReplicaSelection. A replica
3107
+ # selection identifies a set of replicas with common properties. Replicas
3108
+ # identified by a ReplicaSelection are scaled with the same compute capacity.
3109
+ # Corresponds to the JSON property `replicaComputeCapacity`
3110
+ # @return [Array<Google::Apis::SpannerV1::ReplicaComputeCapacity>]
3111
+ attr_accessor :replica_compute_capacity
3112
+
3113
+ # Output only. The current instance state. For CreateInstance, the state must be
3114
+ # either omitted or set to `CREATING`. For UpdateInstance, the state must be
3115
+ # either omitted or set to `READY`.
3116
+ # Corresponds to the JSON property `state`
3117
+ # @return [String]
3118
+ attr_accessor :state
3119
+
3120
+ # Output only. The time at which the instance was most recently updated.
3121
+ # Corresponds to the JSON property `updateTime`
3122
+ # @return [String]
3123
+ attr_accessor :update_time
3124
+
3125
+ def initialize(**args)
3126
+ update!(**args)
3127
+ end
3128
+
3129
+ # Update properties of this object
3130
+ def update!(**args)
3131
+ @autoscaling_config = args[:autoscaling_config] if args.key?(:autoscaling_config)
3132
+ @config = args[:config] if args.key?(:config)
3133
+ @create_time = args[:create_time] if args.key?(:create_time)
3134
+ @default_backup_schedule_type = args[:default_backup_schedule_type] if args.key?(:default_backup_schedule_type)
3135
+ @display_name = args[:display_name] if args.key?(:display_name)
3136
+ @edition = args[:edition] if args.key?(:edition)
3137
+ @endpoint_uris = args[:endpoint_uris] if args.key?(:endpoint_uris)
3138
+ @free_instance_metadata = args[:free_instance_metadata] if args.key?(:free_instance_metadata)
3139
+ @instance_type = args[:instance_type] if args.key?(:instance_type)
3140
+ @labels = args[:labels] if args.key?(:labels)
3141
+ @name = args[:name] if args.key?(:name)
3142
+ @node_count = args[:node_count] if args.key?(:node_count)
3143
+ @processing_units = args[:processing_units] if args.key?(:processing_units)
3144
+ @replica_compute_capacity = args[:replica_compute_capacity] if args.key?(:replica_compute_capacity)
3145
+ @state = args[:state] if args.key?(:state)
3146
+ @update_time = args[:update_time] if args.key?(:update_time)
3147
+ end
3148
+ end
3149
+
3150
+ # A possible configuration for a Cloud Spanner instance. Configurations define
3151
+ # the geographic placement of nodes and their replication.
3152
+ class InstanceConfig
3153
+ include Google::Apis::Core::Hashable
3154
+
3155
+ # Base configuration name, e.g. projects//instanceConfigs/nam3, based on which
3156
+ # this configuration is created. Only set for user-managed configurations. `
3157
+ # base_config` must refer to a configuration of type `GOOGLE_MANAGED` in the
3158
+ # same project as this configuration.
3159
+ # Corresponds to the JSON property `baseConfig`
3160
+ # @return [String]
3161
+ attr_accessor :base_config
3162
+
3163
+ # Output only. Whether this instance configuration is a Google-managed or user-
3164
+ # managed configuration.
3165
+ # Corresponds to the JSON property `configType`
3166
+ # @return [String]
3167
+ attr_accessor :config_type
3168
+
3169
+ # The name of this instance configuration as it appears in UIs.
3170
+ # Corresponds to the JSON property `displayName`
3171
+ # @return [String]
3172
+ attr_accessor :display_name
3173
+
3174
+ # etag is used for optimistic concurrency control as a way to help prevent
3175
+ # simultaneous updates of a instance configuration from overwriting each other.
3176
+ # It is strongly suggested that systems make use of the etag in the read-modify-
3177
+ # write cycle to perform instance configuration updates in order to avoid race
3178
+ # conditions: An etag is returned in the response which contains instance
3179
+ # configurations, and systems are expected to put that etag in the request to
3180
+ # update instance configuration to ensure that their change is applied to the
3181
+ # same version of the instance configuration. If no etag is provided in the call
3182
+ # to update the instance configuration, then the existing instance configuration
3183
+ # is overwritten blindly.
3184
+ # Corresponds to the JSON property `etag`
3185
+ # @return [String]
3186
+ attr_accessor :etag
3187
+
3188
+ # Output only. Describes whether free instances are available to be created in
3189
+ # this instance configuration.
3190
+ # Corresponds to the JSON property `freeInstanceAvailability`
3191
+ # @return [String]
3192
+ attr_accessor :free_instance_availability
3193
+
3194
+ # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
3195
+ # resources into groups that reflect a customer's organizational needs and
3196
+ # deployment strategies. Cloud Labels can be used to filter collections of
3197
+ # resources. They can be used to control how resource metrics are aggregated.
3198
+ # And they can be used as arguments to policy management rules (e.g. route,
3199
+ # firewall, load balancing, etc.). * Label keys must be between 1 and 63
3200
+ # characters long and must conform to the following regular expression: `a-z`0,
3201
+ # 62``. * Label values must be between 0 and 63 characters long and must conform
3202
+ # to the regular expression `[a-z0-9_-]`0,63``. * No more than 64 labels can be
3203
+ # associated with a given resource. See https://goo.gl/xmQnxf for more
3204
+ # information on and examples of labels. If you plan to use labels in your own
3205
+ # code, please note that additional characters may be allowed in the future.
3206
+ # Therefore, you are advised to use an internal label representation, such as
3207
+ # JSON, which doesn't rely upon specific characters being disallowed. For
3208
+ # example, representing labels as the string: name + "_" + value would prove
3209
+ # problematic if we were to allow "_" in a future release.
3210
+ # Corresponds to the JSON property `labels`
3211
+ # @return [Hash<String,String>]
3212
+ attr_accessor :labels
3213
+
3214
+ # Allowed values of the "default_leader" schema option for databases in
3215
+ # instances that use this instance configuration.
3216
+ # Corresponds to the JSON property `leaderOptions`
3217
+ # @return [Array<String>]
3218
+ attr_accessor :leader_options
3219
+
3220
+ # A unique identifier for the instance configuration. Values are of the form `
3221
+ # projects//instanceConfigs/a-z*`. User instance configuration must start with `
3222
+ # custom-`.
3223
+ # Corresponds to the JSON property `name`
3224
+ # @return [String]
3225
+ attr_accessor :name
3226
+
3227
+ # Output only. The available optional replicas to choose from for user-managed
3228
+ # configurations. Populated for Google-managed configurations.
3229
+ # Corresponds to the JSON property `optionalReplicas`
3230
+ # @return [Array<Google::Apis::SpannerV1::ReplicaInfo>]
3231
+ attr_accessor :optional_replicas
3232
+
3233
+ # Output only. The `QuorumType` of the instance configuration.
3234
+ # Corresponds to the JSON property `quorumType`
3235
+ # @return [String]
3236
+ attr_accessor :quorum_type
3237
+
3238
+ # Output only. If true, the instance configuration is being created or updated.
3239
+ # If false, there are no ongoing operations for the instance configuration.
3240
+ # Corresponds to the JSON property `reconciling`
3241
+ # @return [Boolean]
3242
+ attr_accessor :reconciling
3243
+ alias_method :reconciling?, :reconciling
3244
+
3245
+ # The geographic placement of nodes in this instance configuration and their
3246
+ # replication properties. To create user-managed configurations, input `replicas`
3247
+ # must include all replicas in `replicas` of the `base_config` and include one
3248
+ # or more replicas in the `optional_replicas` of the `base_config`.
3249
+ # Corresponds to the JSON property `replicas`
3250
+ # @return [Array<Google::Apis::SpannerV1::ReplicaInfo>]
3251
+ attr_accessor :replicas
3252
+
3253
+ # Output only. The current instance configuration state. Applicable only for `
3254
+ # USER_MANAGED` configurations.
3255
+ # Corresponds to the JSON property `state`
3256
+ # @return [String]
3257
+ attr_accessor :state
3258
+
3259
+ # Output only. The storage limit in bytes per processing unit.
3260
+ # Corresponds to the JSON property `storageLimitPerProcessingUnit`
3261
+ # @return [Fixnum]
3262
+ attr_accessor :storage_limit_per_processing_unit
3263
+
3264
+ def initialize(**args)
3265
+ update!(**args)
3266
+ end
3267
+
3268
+ # Update properties of this object
3269
+ def update!(**args)
3270
+ @base_config = args[:base_config] if args.key?(:base_config)
3271
+ @config_type = args[:config_type] if args.key?(:config_type)
3272
+ @display_name = args[:display_name] if args.key?(:display_name)
3273
+ @etag = args[:etag] if args.key?(:etag)
3274
+ @free_instance_availability = args[:free_instance_availability] if args.key?(:free_instance_availability)
3275
+ @labels = args[:labels] if args.key?(:labels)
3276
+ @leader_options = args[:leader_options] if args.key?(:leader_options)
3277
+ @name = args[:name] if args.key?(:name)
3278
+ @optional_replicas = args[:optional_replicas] if args.key?(:optional_replicas)
3279
+ @quorum_type = args[:quorum_type] if args.key?(:quorum_type)
3280
+ @reconciling = args[:reconciling] if args.key?(:reconciling)
3281
+ @replicas = args[:replicas] if args.key?(:replicas)
3282
+ @state = args[:state] if args.key?(:state)
3283
+ @storage_limit_per_processing_unit = args[:storage_limit_per_processing_unit] if args.key?(:storage_limit_per_processing_unit)
3284
+ end
3285
+ end
3286
+
3287
+ # Encapsulates progress related information for a Cloud Spanner long running
3288
+ # instance operations.
3289
+ class InstanceOperationProgress
3290
+ include Google::Apis::Core::Hashable
3291
+
3292
+ # If set, the time at which this operation failed or was completed successfully.
3293
+ # Corresponds to the JSON property `endTime`
3294
+ # @return [String]
3295
+ attr_accessor :end_time
3296
+
3297
+ # Percent completion of the operation. Values are between 0 and 100 inclusive.
3298
+ # Corresponds to the JSON property `progressPercent`
3299
+ # @return [Fixnum]
3300
+ attr_accessor :progress_percent
3301
+
3302
+ # Time the request was received.
3303
+ # Corresponds to the JSON property `startTime`
3304
+ # @return [String]
3305
+ attr_accessor :start_time
1895
3306
 
1896
3307
  def initialize(**args)
1897
3308
  update!(**args)
@@ -1899,101 +3310,94 @@ module Google
1899
3310
 
1900
3311
  # Update properties of this object
1901
3312
  def update!(**args)
1902
- @key_range_infos = args[:key_range_infos] if args.key?(:key_range_infos)
3313
+ @end_time = args[:end_time] if args.key?(:end_time)
3314
+ @progress_percent = args[:progress_percent] if args.key?(:progress_percent)
3315
+ @start_time = args[:start_time] if args.key?(:start_time)
1903
3316
  end
1904
3317
  end
1905
3318
 
1906
- # An isolated set of Cloud Spanner resources on which databases can be hosted.
1907
- class Instance
3319
+ # An isolated set of Cloud Spanner resources that databases can define
3320
+ # placements on.
3321
+ class InstancePartition
1908
3322
  include Google::Apis::Core::Hashable
1909
3323
 
1910
- # Required. The name of the instance's configuration. Values are of the form `
1911
- # projects//instanceConfigs/`. See also InstanceConfig and ListInstanceConfigs.
3324
+ # Required. The name of the instance partition's configuration. Values are of
3325
+ # the form `projects//instanceConfigs/`. See also InstanceConfig and
3326
+ # ListInstanceConfigs.
1912
3327
  # Corresponds to the JSON property `config`
1913
3328
  # @return [String]
1914
3329
  attr_accessor :config
1915
3330
 
1916
- # Output only. The time at which the instance was created.
3331
+ # Output only. The time at which the instance partition was created.
1917
3332
  # Corresponds to the JSON property `createTime`
1918
3333
  # @return [String]
1919
3334
  attr_accessor :create_time
1920
3335
 
1921
- # Required. The descriptive name for this instance as it appears in UIs. Must be
1922
- # unique per project and between 4 and 30 characters in length.
3336
+ # Required. The descriptive name for this instance partition as it appears in
3337
+ # UIs. Must be unique per project and between 4 and 30 characters in length.
1923
3338
  # Corresponds to the JSON property `displayName`
1924
3339
  # @return [String]
1925
3340
  attr_accessor :display_name
1926
3341
 
1927
- # Deprecated. This field is not populated.
1928
- # Corresponds to the JSON property `endpointUris`
1929
- # @return [Array<String>]
1930
- attr_accessor :endpoint_uris
1931
-
1932
- # Free instance specific metadata that is kept even after an instance has been
1933
- # upgraded for tracking purposes.
1934
- # Corresponds to the JSON property `freeInstanceMetadata`
1935
- # @return [Google::Apis::SpannerV1::FreeInstanceMetadata]
1936
- attr_accessor :free_instance_metadata
1937
-
1938
- # The `InstanceType` of the current instance.
1939
- # Corresponds to the JSON property `instanceType`
3342
+ # Used for optimistic concurrency control as a way to help prevent simultaneous
3343
+ # updates of a instance partition from overwriting each other. It is strongly
3344
+ # suggested that systems make use of the etag in the read-modify-write cycle to
3345
+ # perform instance partition updates in order to avoid race conditions: An etag
3346
+ # is returned in the response which contains instance partitions, and systems
3347
+ # are expected to put that etag in the request to update instance partitions to
3348
+ # ensure that their change will be applied to the same version of the instance
3349
+ # partition. If no etag is provided in the call to update instance partition,
3350
+ # then the existing instance partition is overwritten blindly.
3351
+ # Corresponds to the JSON property `etag`
1940
3352
  # @return [String]
1941
- attr_accessor :instance_type
1942
-
1943
- # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
1944
- # resources into groups that reflect a customer's organizational needs and
1945
- # deployment strategies. Cloud Labels can be used to filter collections of
1946
- # resources. They can be used to control how resource metrics are aggregated.
1947
- # And they can be used as arguments to policy management rules (e.g. route,
1948
- # firewall, load balancing, etc.). * Label keys must be between 1 and 63
1949
- # characters long and must conform to the following regular expression: `a-z`0,
1950
- # 62``. * Label values must be between 0 and 63 characters long and must conform
1951
- # to the regular expression `[a-z0-9_-]`0,63``. * No more than 64 labels can be
1952
- # associated with a given resource. See https://goo.gl/xmQnxf for more
1953
- # information on and examples of labels. If you plan to use labels in your own
1954
- # code, please note that additional characters may be allowed in the future. And
1955
- # so you are advised to use an internal label representation, such as JSON,
1956
- # which doesn't rely upon specific characters being disallowed. For example,
1957
- # representing labels as the string: name + "_" + value would prove problematic
1958
- # if we were to allow "_" in a future release.
1959
- # Corresponds to the JSON property `labels`
1960
- # @return [Hash<String,String>]
1961
- attr_accessor :labels
3353
+ attr_accessor :etag
1962
3354
 
1963
- # Required. A unique identifier for the instance, which cannot be changed after
1964
- # the instance is created. Values are of the form `projects//instances/a-z*[a-z0-
1965
- # 9]`. The final segment of the name must be between 2 and 64 characters in
1966
- # length.
3355
+ # Required. A unique identifier for the instance partition. Values are of the
3356
+ # form `projects//instances//instancePartitions/a-z*[a-z0-9]`. The final segment
3357
+ # of the name must be between 2 and 64 characters in length. An instance
3358
+ # partition's name cannot be changed after the instance partition is created.
1967
3359
  # Corresponds to the JSON property `name`
1968
3360
  # @return [String]
1969
3361
  attr_accessor :name
1970
3362
 
1971
- # The number of nodes allocated to this instance. At most one of either
1972
- # node_count or processing_units should be present in the message. This may be
1973
- # zero in API responses for instances that are not yet in state `READY`. See [
1974
- # the documentation](https://cloud.google.com/spanner/docs/compute-capacity) for
1975
- # more information about nodes and processing units.
3363
+ # The number of nodes allocated to this instance partition. Users can set the `
3364
+ # node_count` field to specify the target number of nodes allocated to the
3365
+ # instance partition. This may be zero in API responses for instance partitions
3366
+ # that are not yet in state `READY`.
1976
3367
  # Corresponds to the JSON property `nodeCount`
1977
3368
  # @return [Fixnum]
1978
3369
  attr_accessor :node_count
1979
3370
 
1980
- # The number of processing units allocated to this instance. At most one of
1981
- # processing_units or node_count should be present in the message. This may be
1982
- # zero in API responses for instances that are not yet in state `READY`. See [
1983
- # the documentation](https://cloud.google.com/spanner/docs/compute-capacity) for
1984
- # more information about nodes and processing units.
3371
+ # The number of processing units allocated to this instance partition. Users can
3372
+ # set the `processing_units` field to specify the target number of processing
3373
+ # units allocated to the instance partition. This might be zero in API responses
3374
+ # for instance partitions that are not yet in the `READY` state.
1985
3375
  # Corresponds to the JSON property `processingUnits`
1986
3376
  # @return [Fixnum]
1987
3377
  attr_accessor :processing_units
1988
3378
 
1989
- # Output only. The current instance state. For CreateInstance, the state must be
1990
- # either omitted or set to `CREATING`. For UpdateInstance, the state must be
1991
- # either omitted or set to `READY`.
3379
+ # Output only. Deprecated: This field is not populated. Output only. The names
3380
+ # of the backups that reference this instance partition. Referencing backups
3381
+ # should share the parent instance. The existence of any referencing backup
3382
+ # prevents the instance partition from being deleted.
3383
+ # Corresponds to the JSON property `referencingBackups`
3384
+ # @return [Array<String>]
3385
+ attr_accessor :referencing_backups
3386
+
3387
+ # Output only. The names of the databases that reference this instance partition.
3388
+ # Referencing databases should share the parent instance. The existence of any
3389
+ # referencing database prevents the instance partition from being deleted.
3390
+ # Corresponds to the JSON property `referencingDatabases`
3391
+ # @return [Array<String>]
3392
+ attr_accessor :referencing_databases
3393
+
3394
+ # Output only. The current instance partition state.
1992
3395
  # Corresponds to the JSON property `state`
1993
3396
  # @return [String]
1994
3397
  attr_accessor :state
1995
3398
 
1996
- # Output only. The time at which the instance was most recently updated.
3399
+ # Output only. The time at which the instance partition was most recently
3400
+ # updated.
1997
3401
  # Corresponds to the JSON property `updateTime`
1998
3402
  # @return [String]
1999
3403
  attr_accessor :update_time
@@ -2007,51 +3411,25 @@ module Google
2007
3411
  @config = args[:config] if args.key?(:config)
2008
3412
  @create_time = args[:create_time] if args.key?(:create_time)
2009
3413
  @display_name = args[:display_name] if args.key?(:display_name)
2010
- @endpoint_uris = args[:endpoint_uris] if args.key?(:endpoint_uris)
2011
- @free_instance_metadata = args[:free_instance_metadata] if args.key?(:free_instance_metadata)
2012
- @instance_type = args[:instance_type] if args.key?(:instance_type)
2013
- @labels = args[:labels] if args.key?(:labels)
3414
+ @etag = args[:etag] if args.key?(:etag)
2014
3415
  @name = args[:name] if args.key?(:name)
2015
3416
  @node_count = args[:node_count] if args.key?(:node_count)
2016
3417
  @processing_units = args[:processing_units] if args.key?(:processing_units)
3418
+ @referencing_backups = args[:referencing_backups] if args.key?(:referencing_backups)
3419
+ @referencing_databases = args[:referencing_databases] if args.key?(:referencing_databases)
2017
3420
  @state = args[:state] if args.key?(:state)
2018
3421
  @update_time = args[:update_time] if args.key?(:update_time)
2019
3422
  end
2020
3423
  end
2021
3424
 
2022
- # A possible configuration for a Cloud Spanner instance. Configurations define
2023
- # the geographic placement of nodes and their replication.
2024
- class InstanceConfig
3425
+ # ReplicaSelection identifies replicas with common properties.
3426
+ class InstanceReplicaSelection
2025
3427
  include Google::Apis::Core::Hashable
2026
3428
 
2027
- # The name of this instance configuration as it appears in UIs.
2028
- # Corresponds to the JSON property `displayName`
2029
- # @return [String]
2030
- attr_accessor :display_name
2031
-
2032
- # Output only. Describes whether free instances are available to be created in
2033
- # this instance config.
2034
- # Corresponds to the JSON property `freeInstanceAvailability`
2035
- # @return [String]
2036
- attr_accessor :free_instance_availability
2037
-
2038
- # Allowed values of the "default_leader" schema option for databases in
2039
- # instances that use this instance configuration.
2040
- # Corresponds to the JSON property `leaderOptions`
2041
- # @return [Array<String>]
2042
- attr_accessor :leader_options
2043
-
2044
- # A unique identifier for the instance configuration. Values are of the form `
2045
- # projects//instanceConfigs/a-z*`.
2046
- # Corresponds to the JSON property `name`
3429
+ # Required. Name of the location of the replicas (e.g., "us-central1").
3430
+ # Corresponds to the JSON property `location`
2047
3431
  # @return [String]
2048
- attr_accessor :name
2049
-
2050
- # The geographic placement of nodes in this instance configuration and their
2051
- # replication properties.
2052
- # Corresponds to the JSON property `replicas`
2053
- # @return [Array<Google::Apis::SpannerV1::ReplicaInfo>]
2054
- attr_accessor :replicas
3432
+ attr_accessor :location
2055
3433
 
2056
3434
  def initialize(**args)
2057
3435
  update!(**args)
@@ -2059,11 +3437,7 @@ module Google
2059
3437
 
2060
3438
  # Update properties of this object
2061
3439
  def update!(**args)
2062
- @display_name = args[:display_name] if args.key?(:display_name)
2063
- @free_instance_availability = args[:free_instance_availability] if args.key?(:free_instance_availability)
2064
- @leader_options = args[:leader_options] if args.key?(:leader_options)
2065
- @name = args[:name] if args.key?(:name)
2066
- @replicas = args[:replicas] if args.key?(:replicas)
3440
+ @location = args[:location] if args.key?(:location)
2067
3441
  end
2068
3442
  end
2069
3443
 
@@ -2311,6 +3685,32 @@ module Google
2311
3685
  end
2312
3686
  end
2313
3687
 
3688
+ # The response for ListBackupSchedules.
3689
+ class ListBackupSchedulesResponse
3690
+ include Google::Apis::Core::Hashable
3691
+
3692
+ # The list of backup schedules for a database.
3693
+ # Corresponds to the JSON property `backupSchedules`
3694
+ # @return [Array<Google::Apis::SpannerV1::BackupSchedule>]
3695
+ attr_accessor :backup_schedules
3696
+
3697
+ # `next_page_token` can be sent in a subsequent ListBackupSchedules call to
3698
+ # fetch more of the schedules.
3699
+ # Corresponds to the JSON property `nextPageToken`
3700
+ # @return [String]
3701
+ attr_accessor :next_page_token
3702
+
3703
+ def initialize(**args)
3704
+ update!(**args)
3705
+ end
3706
+
3707
+ # Update properties of this object
3708
+ def update!(**args)
3709
+ @backup_schedules = args[:backup_schedules] if args.key?(:backup_schedules)
3710
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
3711
+ end
3712
+ end
3713
+
2314
3714
  # The response for ListBackups.
2315
3715
  class ListBackupsResponse
2316
3716
  include Google::Apis::Core::Hashable
@@ -2418,6 +3818,35 @@ module Google
2418
3818
  end
2419
3819
  end
2420
3820
 
3821
+ # The response for ListInstanceConfigOperations.
3822
+ class ListInstanceConfigOperationsResponse
3823
+ include Google::Apis::Core::Hashable
3824
+
3825
+ # `next_page_token` can be sent in a subsequent ListInstanceConfigOperations
3826
+ # call to fetch more of the matching metadata.
3827
+ # Corresponds to the JSON property `nextPageToken`
3828
+ # @return [String]
3829
+ attr_accessor :next_page_token
3830
+
3831
+ # The list of matching instance configuration long-running operations. Each
3832
+ # operation's name will be prefixed by the name of the instance configuration.
3833
+ # The operation's metadata field type `metadata.type_url` describes the type of
3834
+ # the metadata.
3835
+ # Corresponds to the JSON property `operations`
3836
+ # @return [Array<Google::Apis::SpannerV1::Operation>]
3837
+ attr_accessor :operations
3838
+
3839
+ def initialize(**args)
3840
+ update!(**args)
3841
+ end
3842
+
3843
+ # Update properties of this object
3844
+ def update!(**args)
3845
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
3846
+ @operations = args[:operations] if args.key?(:operations)
3847
+ end
3848
+ end
3849
+
2421
3850
  # The response for ListInstanceConfigs.
2422
3851
  class ListInstanceConfigsResponse
2423
3852
  include Google::Apis::Core::Hashable
@@ -2444,6 +3873,77 @@ module Google
2444
3873
  end
2445
3874
  end
2446
3875
 
3876
+ # The response for ListInstancePartitionOperations.
3877
+ class ListInstancePartitionOperationsResponse
3878
+ include Google::Apis::Core::Hashable
3879
+
3880
+ # `next_page_token` can be sent in a subsequent ListInstancePartitionOperations
3881
+ # call to fetch more of the matching metadata.
3882
+ # Corresponds to the JSON property `nextPageToken`
3883
+ # @return [String]
3884
+ attr_accessor :next_page_token
3885
+
3886
+ # The list of matching instance partition long-running operations. Each
3887
+ # operation's name will be prefixed by the instance partition's name. The
3888
+ # operation's metadata field type `metadata.type_url` describes the type of the
3889
+ # metadata.
3890
+ # Corresponds to the JSON property `operations`
3891
+ # @return [Array<Google::Apis::SpannerV1::Operation>]
3892
+ attr_accessor :operations
3893
+
3894
+ # The list of unreachable instance partitions. It includes the names of instance
3895
+ # partitions whose operation metadata could not be retrieved within
3896
+ # instance_partition_deadline.
3897
+ # Corresponds to the JSON property `unreachableInstancePartitions`
3898
+ # @return [Array<String>]
3899
+ attr_accessor :unreachable_instance_partitions
3900
+
3901
+ def initialize(**args)
3902
+ update!(**args)
3903
+ end
3904
+
3905
+ # Update properties of this object
3906
+ def update!(**args)
3907
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
3908
+ @operations = args[:operations] if args.key?(:operations)
3909
+ @unreachable_instance_partitions = args[:unreachable_instance_partitions] if args.key?(:unreachable_instance_partitions)
3910
+ end
3911
+ end
3912
+
3913
+ # The response for ListInstancePartitions.
3914
+ class ListInstancePartitionsResponse
3915
+ include Google::Apis::Core::Hashable
3916
+
3917
+ # The list of requested instancePartitions.
3918
+ # Corresponds to the JSON property `instancePartitions`
3919
+ # @return [Array<Google::Apis::SpannerV1::InstancePartition>]
3920
+ attr_accessor :instance_partitions
3921
+
3922
+ # `next_page_token` can be sent in a subsequent ListInstancePartitions call to
3923
+ # fetch more of the matching instance partitions.
3924
+ # Corresponds to the JSON property `nextPageToken`
3925
+ # @return [String]
3926
+ attr_accessor :next_page_token
3927
+
3928
+ # The list of unreachable instances or instance partitions. It includes the
3929
+ # names of instances or instance partitions whose metadata could not be
3930
+ # retrieved within instance_partition_deadline.
3931
+ # Corresponds to the JSON property `unreachable`
3932
+ # @return [Array<String>]
3933
+ attr_accessor :unreachable
3934
+
3935
+ def initialize(**args)
3936
+ update!(**args)
3937
+ end
3938
+
3939
+ # Update properties of this object
3940
+ def update!(**args)
3941
+ @instance_partitions = args[:instance_partitions] if args.key?(:instance_partitions)
3942
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
3943
+ @unreachable = args[:unreachable] if args.key?(:unreachable)
3944
+ end
3945
+ end
3946
+
2447
3947
  # The response for ListInstances.
2448
3948
  class ListInstancesResponse
2449
3949
  include Google::Apis::Core::Hashable
@@ -2727,6 +4227,57 @@ module Google
2727
4227
  end
2728
4228
  end
2729
4229
 
4230
+ # The request for MoveInstance.
4231
+ class MoveInstanceRequest
4232
+ include Google::Apis::Core::Hashable
4233
+
4234
+ # Required. The target instance configuration where to move the instance. Values
4235
+ # are of the form `projects//instanceConfigs/`.
4236
+ # Corresponds to the JSON property `targetConfig`
4237
+ # @return [String]
4238
+ attr_accessor :target_config
4239
+
4240
+ def initialize(**args)
4241
+ update!(**args)
4242
+ end
4243
+
4244
+ # Update properties of this object
4245
+ def update!(**args)
4246
+ @target_config = args[:target_config] if args.key?(:target_config)
4247
+ end
4248
+ end
4249
+
4250
+ # When a read-write transaction is executed on a multiplexed session, this
4251
+ # precommit token is sent back to the client as a part of the [Transaction]
4252
+ # message in the BeginTransaction response and also as a part of the [ResultSet]
4253
+ # and [PartialResultSet] responses.
4254
+ class MultiplexedSessionPrecommitToken
4255
+ include Google::Apis::Core::Hashable
4256
+
4257
+ # Opaque precommit token.
4258
+ # Corresponds to the JSON property `precommitToken`
4259
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
4260
+ # @return [String]
4261
+ attr_accessor :precommit_token
4262
+
4263
+ # An incrementing seq number is generated on every precommit token that is
4264
+ # returned. Clients should remember the precommit token with the highest
4265
+ # sequence number from the current transaction attempt.
4266
+ # Corresponds to the JSON property `seqNum`
4267
+ # @return [Fixnum]
4268
+ attr_accessor :seq_num
4269
+
4270
+ def initialize(**args)
4271
+ update!(**args)
4272
+ end
4273
+
4274
+ # Update properties of this object
4275
+ def update!(**args)
4276
+ @precommit_token = args[:precommit_token] if args.key?(:precommit_token)
4277
+ @seq_num = args[:seq_num] if args.key?(:seq_num)
4278
+ end
4279
+ end
4280
+
2730
4281
  # A modification to one or more Cloud Spanner rows. Mutations can be applied to
2731
4282
  # a Cloud Spanner database by sending them in a Commit call.
2732
4283
  class Mutation
@@ -2771,6 +4322,27 @@ module Google
2771
4322
  end
2772
4323
  end
2773
4324
 
4325
+ # A group of mutations to be committed together. Related mutations should be
4326
+ # placed in a group. For example, two mutations inserting rows with the same
4327
+ # primary key prefix in both parent and child tables are related.
4328
+ class MutationGroup
4329
+ include Google::Apis::Core::Hashable
4330
+
4331
+ # Required. The mutations in this group.
4332
+ # Corresponds to the JSON property `mutations`
4333
+ # @return [Array<Google::Apis::SpannerV1::Mutation>]
4334
+ attr_accessor :mutations
4335
+
4336
+ def initialize(**args)
4337
+ update!(**args)
4338
+ end
4339
+
4340
+ # Update properties of this object
4341
+ def update!(**args)
4342
+ @mutations = args[:mutations] if args.key?(:mutations)
4343
+ end
4344
+ end
4345
+
2774
4346
  # This resource represents a long-running operation that is the result of a
2775
4347
  # network API call.
2776
4348
  class Operation
@@ -2808,13 +4380,13 @@ module Google
2808
4380
  # @return [String]
2809
4381
  attr_accessor :name
2810
4382
 
2811
- # The normal response of the operation in case of success. If the original
2812
- # method returns no data on success, such as `Delete`, the response is `google.
2813
- # protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`,
2814
- # the response should be the resource. For other methods, the response should
2815
- # have the type `XxxResponse`, where `Xxx` is the original method name. For
2816
- # example, if the original method name is `TakeSnapshot()`, the inferred
2817
- # response type is `TakeSnapshotResponse`.
4383
+ # The normal, successful response of the operation. If the original method
4384
+ # returns no data on success, such as `Delete`, the response is `google.protobuf.
4385
+ # Empty`. If the original method is standard `Get`/`Create`/`Update`, the
4386
+ # response should be the resource. For other methods, the response should have
4387
+ # the type `XxxResponse`, where `Xxx` is the original method name. For example,
4388
+ # if the original method name is `TakeSnapshot()`, the inferred response type is
4389
+ # `TakeSnapshotResponse`.
2818
4390
  # Corresponds to the JSON property `response`
2819
4391
  # @return [Hash<String,Object>]
2820
4392
  attr_accessor :response
@@ -2913,6 +4485,14 @@ module Google
2913
4485
  # @return [Google::Apis::SpannerV1::ResultSetMetadata]
2914
4486
  attr_accessor :metadata
2915
4487
 
4488
+ # When a read-write transaction is executed on a multiplexed session, this
4489
+ # precommit token is sent back to the client as a part of the [Transaction]
4490
+ # message in the BeginTransaction response and also as a part of the [ResultSet]
4491
+ # and [PartialResultSet] responses.
4492
+ # Corresponds to the JSON property `precommitToken`
4493
+ # @return [Google::Apis::SpannerV1::MultiplexedSessionPrecommitToken]
4494
+ attr_accessor :precommit_token
4495
+
2916
4496
  # Streaming calls might be interrupted for a variety of reasons, such as TCP
2917
4497
  # connection loss. If this occurs, the stream of results can be resumed by re-
2918
4498
  # sending the original request and including `resume_token`. Note that executing
@@ -2974,6 +4554,7 @@ module Google
2974
4554
  def update!(**args)
2975
4555
  @chunked_value = args[:chunked_value] if args.key?(:chunked_value)
2976
4556
  @metadata = args[:metadata] if args.key?(:metadata)
4557
+ @precommit_token = args[:precommit_token] if args.key?(:precommit_token)
2977
4558
  @resume_token = args[:resume_token] if args.key?(:resume_token)
2978
4559
  @stats = args[:stats] if args.key?(:stats)
2979
4560
  @values = args[:values] if args.key?(:values)
@@ -3064,14 +4645,15 @@ module Google
3064
4645
  # @return [Google::Apis::SpannerV1::PartitionOptions]
3065
4646
  attr_accessor :partition_options
3066
4647
 
3067
- # Required. The query request to generate partitions for. The request will fail
3068
- # if the query is not root partitionable. The query plan of a root partitionable
3069
- # query has a single distributed union operator. A distributed union operator
3070
- # conceptually divides one or more tables into multiple splits, remotely
3071
- # evaluates a subquery independently on each split, and then unions all results.
3072
- # This must not contain DML commands, such as INSERT, UPDATE, or DELETE. Use
3073
- # ExecuteStreamingSql with a PartitionedDml transaction for large, partition-
3074
- # friendly DML operations.
4648
+ # Required. The query request to generate partitions for. The request fails if
4649
+ # the query is not root partitionable. For a query to be root partitionable, it
4650
+ # needs to satisfy a few conditions. For example, if the query execution plan
4651
+ # contains a distributed union operator, then it must be the first operator in
4652
+ # the plan. For more information about other conditions, see [Read data in
4653
+ # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel).
4654
+ # The query request must not contain DML commands, such as `INSERT`, `UPDATE`,
4655
+ # or `DELETE`. Use `ExecuteStreamingSql` with a PartitionedDml transaction for
4656
+ # large, partition-friendly DML operations.
3075
4657
  # Corresponds to the JSON property `sql`
3076
4658
  # @return [String]
3077
4659
  attr_accessor :sql
@@ -3265,22 +4847,22 @@ module Google
3265
4847
  # evaluates to `true`. A condition can add constraints based on attributes of
3266
4848
  # the request, the resource, or both. To learn which resources support
3267
4849
  # conditions in their IAM policies, see the [IAM documentation](https://cloud.
3268
- # google.com/iam/help/conditions/resource-policies). **JSON example:** ` "
4850
+ # google.com/iam/help/conditions/resource-policies). **JSON example:** ``` ` "
3269
4851
  # bindings": [ ` "role": "roles/resourcemanager.organizationAdmin", "members": [
3270
4852
  # "user:mike@example.com", "group:admins@example.com", "domain:google.com", "
3271
4853
  # serviceAccount:my-project-id@appspot.gserviceaccount.com" ] `, ` "role": "
3272
4854
  # roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com"
3273
4855
  # ], "condition": ` "title": "expirable access", "description": "Does not grant
3274
4856
  # access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:
3275
- # 00:00.000Z')", ` ` ], "etag": "BwWWja0YfJA=", "version": 3 ` **YAML example:**
3276
- # bindings: - members: - user:mike@example.com - group:admins@example.com -
3277
- # domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
3278
- # role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.
3279
- # com role: roles/resourcemanager.organizationViewer condition: title: expirable
3280
- # access description: Does not grant access after Sep 2020 expression: request.
3281
- # time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For
3282
- # a description of IAM and its features, see the [IAM documentation](https://
3283
- # cloud.google.com/iam/docs/).
4857
+ # 00:00.000Z')", ` ` ], "etag": "BwWWja0YfJA=", "version": 3 ` ``` **YAML
4858
+ # example:** ``` bindings: - members: - user:mike@example.com - group:admins@
4859
+ # example.com - domain:google.com - serviceAccount:my-project-id@appspot.
4860
+ # gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: -
4861
+ # user:eve@example.com role: roles/resourcemanager.organizationViewer condition:
4862
+ # title: expirable access description: Does not grant access after Sep 2020
4863
+ # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag:
4864
+ # BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the
4865
+ # [IAM documentation](https://cloud.google.com/iam/docs/).
3284
4866
  class Policy
3285
4867
  include Google::Apis::Core::Hashable
3286
4868
 
@@ -3392,6 +4974,27 @@ module Google
3392
4974
  end
3393
4975
  end
3394
4976
 
4977
+ # Output of query advisor analysis.
4978
+ class QueryAdvisorResult
4979
+ include Google::Apis::Core::Hashable
4980
+
4981
+ # Optional. Index Recommendation for a query. This is an optional field and the
4982
+ # recommendation will only be available when the recommendation guarantees
4983
+ # significant improvement in query performance.
4984
+ # Corresponds to the JSON property `indexAdvice`
4985
+ # @return [Array<Google::Apis::SpannerV1::IndexAdvice>]
4986
+ attr_accessor :index_advice
4987
+
4988
+ def initialize(**args)
4989
+ update!(**args)
4990
+ end
4991
+
4992
+ # Update properties of this object
4993
+ def update!(**args)
4994
+ @index_advice = args[:index_advice] if args.key?(:index_advice)
4995
+ end
4996
+ end
4997
+
3395
4998
  # Query optimizer configuration.
3396
4999
  class QueryOptions
3397
5000
  include Google::Apis::Core::Hashable
@@ -3450,6 +5053,11 @@ module Google
3450
5053
  # @return [Array<Google::Apis::SpannerV1::PlanNode>]
3451
5054
  attr_accessor :plan_nodes
3452
5055
 
5056
+ # Output of query advisor analysis.
5057
+ # Corresponds to the JSON property `queryAdvice`
5058
+ # @return [Google::Apis::SpannerV1::QueryAdvisorResult]
5059
+ attr_accessor :query_advice
5060
+
3453
5061
  def initialize(**args)
3454
5062
  update!(**args)
3455
5063
  end
@@ -3457,6 +5065,73 @@ module Google
3457
5065
  # Update properties of this object
3458
5066
  def update!(**args)
3459
5067
  @plan_nodes = args[:plan_nodes] if args.key?(:plan_nodes)
5068
+ @query_advice = args[:query_advice] if args.key?(:query_advice)
5069
+ end
5070
+ end
5071
+
5072
+ # Information about the dual-region quorum.
5073
+ class QuorumInfo
5074
+ include Google::Apis::Core::Hashable
5075
+
5076
+ # Output only. The etag is used for optimistic concurrency control as a way to
5077
+ # help prevent simultaneous `ChangeQuorum` requests that might create a race
5078
+ # condition.
5079
+ # Corresponds to the JSON property `etag`
5080
+ # @return [String]
5081
+ attr_accessor :etag
5082
+
5083
+ # Output only. Whether this `ChangeQuorum` is Google or User initiated.
5084
+ # Corresponds to the JSON property `initiator`
5085
+ # @return [String]
5086
+ attr_accessor :initiator
5087
+
5088
+ # Information about the database quorum type. This only applies to dual-region
5089
+ # instance configs.
5090
+ # Corresponds to the JSON property `quorumType`
5091
+ # @return [Google::Apis::SpannerV1::QuorumType]
5092
+ attr_accessor :quorum_type
5093
+
5094
+ # Output only. The timestamp when the request was triggered.
5095
+ # Corresponds to the JSON property `startTime`
5096
+ # @return [String]
5097
+ attr_accessor :start_time
5098
+
5099
+ def initialize(**args)
5100
+ update!(**args)
5101
+ end
5102
+
5103
+ # Update properties of this object
5104
+ def update!(**args)
5105
+ @etag = args[:etag] if args.key?(:etag)
5106
+ @initiator = args[:initiator] if args.key?(:initiator)
5107
+ @quorum_type = args[:quorum_type] if args.key?(:quorum_type)
5108
+ @start_time = args[:start_time] if args.key?(:start_time)
5109
+ end
5110
+ end
5111
+
5112
+ # Information about the database quorum type. This only applies to dual-region
5113
+ # instance configs.
5114
+ class QuorumType
5115
+ include Google::Apis::Core::Hashable
5116
+
5117
+ # Message type for a dual-region quorum. Currently this type has no options.
5118
+ # Corresponds to the JSON property `dualRegion`
5119
+ # @return [Google::Apis::SpannerV1::DualRegionQuorum]
5120
+ attr_accessor :dual_region
5121
+
5122
+ # Message type for a single-region quorum.
5123
+ # Corresponds to the JSON property `singleRegion`
5124
+ # @return [Google::Apis::SpannerV1::SingleRegionQuorum]
5125
+ attr_accessor :single_region
5126
+
5127
+ def initialize(**args)
5128
+ update!(**args)
5129
+ end
5130
+
5131
+ # Update properties of this object
5132
+ def update!(**args)
5133
+ @dual_region = args[:dual_region] if args.key?(:dual_region)
5134
+ @single_region = args[:single_region] if args.key?(:single_region)
3460
5135
  end
3461
5136
  end
3462
5137
 
@@ -3545,6 +5220,23 @@ module Google
3545
5220
  # @return [Array<String>]
3546
5221
  attr_accessor :columns
3547
5222
 
5223
+ # If this is for a partitioned read and this field is set to `true`, the request
5224
+ # is executed with Spanner Data Boost independent compute resources. If the
5225
+ # field is set to `true` but the request does not set `partition_token`, the API
5226
+ # returns an `INVALID_ARGUMENT` error.
5227
+ # Corresponds to the JSON property `dataBoostEnabled`
5228
+ # @return [Boolean]
5229
+ attr_accessor :data_boost_enabled
5230
+ alias_method :data_boost_enabled?, :data_boost_enabled
5231
+
5232
+ # The DirectedReadOptions can be used to indicate which replicas or regions
5233
+ # should be used for non-transactional reads or queries. DirectedReadOptions may
5234
+ # only be specified for a read-only transaction, otherwise the API will return
5235
+ # an `INVALID_ARGUMENT` error.
5236
+ # Corresponds to the JSON property `directedReadOptions`
5237
+ # @return [Google::Apis::SpannerV1::DirectedReadOptions]
5238
+ attr_accessor :directed_read_options
5239
+
3548
5240
  # If non-empty, the name of an index on table. This index is used instead of the
3549
5241
  # table primary key when interpreting key_set and sorting result rows. See
3550
5242
  # key_set for further information.
@@ -3568,6 +5260,22 @@ module Google
3568
5260
  # @return [Fixnum]
3569
5261
  attr_accessor :limit
3570
5262
 
5263
+ # Optional. Lock Hint for the request, it can only be used with read-write
5264
+ # transactions.
5265
+ # Corresponds to the JSON property `lockHint`
5266
+ # @return [String]
5267
+ attr_accessor :lock_hint
5268
+
5269
+ # Optional. Order for the returned rows. By default, Spanner will return result
5270
+ # rows in primary key order except for PartitionRead requests. For applications
5271
+ # that do not require rows to be returned in primary key (`ORDER_BY_PRIMARY_KEY`)
5272
+ # order, setting `ORDER_BY_NO_ORDER` option allows Spanner to optimize row
5273
+ # retrieval, resulting in lower latencies in certain cases (e.g. bulk point
5274
+ # lookups).
5275
+ # Corresponds to the JSON property `orderBy`
5276
+ # @return [String]
5277
+ attr_accessor :order_by
5278
+
3571
5279
  # If present, results will be restricted to the specified partition previously
3572
5280
  # created using PartitionRead(). There must be an exact match for the values of
3573
5281
  # fields common to this message and the PartitionReadRequest message used to
@@ -3610,9 +5318,13 @@ module Google
3610
5318
  # Update properties of this object
3611
5319
  def update!(**args)
3612
5320
  @columns = args[:columns] if args.key?(:columns)
5321
+ @data_boost_enabled = args[:data_boost_enabled] if args.key?(:data_boost_enabled)
5322
+ @directed_read_options = args[:directed_read_options] if args.key?(:directed_read_options)
3613
5323
  @index = args[:index] if args.key?(:index)
3614
5324
  @key_set = args[:key_set] if args.key?(:key_set)
3615
5325
  @limit = args[:limit] if args.key?(:limit)
5326
+ @lock_hint = args[:lock_hint] if args.key?(:lock_hint)
5327
+ @order_by = args[:order_by] if args.key?(:order_by)
3616
5328
  @partition_token = args[:partition_token] if args.key?(:partition_token)
3617
5329
  @request_options = args[:request_options] if args.key?(:request_options)
3618
5330
  @resume_token = args[:resume_token] if args.key?(:resume_token)
@@ -3626,12 +5338,61 @@ module Google
3626
5338
  class ReadWrite
3627
5339
  include Google::Apis::Core::Hashable
3628
5340
 
5341
+ # Optional. Clients should pass the transaction ID of the previous transaction
5342
+ # attempt that was aborted if this transaction is being executed on a
5343
+ # multiplexed session.
5344
+ # Corresponds to the JSON property `multiplexedSessionPreviousTransactionId`
5345
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
5346
+ # @return [String]
5347
+ attr_accessor :multiplexed_session_previous_transaction_id
5348
+
5349
+ # Read lock mode for the transaction.
5350
+ # Corresponds to the JSON property `readLockMode`
5351
+ # @return [String]
5352
+ attr_accessor :read_lock_mode
5353
+
5354
+ def initialize(**args)
5355
+ update!(**args)
5356
+ end
5357
+
5358
+ # Update properties of this object
5359
+ def update!(**args)
5360
+ @multiplexed_session_previous_transaction_id = args[:multiplexed_session_previous_transaction_id] if args.key?(:multiplexed_session_previous_transaction_id)
5361
+ @read_lock_mode = args[:read_lock_mode] if args.key?(:read_lock_mode)
5362
+ end
5363
+ end
5364
+
5365
+ # ReplicaComputeCapacity describes the amount of server resources that are
5366
+ # allocated to each replica identified by the replica selection.
5367
+ class ReplicaComputeCapacity
5368
+ include Google::Apis::Core::Hashable
5369
+
5370
+ # The number of nodes allocated to each replica. This may be zero in API
5371
+ # responses for instances that are not yet in state `READY`.
5372
+ # Corresponds to the JSON property `nodeCount`
5373
+ # @return [Fixnum]
5374
+ attr_accessor :node_count
5375
+
5376
+ # The number of processing units allocated to each replica. This may be zero in
5377
+ # API responses for instances that are not yet in state `READY`.
5378
+ # Corresponds to the JSON property `processingUnits`
5379
+ # @return [Fixnum]
5380
+ attr_accessor :processing_units
5381
+
5382
+ # ReplicaSelection identifies replicas with common properties.
5383
+ # Corresponds to the JSON property `replicaSelection`
5384
+ # @return [Google::Apis::SpannerV1::InstanceReplicaSelection]
5385
+ attr_accessor :replica_selection
5386
+
3629
5387
  def initialize(**args)
3630
5388
  update!(**args)
3631
5389
  end
3632
5390
 
3633
5391
  # Update properties of this object
3634
5392
  def update!(**args)
5393
+ @node_count = args[:node_count] if args.key?(:node_count)
5394
+ @processing_units = args[:processing_units] if args.key?(:processing_units)
5395
+ @replica_selection = args[:replica_selection] if args.key?(:replica_selection)
3635
5396
  end
3636
5397
  end
3637
5398
 
@@ -3647,7 +5408,7 @@ module Google
3647
5408
  attr_accessor :default_leader_location
3648
5409
  alias_method :default_leader_location?, :default_leader_location
3649
5410
 
3650
- # The location of the serving resources, e.g. "us-central1".
5411
+ # The location of the serving resources, e.g., "us-central1".
3651
5412
  # Corresponds to the JSON property `location`
3652
5413
  # @return [String]
3653
5414
  attr_accessor :location
@@ -3669,6 +5430,39 @@ module Google
3669
5430
  end
3670
5431
  end
3671
5432
 
5433
+ # The directed read replica selector. Callers must provide one or more of the
5434
+ # following fields for replica selection: * `location` - The location must be
5435
+ # one of the regions within the multi-region configuration of your database. * `
5436
+ # type` - The type of the replica. Some examples of using replica_selectors are:
5437
+ # * `location:us-east1` --> The "us-east1" replica(s) of any available type will
5438
+ # be used to process the request. * `type:READ_ONLY` --> The "READ_ONLY" type
5439
+ # replica(s) in nearest available location will be used to process the request. *
5440
+ # `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) in
5441
+ # location "us-east1" will be used to process the request.
5442
+ class ReplicaSelection
5443
+ include Google::Apis::Core::Hashable
5444
+
5445
+ # The location or region of the serving requests, e.g. "us-east1".
5446
+ # Corresponds to the JSON property `location`
5447
+ # @return [String]
5448
+ attr_accessor :location
5449
+
5450
+ # The type of replica.
5451
+ # Corresponds to the JSON property `type`
5452
+ # @return [String]
5453
+ attr_accessor :type
5454
+
5455
+ def initialize(**args)
5456
+ update!(**args)
5457
+ end
5458
+
5459
+ # Update properties of this object
5460
+ def update!(**args)
5461
+ @location = args[:location] if args.key?(:location)
5462
+ @type = args[:type] if args.key?(:type)
5463
+ end
5464
+ end
5465
+
3672
5466
  # Common request options for various APIs.
3673
5467
  class RequestOptions
3674
5468
  include Google::Apis::Core::Hashable
@@ -3732,6 +5526,21 @@ module Google
3732
5526
  # @return [String]
3733
5527
  attr_accessor :kms_key_name
3734
5528
 
5529
+ # Optional. Specifies the KMS configuration for one or more keys used to encrypt
5530
+ # the database. Values have the form `projects//locations//keyRings//cryptoKeys/`
5531
+ # . The keys referenced by `kms_key_names` must fully cover all regions of the
5532
+ # database's instance configuration. Some examples: * For regional (single-
5533
+ # region) instance configurations, specify a regional location KMS key. * For
5534
+ # multi-region instance configurations of type `GOOGLE_MANAGED`, either specify
5535
+ # a multi-region location KMS key or multiple regional location KMS keys that
5536
+ # cover all regions in the instance configuration. * For an instance
5537
+ # configuration of type `USER_MANAGED`, specify only regional location KMS keys
5538
+ # to cover each region in the instance configuration. Multi-region location KMS
5539
+ # keys aren't supported for `USER_MANAGED` type instance configurations.
5540
+ # Corresponds to the JSON property `kmsKeyNames`
5541
+ # @return [Array<String>]
5542
+ attr_accessor :kms_key_names
5543
+
3735
5544
  def initialize(**args)
3736
5545
  update!(**args)
3737
5546
  end
@@ -3740,6 +5549,7 @@ module Google
3740
5549
  def update!(**args)
3741
5550
  @encryption_type = args[:encryption_type] if args.key?(:encryption_type)
3742
5551
  @kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
5552
+ @kms_key_names = args[:kms_key_names] if args.key?(:kms_key_names)
3743
5553
  end
3744
5554
  end
3745
5555
 
@@ -3876,6 +5686,14 @@ module Google
3876
5686
  # @return [Google::Apis::SpannerV1::ResultSetMetadata]
3877
5687
  attr_accessor :metadata
3878
5688
 
5689
+ # When a read-write transaction is executed on a multiplexed session, this
5690
+ # precommit token is sent back to the client as a part of the [Transaction]
5691
+ # message in the BeginTransaction response and also as a part of the [ResultSet]
5692
+ # and [PartialResultSet] responses.
5693
+ # Corresponds to the JSON property `precommitToken`
5694
+ # @return [Google::Apis::SpannerV1::MultiplexedSessionPrecommitToken]
5695
+ attr_accessor :precommit_token
5696
+
3879
5697
  # Each element in `rows` is a row whose format is defined by metadata.row_type.
3880
5698
  # The ith element in each row matches the ith field in metadata.row_type.
3881
5699
  # Elements are encoded based on type as described here.
@@ -3895,6 +5713,7 @@ module Google
3895
5713
  # Update properties of this object
3896
5714
  def update!(**args)
3897
5715
  @metadata = args[:metadata] if args.key?(:metadata)
5716
+ @precommit_token = args[:precommit_token] if args.key?(:precommit_token)
3898
5717
  @rows = args[:rows] if args.key?(:rows)
3899
5718
  @stats = args[:stats] if args.key?(:stats)
3900
5719
  end
@@ -3914,6 +5733,11 @@ module Google
3914
5733
  # @return [Google::Apis::SpannerV1::Transaction]
3915
5734
  attr_accessor :transaction
3916
5735
 
5736
+ # `StructType` defines the fields of a STRUCT type.
5737
+ # Corresponds to the JSON property `undeclaredParameters`
5738
+ # @return [Google::Apis::SpannerV1::StructType]
5739
+ attr_accessor :undeclared_parameters
5740
+
3917
5741
  def initialize(**args)
3918
5742
  update!(**args)
3919
5743
  end
@@ -3922,6 +5746,7 @@ module Google
3922
5746
  def update!(**args)
3923
5747
  @row_type = args[:row_type] if args.key?(:row_type)
3924
5748
  @transaction = args[:transaction] if args.key?(:transaction)
5749
+ @undeclared_parameters = args[:undeclared_parameters] if args.key?(:undeclared_parameters)
3925
5750
  end
3926
5751
  end
3927
5752
 
@@ -4096,6 +5921,16 @@ module Google
4096
5921
  # @return [Hash<String,String>]
4097
5922
  attr_accessor :labels
4098
5923
 
5924
+ # Optional. If true, specifies a multiplexed session. Use a multiplexed session
5925
+ # for multiple, concurrent read-only operations. Don't use them for read-write
5926
+ # transactions, partitioned reads, or partitioned queries. Use CreateSession to
5927
+ # create multiplexed sessions. Don't use BatchCreateSessions to create a
5928
+ # multiplexed session. You can't delete or list multiplexed sessions.
5929
+ # Corresponds to the JSON property `multiplexed`
5930
+ # @return [Boolean]
5931
+ attr_accessor :multiplexed
5932
+ alias_method :multiplexed?, :multiplexed
5933
+
4099
5934
  # Output only. The name of the session. This is always system-assigned.
4100
5935
  # Corresponds to the JSON property `name`
4101
5936
  # @return [String]
@@ -4111,6 +5946,7 @@ module Google
4111
5946
  @create_time = args[:create_time] if args.key?(:create_time)
4112
5947
  @creator_role = args[:creator_role] if args.key?(:creator_role)
4113
5948
  @labels = args[:labels] if args.key?(:labels)
5949
+ @multiplexed = args[:multiplexed] if args.key?(:multiplexed)
4114
5950
  @name = args[:name] if args.key?(:name)
4115
5951
  end
4116
5952
  end
@@ -4130,22 +5966,22 @@ module Google
4130
5966
  # evaluates to `true`. A condition can add constraints based on attributes of
4131
5967
  # the request, the resource, or both. To learn which resources support
4132
5968
  # conditions in their IAM policies, see the [IAM documentation](https://cloud.
4133
- # google.com/iam/help/conditions/resource-policies). **JSON example:** ` "
5969
+ # google.com/iam/help/conditions/resource-policies). **JSON example:** ``` ` "
4134
5970
  # bindings": [ ` "role": "roles/resourcemanager.organizationAdmin", "members": [
4135
5971
  # "user:mike@example.com", "group:admins@example.com", "domain:google.com", "
4136
5972
  # serviceAccount:my-project-id@appspot.gserviceaccount.com" ] `, ` "role": "
4137
5973
  # roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com"
4138
5974
  # ], "condition": ` "title": "expirable access", "description": "Does not grant
4139
5975
  # access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:
4140
- # 00:00.000Z')", ` ` ], "etag": "BwWWja0YfJA=", "version": 3 ` **YAML example:**
4141
- # bindings: - members: - user:mike@example.com - group:admins@example.com -
4142
- # domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
4143
- # role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.
4144
- # com role: roles/resourcemanager.organizationViewer condition: title: expirable
4145
- # access description: Does not grant access after Sep 2020 expression: request.
4146
- # time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For
4147
- # a description of IAM and its features, see the [IAM documentation](https://
4148
- # cloud.google.com/iam/docs/).
5976
+ # 00:00.000Z')", ` ` ], "etag": "BwWWja0YfJA=", "version": 3 ` ``` **YAML
5977
+ # example:** ``` bindings: - members: - user:mike@example.com - group:admins@
5978
+ # example.com - domain:google.com - serviceAccount:my-project-id@appspot.
5979
+ # gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: -
5980
+ # user:eve@example.com role: roles/resourcemanager.organizationViewer condition:
5981
+ # title: expirable access description: Does not grant access after Sep 2020
5982
+ # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag:
5983
+ # BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the
5984
+ # [IAM documentation](https://cloud.google.com/iam/docs/).
4149
5985
  # Corresponds to the JSON property `policy`
4150
5986
  # @return [Google::Apis::SpannerV1::Policy]
4151
5987
  attr_accessor :policy
@@ -4189,6 +6025,29 @@ module Google
4189
6025
  end
4190
6026
  end
4191
6027
 
6028
+ # Message type for a single-region quorum.
6029
+ class SingleRegionQuorum
6030
+ include Google::Apis::Core::Hashable
6031
+
6032
+ # Required. The location of the serving region, e.g. "us-central1". The location
6033
+ # must be one of the regions within the dual-region instance configuration of
6034
+ # your database. The list of valid locations is available using the
6035
+ # GetInstanceConfig API. This should only be used if you plan to change quorum
6036
+ # to the single-region quorum type.
6037
+ # Corresponds to the JSON property `servingLocation`
6038
+ # @return [String]
6039
+ attr_accessor :serving_location
6040
+
6041
+ def initialize(**args)
6042
+ update!(**args)
6043
+ end
6044
+
6045
+ # Update properties of this object
6046
+ def update!(**args)
6047
+ @serving_location = args[:serving_location] if args.key?(:serving_location)
6048
+ end
6049
+ end
6050
+
4192
6051
  # A single DML statement.
4193
6052
  class Statement
4194
6053
  include Google::Apis::Core::Hashable
@@ -4343,6 +6202,14 @@ module Google
4343
6202
  # @return [String]
4344
6203
  attr_accessor :id
4345
6204
 
6205
+ # When a read-write transaction is executed on a multiplexed session, this
6206
+ # precommit token is sent back to the client as a part of the [Transaction]
6207
+ # message in the BeginTransaction response and also as a part of the [ResultSet]
6208
+ # and [PartialResultSet] responses.
6209
+ # Corresponds to the JSON property `precommitToken`
6210
+ # @return [Google::Apis::SpannerV1::MultiplexedSessionPrecommitToken]
6211
+ attr_accessor :precommit_token
6212
+
4346
6213
  # For snapshot read-only transactions, the read timestamp chosen for the
4347
6214
  # transaction. Not returned by default: see TransactionOptions.ReadOnly.
4348
6215
  # return_read_timestamp. A timestamp in RFC3339 UTC \"Zulu\" format, accurate to
@@ -4358,6 +6225,7 @@ module Google
4358
6225
  # Update properties of this object
4359
6226
  def update!(**args)
4360
6227
  @id = args[:id] if args.key?(:id)
6228
+ @precommit_token = args[:precommit_token] if args.key?(:precommit_token)
4361
6229
  @read_timestamp = args[:read_timestamp] if args.key?(:read_timestamp)
4362
6230
  end
4363
6231
  end
@@ -4378,7 +6246,7 @@ module Google
4378
6246
  # such that the read is guaranteed to see the effects of all transactions that
4379
6247
  # have committed before the start of the read). Snapshot read-only transactions
4380
6248
  # do not need to be committed. Queries on change streams must be performed with
4381
- # the snapshot read-only transaction mode, specifying a strong read. Please see
6249
+ # the snapshot read-only transaction mode, specifying a strong read. See
4382
6250
  # TransactionOptions.ReadOnly.strong for more details. 3. Partitioned DML. This
4383
6251
  # type of transaction is used to execute a single Partitioned DML statement.
4384
6252
  # Partitioned DML partitions the key space and runs the DML statement over each
@@ -4414,87 +6282,92 @@ module Google
4414
6282
  # committing the retry, the client should execute the retry in the same session
4415
6283
  # as the original attempt. The original session's lock priority increases with
4416
6284
  # each consecutive abort, meaning that each attempt has a slightly better chance
4417
- # of success than the previous. Under some circumstances (for example, many
4418
- # transactions attempting to modify the same row(s)), a transaction can abort
4419
- # many times in a short period before successfully committing. Thus, it is not a
4420
- # good idea to cap the number of retries a transaction can attempt; instead, it
4421
- # is better to limit the total amount of time spent retrying. Idle transactions:
4422
- # A transaction is considered idle if it has no outstanding reads or SQL queries
4423
- # and has not started a read or SQL query within the last 10 seconds. Idle
4424
- # transactions can be aborted by Cloud Spanner so that they don't hold on to
4425
- # locks indefinitely. If an idle transaction is aborted, the commit will fail
4426
- # with error `ABORTED`. If this behavior is undesirable, periodically executing
4427
- # a simple SQL query in the transaction (for example, `SELECT 1`) prevents the
4428
- # transaction from becoming idle. Snapshot read-only transactions: Snapshot read-
4429
- # only transactions provides a simpler method than locking read-write
4430
- # transactions for doing several consistent reads. However, this type of
4431
- # transaction does not support writes. Snapshot transactions do not take locks.
4432
- # Instead, they work by choosing a Cloud Spanner timestamp, then executing all
4433
- # reads at that timestamp. Since they do not acquire locks, they do not block
4434
- # concurrent read-write transactions. Unlike locking read-write transactions,
4435
- # snapshot read-only transactions never abort. They can fail if the chosen read
4436
- # timestamp is garbage collected; however, the default garbage collection policy
4437
- # is generous enough that most applications do not need to worry about this in
4438
- # practice. Snapshot read-only transactions do not need to call Commit or
4439
- # Rollback (and in fact are not permitted to do so). To execute a snapshot
4440
- # transaction, the client specifies a timestamp bound, which tells Cloud Spanner
4441
- # how to choose a read timestamp. The types of timestamp bound are: - Strong (
4442
- # the default). - Bounded staleness. - Exact staleness. If the Cloud Spanner
4443
- # database to be read is geographically distributed, stale read-only
4444
- # transactions can execute more quickly than strong or read-write transactions,
4445
- # because they are able to execute far from the leader replica. Each type of
4446
- # timestamp bound is discussed in detail below. Strong: Strong reads are
4447
- # guaranteed to see the effects of all transactions that have committed before
4448
- # the start of the read. Furthermore, all rows yielded by a single read are
4449
- # consistent with each other -- if any part of the read observes a transaction,
4450
- # all parts of the read see the transaction. Strong reads are not repeatable:
4451
- # two consecutive strong read-only transactions might return inconsistent
4452
- # results if there are concurrent writes. If consistency across reads is
4453
- # required, the reads should be executed within a transaction or at an exact
4454
- # read timestamp. Queries on change streams (see below for more details) must
4455
- # also specify the strong read timestamp bound. See TransactionOptions.ReadOnly.
4456
- # strong. Exact staleness: These timestamp bounds execute reads at a user-
4457
- # specified timestamp. Reads at a timestamp are guaranteed to see a consistent
4458
- # prefix of the global transaction history: they observe modifications done by
4459
- # all transactions with a commit timestamp less than or equal to the read
4460
- # timestamp, and observe none of the modifications done by transactions with a
4461
- # larger commit timestamp. They will block until all conflicting transactions
4462
- # that may be assigned commit timestamps <= the read timestamp have finished.
4463
- # The timestamp can either be expressed as an absolute Cloud Spanner commit
4464
- # timestamp or a staleness relative to the current time. These modes do not
4465
- # require a "negotiation phase" to pick a timestamp. As a result, they execute
4466
- # slightly faster than the equivalent boundedly stale concurrency modes. On the
4467
- # other hand, boundedly stale reads usually return fresher results. See
4468
- # TransactionOptions.ReadOnly.read_timestamp and TransactionOptions.ReadOnly.
4469
- # exact_staleness. Bounded staleness: Bounded staleness modes allow Cloud
4470
- # Spanner to pick the read timestamp, subject to a user-provided staleness bound.
4471
- # Cloud Spanner chooses the newest timestamp within the staleness bound that
4472
- # allows execution of the reads at the closest available replica without
4473
- # blocking. All rows yielded are consistent with each other -- if any part of
4474
- # the read observes a transaction, all parts of the read see the transaction.
4475
- # Boundedly stale reads are not repeatable: two stale reads, even if they use
4476
- # the same staleness bound, can execute at different timestamps and thus return
4477
- # inconsistent results. Boundedly stale reads execute in two phases: the first
4478
- # phase negotiates a timestamp among all replicas needed to serve the read. In
4479
- # the second phase, reads are executed at the negotiated timestamp. As a result
4480
- # of the two phase execution, bounded staleness reads are usually a little
4481
- # slower than comparable exact staleness reads. However, they are typically able
4482
- # to return fresher results, and are more likely to execute at the closest
4483
- # replica. Because the timestamp negotiation requires up-front knowledge of
4484
- # which rows will be read, it can only be used with single-use read-only
4485
- # transactions. See TransactionOptions.ReadOnly.max_staleness and
4486
- # TransactionOptions.ReadOnly.min_read_timestamp. Old read timestamps and
4487
- # garbage collection: Cloud Spanner continuously garbage collects deleted and
4488
- # overwritten data in the background to reclaim storage space. This process is
4489
- # known as "version GC". By default, version GC reclaims versions after they are
4490
- # one hour old. Because of this, Cloud Spanner cannot perform reads at read
4491
- # timestamps more than one hour in the past. This restriction also applies to in-
4492
- # progress reads and/or SQL queries whose timestamp become too old while
4493
- # executing. Reads and SQL queries with too-old read timestamps fail with the
4494
- # error `FAILED_PRECONDITION`. You can configure and extend the `
4495
- # VERSION_RETENTION_PERIOD` of a database up to a period as long as one week,
4496
- # which allows Cloud Spanner to perform reads up to one week in the past.
4497
- # Querying change Streams: A Change Stream is a schema object that can be
6285
+ # of success than the previous. Note that the lock priority is preserved per
6286
+ # session (not per transaction). Lock priority is set by the first read or write
6287
+ # in the first attempt of a read-write transaction. If the application starts a
6288
+ # new session to retry the whole transaction, the transaction loses its original
6289
+ # lock priority. Moreover, the lock priority is only preserved if the
6290
+ # transaction fails with an `ABORTED` error. Under some circumstances (for
6291
+ # example, many transactions attempting to modify the same row(s)), a
6292
+ # transaction can abort many times in a short period before successfully
6293
+ # committing. Thus, it is not a good idea to cap the number of retries a
6294
+ # transaction can attempt; instead, it is better to limit the total amount of
6295
+ # time spent retrying. Idle transactions: A transaction is considered idle if it
6296
+ # has no outstanding reads or SQL queries and has not started a read or SQL
6297
+ # query within the last 10 seconds. Idle transactions can be aborted by Cloud
6298
+ # Spanner so that they don't hold on to locks indefinitely. If an idle
6299
+ # transaction is aborted, the commit will fail with error `ABORTED`. If this
6300
+ # behavior is undesirable, periodically executing a simple SQL query in the
6301
+ # transaction (for example, `SELECT 1`) prevents the transaction from becoming
6302
+ # idle. Snapshot read-only transactions: Snapshot read-only transactions
6303
+ # provides a simpler method than locking read-write transactions for doing
6304
+ # several consistent reads. However, this type of transaction does not support
6305
+ # writes. Snapshot transactions do not take locks. Instead, they work by
6306
+ # choosing a Cloud Spanner timestamp, then executing all reads at that timestamp.
6307
+ # Since they do not acquire locks, they do not block concurrent read-write
6308
+ # transactions. Unlike locking read-write transactions, snapshot read-only
6309
+ # transactions never abort. They can fail if the chosen read timestamp is
6310
+ # garbage collected; however, the default garbage collection policy is generous
6311
+ # enough that most applications do not need to worry about this in practice.
6312
+ # Snapshot read-only transactions do not need to call Commit or Rollback (and in
6313
+ # fact are not permitted to do so). To execute a snapshot transaction, the
6314
+ # client specifies a timestamp bound, which tells Cloud Spanner how to choose a
6315
+ # read timestamp. The types of timestamp bound are: - Strong (the default). -
6316
+ # Bounded staleness. - Exact staleness. If the Cloud Spanner database to be read
6317
+ # is geographically distributed, stale read-only transactions can execute more
6318
+ # quickly than strong or read-write transactions, because they are able to
6319
+ # execute far from the leader replica. Each type of timestamp bound is discussed
6320
+ # in detail below. Strong: Strong reads are guaranteed to see the effects of all
6321
+ # transactions that have committed before the start of the read. Furthermore,
6322
+ # all rows yielded by a single read are consistent with each other -- if any
6323
+ # part of the read observes a transaction, all parts of the read see the
6324
+ # transaction. Strong reads are not repeatable: two consecutive strong read-only
6325
+ # transactions might return inconsistent results if there are concurrent writes.
6326
+ # If consistency across reads is required, the reads should be executed within a
6327
+ # transaction or at an exact read timestamp. Queries on change streams (see
6328
+ # below for more details) must also specify the strong read timestamp bound. See
6329
+ # TransactionOptions.ReadOnly.strong. Exact staleness: These timestamp bounds
6330
+ # execute reads at a user-specified timestamp. Reads at a timestamp are
6331
+ # guaranteed to see a consistent prefix of the global transaction history: they
6332
+ # observe modifications done by all transactions with a commit timestamp less
6333
+ # than or equal to the read timestamp, and observe none of the modifications
6334
+ # done by transactions with a larger commit timestamp. They will block until all
6335
+ # conflicting transactions that may be assigned commit timestamps <= the read
6336
+ # timestamp have finished. The timestamp can either be expressed as an absolute
6337
+ # Cloud Spanner commit timestamp or a staleness relative to the current time.
6338
+ # These modes do not require a "negotiation phase" to pick a timestamp. As a
6339
+ # result, they execute slightly faster than the equivalent boundedly stale
6340
+ # concurrency modes. On the other hand, boundedly stale reads usually return
6341
+ # fresher results. See TransactionOptions.ReadOnly.read_timestamp and
6342
+ # TransactionOptions.ReadOnly.exact_staleness. Bounded staleness: Bounded
6343
+ # staleness modes allow Cloud Spanner to pick the read timestamp, subject to a
6344
+ # user-provided staleness bound. Cloud Spanner chooses the newest timestamp
6345
+ # within the staleness bound that allows execution of the reads at the closest
6346
+ # available replica without blocking. All rows yielded are consistent with each
6347
+ # other -- if any part of the read observes a transaction, all parts of the read
6348
+ # see the transaction. Boundedly stale reads are not repeatable: two stale reads,
6349
+ # even if they use the same staleness bound, can execute at different
6350
+ # timestamps and thus return inconsistent results. Boundedly stale reads execute
6351
+ # in two phases: the first phase negotiates a timestamp among all replicas
6352
+ # needed to serve the read. In the second phase, reads are executed at the
6353
+ # negotiated timestamp. As a result of the two phase execution, bounded
6354
+ # staleness reads are usually a little slower than comparable exact staleness
6355
+ # reads. However, they are typically able to return fresher results, and are
6356
+ # more likely to execute at the closest replica. Because the timestamp
6357
+ # negotiation requires up-front knowledge of which rows will be read, it can
6358
+ # only be used with single-use read-only transactions. See TransactionOptions.
6359
+ # ReadOnly.max_staleness and TransactionOptions.ReadOnly.min_read_timestamp. Old
6360
+ # read timestamps and garbage collection: Cloud Spanner continuously garbage
6361
+ # collects deleted and overwritten data in the background to reclaim storage
6362
+ # space. This process is known as "version GC". By default, version GC reclaims
6363
+ # versions after they are one hour old. Because of this, Cloud Spanner cannot
6364
+ # perform reads at read timestamps more than one hour in the past. This
6365
+ # restriction also applies to in-progress reads and/or SQL queries whose
6366
+ # timestamp become too old while executing. Reads and SQL queries with too-old
6367
+ # read timestamps fail with the error `FAILED_PRECONDITION`. You can configure
6368
+ # and extend the `VERSION_RETENTION_PERIOD` of a database up to a period as long
6369
+ # as one week, which allows Cloud Spanner to perform reads up to one week in the
6370
+ # past. Querying change Streams: A Change Stream is a schema object that can be
4498
6371
  # configured to watch data changes on the entire database, a set of tables, or a
4499
6372
  # set of columns in a database. When a change stream is created, Spanner
4500
6373
  # automatically defines a corresponding SQL Table-Valued Function (TVF) that can
@@ -4530,12 +6403,12 @@ module Google
4530
6403
  # of the table. Rather, the statement is applied atomically to partitions of the
4531
6404
  # table, in independent transactions. Secondary index rows are updated
4532
6405
  # atomically with the base table rows. - Partitioned DML does not guarantee
4533
- # exactly-once execution semantics against a partition. The statement will be
4534
- # applied at least once to each partition. It is strongly recommended that the
4535
- # DML statement should be idempotent to avoid unexpected results. For instance,
4536
- # it is potentially dangerous to run a statement such as `UPDATE table SET
4537
- # column = column + 1` as it could be run multiple times against some rows. -
4538
- # The partitions are committed automatically - there is no support for Commit or
6406
+ # exactly-once execution semantics against a partition. The statement is applied
6407
+ # at least once to each partition. It is strongly recommended that the DML
6408
+ # statement should be idempotent to avoid unexpected results. For instance, it
6409
+ # is potentially dangerous to run a statement such as `UPDATE table SET column =
6410
+ # column + 1` as it could be run multiple times against some rows. - The
6411
+ # partitions are committed automatically - there is no support for Commit or
4539
6412
  # Rollback. If the call returns an error, or if the client issuing the
4540
6413
  # ExecuteSql call dies, it is possible that some rows had the statement executed
4541
6414
  # on them successfully. It is also possible that statement was never executed
@@ -4552,6 +6425,22 @@ module Google
4552
6425
  class TransactionOptions
4553
6426
  include Google::Apis::Core::Hashable
4554
6427
 
6428
+ # When `exclude_txn_from_change_streams` is set to `true`: * Modifications from
6429
+ # this transaction will not be recorded in change streams with DDL option `
6430
+ # allow_txn_exclusion=true` that are tracking columns modified by these
6431
+ # transactions. * Modifications from this transaction will be recorded in change
6432
+ # streams with DDL option `allow_txn_exclusion=false or not set` that are
6433
+ # tracking columns modified by these transactions. When `
6434
+ # exclude_txn_from_change_streams` is set to `false` or not set, Modifications
6435
+ # from this transaction will be recorded in all change streams that are tracking
6436
+ # columns modified by these transactions. `exclude_txn_from_change_streams` may
6437
+ # only be specified for read-write or partitioned-dml transactions, otherwise
6438
+ # the API will return an `INVALID_ARGUMENT` error.
6439
+ # Corresponds to the JSON property `excludeTxnFromChangeStreams`
6440
+ # @return [Boolean]
6441
+ attr_accessor :exclude_txn_from_change_streams
6442
+ alias_method :exclude_txn_from_change_streams?, :exclude_txn_from_change_streams
6443
+
4555
6444
  # Message type to initiate a Partitioned DML transaction.
4556
6445
  # Corresponds to the JSON property `partitionedDml`
4557
6446
  # @return [Google::Apis::SpannerV1::PartitionedDml]
@@ -4574,6 +6463,7 @@ module Google
4574
6463
 
4575
6464
  # Update properties of this object
4576
6465
  def update!(**args)
6466
+ @exclude_txn_from_change_streams = args[:exclude_txn_from_change_streams] if args.key?(:exclude_txn_from_change_streams)
4577
6467
  @partitioned_dml = args[:partitioned_dml] if args.key?(:partitioned_dml)
4578
6468
  @read_only = args[:read_only] if args.key?(:read_only)
4579
6469
  @read_write = args[:read_write] if args.key?(:read_write)
@@ -4601,7 +6491,7 @@ module Google
4601
6491
  # such that the read is guaranteed to see the effects of all transactions that
4602
6492
  # have committed before the start of the read). Snapshot read-only transactions
4603
6493
  # do not need to be committed. Queries on change streams must be performed with
4604
- # the snapshot read-only transaction mode, specifying a strong read. Please see
6494
+ # the snapshot read-only transaction mode, specifying a strong read. See
4605
6495
  # TransactionOptions.ReadOnly.strong for more details. 3. Partitioned DML. This
4606
6496
  # type of transaction is used to execute a single Partitioned DML statement.
4607
6497
  # Partitioned DML partitions the key space and runs the DML statement over each
@@ -4637,87 +6527,92 @@ module Google
4637
6527
  # committing the retry, the client should execute the retry in the same session
4638
6528
  # as the original attempt. The original session's lock priority increases with
4639
6529
  # each consecutive abort, meaning that each attempt has a slightly better chance
4640
- # of success than the previous. Under some circumstances (for example, many
4641
- # transactions attempting to modify the same row(s)), a transaction can abort
4642
- # many times in a short period before successfully committing. Thus, it is not a
4643
- # good idea to cap the number of retries a transaction can attempt; instead, it
4644
- # is better to limit the total amount of time spent retrying. Idle transactions:
4645
- # A transaction is considered idle if it has no outstanding reads or SQL queries
4646
- # and has not started a read or SQL query within the last 10 seconds. Idle
4647
- # transactions can be aborted by Cloud Spanner so that they don't hold on to
4648
- # locks indefinitely. If an idle transaction is aborted, the commit will fail
4649
- # with error `ABORTED`. If this behavior is undesirable, periodically executing
4650
- # a simple SQL query in the transaction (for example, `SELECT 1`) prevents the
4651
- # transaction from becoming idle. Snapshot read-only transactions: Snapshot read-
4652
- # only transactions provides a simpler method than locking read-write
4653
- # transactions for doing several consistent reads. However, this type of
4654
- # transaction does not support writes. Snapshot transactions do not take locks.
4655
- # Instead, they work by choosing a Cloud Spanner timestamp, then executing all
4656
- # reads at that timestamp. Since they do not acquire locks, they do not block
4657
- # concurrent read-write transactions. Unlike locking read-write transactions,
4658
- # snapshot read-only transactions never abort. They can fail if the chosen read
4659
- # timestamp is garbage collected; however, the default garbage collection policy
4660
- # is generous enough that most applications do not need to worry about this in
4661
- # practice. Snapshot read-only transactions do not need to call Commit or
4662
- # Rollback (and in fact are not permitted to do so). To execute a snapshot
4663
- # transaction, the client specifies a timestamp bound, which tells Cloud Spanner
4664
- # how to choose a read timestamp. The types of timestamp bound are: - Strong (
4665
- # the default). - Bounded staleness. - Exact staleness. If the Cloud Spanner
4666
- # database to be read is geographically distributed, stale read-only
4667
- # transactions can execute more quickly than strong or read-write transactions,
4668
- # because they are able to execute far from the leader replica. Each type of
4669
- # timestamp bound is discussed in detail below. Strong: Strong reads are
4670
- # guaranteed to see the effects of all transactions that have committed before
4671
- # the start of the read. Furthermore, all rows yielded by a single read are
4672
- # consistent with each other -- if any part of the read observes a transaction,
4673
- # all parts of the read see the transaction. Strong reads are not repeatable:
4674
- # two consecutive strong read-only transactions might return inconsistent
4675
- # results if there are concurrent writes. If consistency across reads is
4676
- # required, the reads should be executed within a transaction or at an exact
4677
- # read timestamp. Queries on change streams (see below for more details) must
4678
- # also specify the strong read timestamp bound. See TransactionOptions.ReadOnly.
4679
- # strong. Exact staleness: These timestamp bounds execute reads at a user-
4680
- # specified timestamp. Reads at a timestamp are guaranteed to see a consistent
4681
- # prefix of the global transaction history: they observe modifications done by
4682
- # all transactions with a commit timestamp less than or equal to the read
4683
- # timestamp, and observe none of the modifications done by transactions with a
4684
- # larger commit timestamp. They will block until all conflicting transactions
4685
- # that may be assigned commit timestamps <= the read timestamp have finished.
4686
- # The timestamp can either be expressed as an absolute Cloud Spanner commit
4687
- # timestamp or a staleness relative to the current time. These modes do not
4688
- # require a "negotiation phase" to pick a timestamp. As a result, they execute
4689
- # slightly faster than the equivalent boundedly stale concurrency modes. On the
4690
- # other hand, boundedly stale reads usually return fresher results. See
4691
- # TransactionOptions.ReadOnly.read_timestamp and TransactionOptions.ReadOnly.
4692
- # exact_staleness. Bounded staleness: Bounded staleness modes allow Cloud
4693
- # Spanner to pick the read timestamp, subject to a user-provided staleness bound.
4694
- # Cloud Spanner chooses the newest timestamp within the staleness bound that
4695
- # allows execution of the reads at the closest available replica without
4696
- # blocking. All rows yielded are consistent with each other -- if any part of
4697
- # the read observes a transaction, all parts of the read see the transaction.
4698
- # Boundedly stale reads are not repeatable: two stale reads, even if they use
4699
- # the same staleness bound, can execute at different timestamps and thus return
4700
- # inconsistent results. Boundedly stale reads execute in two phases: the first
4701
- # phase negotiates a timestamp among all replicas needed to serve the read. In
4702
- # the second phase, reads are executed at the negotiated timestamp. As a result
4703
- # of the two phase execution, bounded staleness reads are usually a little
4704
- # slower than comparable exact staleness reads. However, they are typically able
4705
- # to return fresher results, and are more likely to execute at the closest
4706
- # replica. Because the timestamp negotiation requires up-front knowledge of
4707
- # which rows will be read, it can only be used with single-use read-only
4708
- # transactions. See TransactionOptions.ReadOnly.max_staleness and
4709
- # TransactionOptions.ReadOnly.min_read_timestamp. Old read timestamps and
4710
- # garbage collection: Cloud Spanner continuously garbage collects deleted and
4711
- # overwritten data in the background to reclaim storage space. This process is
4712
- # known as "version GC". By default, version GC reclaims versions after they are
4713
- # one hour old. Because of this, Cloud Spanner cannot perform reads at read
4714
- # timestamps more than one hour in the past. This restriction also applies to in-
4715
- # progress reads and/or SQL queries whose timestamp become too old while
4716
- # executing. Reads and SQL queries with too-old read timestamps fail with the
4717
- # error `FAILED_PRECONDITION`. You can configure and extend the `
4718
- # VERSION_RETENTION_PERIOD` of a database up to a period as long as one week,
4719
- # which allows Cloud Spanner to perform reads up to one week in the past.
4720
- # Querying change Streams: A Change Stream is a schema object that can be
6530
+ # of success than the previous. Note that the lock priority is preserved per
6531
+ # session (not per transaction). Lock priority is set by the first read or write
6532
+ # in the first attempt of a read-write transaction. If the application starts a
6533
+ # new session to retry the whole transaction, the transaction loses its original
6534
+ # lock priority. Moreover, the lock priority is only preserved if the
6535
+ # transaction fails with an `ABORTED` error. Under some circumstances (for
6536
+ # example, many transactions attempting to modify the same row(s)), a
6537
+ # transaction can abort many times in a short period before successfully
6538
+ # committing. Thus, it is not a good idea to cap the number of retries a
6539
+ # transaction can attempt; instead, it is better to limit the total amount of
6540
+ # time spent retrying. Idle transactions: A transaction is considered idle if it
6541
+ # has no outstanding reads or SQL queries and has not started a read or SQL
6542
+ # query within the last 10 seconds. Idle transactions can be aborted by Cloud
6543
+ # Spanner so that they don't hold on to locks indefinitely. If an idle
6544
+ # transaction is aborted, the commit will fail with error `ABORTED`. If this
6545
+ # behavior is undesirable, periodically executing a simple SQL query in the
6546
+ # transaction (for example, `SELECT 1`) prevents the transaction from becoming
6547
+ # idle. Snapshot read-only transactions: Snapshot read-only transactions
6548
+ # provides a simpler method than locking read-write transactions for doing
6549
+ # several consistent reads. However, this type of transaction does not support
6550
+ # writes. Snapshot transactions do not take locks. Instead, they work by
6551
+ # choosing a Cloud Spanner timestamp, then executing all reads at that timestamp.
6552
+ # Since they do not acquire locks, they do not block concurrent read-write
6553
+ # transactions. Unlike locking read-write transactions, snapshot read-only
6554
+ # transactions never abort. They can fail if the chosen read timestamp is
6555
+ # garbage collected; however, the default garbage collection policy is generous
6556
+ # enough that most applications do not need to worry about this in practice.
6557
+ # Snapshot read-only transactions do not need to call Commit or Rollback (and in
6558
+ # fact are not permitted to do so). To execute a snapshot transaction, the
6559
+ # client specifies a timestamp bound, which tells Cloud Spanner how to choose a
6560
+ # read timestamp. The types of timestamp bound are: - Strong (the default). -
6561
+ # Bounded staleness. - Exact staleness. If the Cloud Spanner database to be read
6562
+ # is geographically distributed, stale read-only transactions can execute more
6563
+ # quickly than strong or read-write transactions, because they are able to
6564
+ # execute far from the leader replica. Each type of timestamp bound is discussed
6565
+ # in detail below. Strong: Strong reads are guaranteed to see the effects of all
6566
+ # transactions that have committed before the start of the read. Furthermore,
6567
+ # all rows yielded by a single read are consistent with each other -- if any
6568
+ # part of the read observes a transaction, all parts of the read see the
6569
+ # transaction. Strong reads are not repeatable: two consecutive strong read-only
6570
+ # transactions might return inconsistent results if there are concurrent writes.
6571
+ # If consistency across reads is required, the reads should be executed within a
6572
+ # transaction or at an exact read timestamp. Queries on change streams (see
6573
+ # below for more details) must also specify the strong read timestamp bound. See
6574
+ # TransactionOptions.ReadOnly.strong. Exact staleness: These timestamp bounds
6575
+ # execute reads at a user-specified timestamp. Reads at a timestamp are
6576
+ # guaranteed to see a consistent prefix of the global transaction history: they
6577
+ # observe modifications done by all transactions with a commit timestamp less
6578
+ # than or equal to the read timestamp, and observe none of the modifications
6579
+ # done by transactions with a larger commit timestamp. They will block until all
6580
+ # conflicting transactions that may be assigned commit timestamps <= the read
6581
+ # timestamp have finished. The timestamp can either be expressed as an absolute
6582
+ # Cloud Spanner commit timestamp or a staleness relative to the current time.
6583
+ # These modes do not require a "negotiation phase" to pick a timestamp. As a
6584
+ # result, they execute slightly faster than the equivalent boundedly stale
6585
+ # concurrency modes. On the other hand, boundedly stale reads usually return
6586
+ # fresher results. See TransactionOptions.ReadOnly.read_timestamp and
6587
+ # TransactionOptions.ReadOnly.exact_staleness. Bounded staleness: Bounded
6588
+ # staleness modes allow Cloud Spanner to pick the read timestamp, subject to a
6589
+ # user-provided staleness bound. Cloud Spanner chooses the newest timestamp
6590
+ # within the staleness bound that allows execution of the reads at the closest
6591
+ # available replica without blocking. All rows yielded are consistent with each
6592
+ # other -- if any part of the read observes a transaction, all parts of the read
6593
+ # see the transaction. Boundedly stale reads are not repeatable: two stale reads,
6594
+ # even if they use the same staleness bound, can execute at different
6595
+ # timestamps and thus return inconsistent results. Boundedly stale reads execute
6596
+ # in two phases: the first phase negotiates a timestamp among all replicas
6597
+ # needed to serve the read. In the second phase, reads are executed at the
6598
+ # negotiated timestamp. As a result of the two phase execution, bounded
6599
+ # staleness reads are usually a little slower than comparable exact staleness
6600
+ # reads. However, they are typically able to return fresher results, and are
6601
+ # more likely to execute at the closest replica. Because the timestamp
6602
+ # negotiation requires up-front knowledge of which rows will be read, it can
6603
+ # only be used with single-use read-only transactions. See TransactionOptions.
6604
+ # ReadOnly.max_staleness and TransactionOptions.ReadOnly.min_read_timestamp. Old
6605
+ # read timestamps and garbage collection: Cloud Spanner continuously garbage
6606
+ # collects deleted and overwritten data in the background to reclaim storage
6607
+ # space. This process is known as "version GC". By default, version GC reclaims
6608
+ # versions after they are one hour old. Because of this, Cloud Spanner cannot
6609
+ # perform reads at read timestamps more than one hour in the past. This
6610
+ # restriction also applies to in-progress reads and/or SQL queries whose
6611
+ # timestamp become too old while executing. Reads and SQL queries with too-old
6612
+ # read timestamps fail with the error `FAILED_PRECONDITION`. You can configure
6613
+ # and extend the `VERSION_RETENTION_PERIOD` of a database up to a period as long
6614
+ # as one week, which allows Cloud Spanner to perform reads up to one week in the
6615
+ # past. Querying change Streams: A Change Stream is a schema object that can be
4721
6616
  # configured to watch data changes on the entire database, a set of tables, or a
4722
6617
  # set of columns in a database. When a change stream is created, Spanner
4723
6618
  # automatically defines a corresponding SQL Table-Valued Function (TVF) that can
@@ -4753,12 +6648,12 @@ module Google
4753
6648
  # of the table. Rather, the statement is applied atomically to partitions of the
4754
6649
  # table, in independent transactions. Secondary index rows are updated
4755
6650
  # atomically with the base table rows. - Partitioned DML does not guarantee
4756
- # exactly-once execution semantics against a partition. The statement will be
4757
- # applied at least once to each partition. It is strongly recommended that the
4758
- # DML statement should be idempotent to avoid unexpected results. For instance,
4759
- # it is potentially dangerous to run a statement such as `UPDATE table SET
4760
- # column = column + 1` as it could be run multiple times against some rows. -
4761
- # The partitions are committed automatically - there is no support for Commit or
6651
+ # exactly-once execution semantics against a partition. The statement is applied
6652
+ # at least once to each partition. It is strongly recommended that the DML
6653
+ # statement should be idempotent to avoid unexpected results. For instance, it
6654
+ # is potentially dangerous to run a statement such as `UPDATE table SET column =
6655
+ # column + 1` as it could be run multiple times against some rows. - The
6656
+ # partitions are committed automatically - there is no support for Commit or
4762
6657
  # Rollback. If the call returns an error, or if the client issuing the
4763
6658
  # ExecuteSql call dies, it is possible that some rows had the statement executed
4764
6659
  # on them successfully. It is also possible that statement was never executed
@@ -4798,7 +6693,7 @@ module Google
4798
6693
  # such that the read is guaranteed to see the effects of all transactions that
4799
6694
  # have committed before the start of the read). Snapshot read-only transactions
4800
6695
  # do not need to be committed. Queries on change streams must be performed with
4801
- # the snapshot read-only transaction mode, specifying a strong read. Please see
6696
+ # the snapshot read-only transaction mode, specifying a strong read. See
4802
6697
  # TransactionOptions.ReadOnly.strong for more details. 3. Partitioned DML. This
4803
6698
  # type of transaction is used to execute a single Partitioned DML statement.
4804
6699
  # Partitioned DML partitions the key space and runs the DML statement over each
@@ -4834,87 +6729,92 @@ module Google
4834
6729
  # committing the retry, the client should execute the retry in the same session
4835
6730
  # as the original attempt. The original session's lock priority increases with
4836
6731
  # each consecutive abort, meaning that each attempt has a slightly better chance
4837
- # of success than the previous. Under some circumstances (for example, many
4838
- # transactions attempting to modify the same row(s)), a transaction can abort
4839
- # many times in a short period before successfully committing. Thus, it is not a
4840
- # good idea to cap the number of retries a transaction can attempt; instead, it
4841
- # is better to limit the total amount of time spent retrying. Idle transactions:
4842
- # A transaction is considered idle if it has no outstanding reads or SQL queries
4843
- # and has not started a read or SQL query within the last 10 seconds. Idle
4844
- # transactions can be aborted by Cloud Spanner so that they don't hold on to
4845
- # locks indefinitely. If an idle transaction is aborted, the commit will fail
4846
- # with error `ABORTED`. If this behavior is undesirable, periodically executing
4847
- # a simple SQL query in the transaction (for example, `SELECT 1`) prevents the
4848
- # transaction from becoming idle. Snapshot read-only transactions: Snapshot read-
4849
- # only transactions provides a simpler method than locking read-write
4850
- # transactions for doing several consistent reads. However, this type of
4851
- # transaction does not support writes. Snapshot transactions do not take locks.
4852
- # Instead, they work by choosing a Cloud Spanner timestamp, then executing all
4853
- # reads at that timestamp. Since they do not acquire locks, they do not block
4854
- # concurrent read-write transactions. Unlike locking read-write transactions,
4855
- # snapshot read-only transactions never abort. They can fail if the chosen read
4856
- # timestamp is garbage collected; however, the default garbage collection policy
4857
- # is generous enough that most applications do not need to worry about this in
4858
- # practice. Snapshot read-only transactions do not need to call Commit or
4859
- # Rollback (and in fact are not permitted to do so). To execute a snapshot
4860
- # transaction, the client specifies a timestamp bound, which tells Cloud Spanner
4861
- # how to choose a read timestamp. The types of timestamp bound are: - Strong (
4862
- # the default). - Bounded staleness. - Exact staleness. If the Cloud Spanner
4863
- # database to be read is geographically distributed, stale read-only
4864
- # transactions can execute more quickly than strong or read-write transactions,
4865
- # because they are able to execute far from the leader replica. Each type of
4866
- # timestamp bound is discussed in detail below. Strong: Strong reads are
4867
- # guaranteed to see the effects of all transactions that have committed before
4868
- # the start of the read. Furthermore, all rows yielded by a single read are
4869
- # consistent with each other -- if any part of the read observes a transaction,
4870
- # all parts of the read see the transaction. Strong reads are not repeatable:
4871
- # two consecutive strong read-only transactions might return inconsistent
4872
- # results if there are concurrent writes. If consistency across reads is
4873
- # required, the reads should be executed within a transaction or at an exact
4874
- # read timestamp. Queries on change streams (see below for more details) must
4875
- # also specify the strong read timestamp bound. See TransactionOptions.ReadOnly.
4876
- # strong. Exact staleness: These timestamp bounds execute reads at a user-
4877
- # specified timestamp. Reads at a timestamp are guaranteed to see a consistent
4878
- # prefix of the global transaction history: they observe modifications done by
4879
- # all transactions with a commit timestamp less than or equal to the read
4880
- # timestamp, and observe none of the modifications done by transactions with a
4881
- # larger commit timestamp. They will block until all conflicting transactions
4882
- # that may be assigned commit timestamps <= the read timestamp have finished.
4883
- # The timestamp can either be expressed as an absolute Cloud Spanner commit
4884
- # timestamp or a staleness relative to the current time. These modes do not
4885
- # require a "negotiation phase" to pick a timestamp. As a result, they execute
4886
- # slightly faster than the equivalent boundedly stale concurrency modes. On the
4887
- # other hand, boundedly stale reads usually return fresher results. See
4888
- # TransactionOptions.ReadOnly.read_timestamp and TransactionOptions.ReadOnly.
4889
- # exact_staleness. Bounded staleness: Bounded staleness modes allow Cloud
4890
- # Spanner to pick the read timestamp, subject to a user-provided staleness bound.
4891
- # Cloud Spanner chooses the newest timestamp within the staleness bound that
4892
- # allows execution of the reads at the closest available replica without
4893
- # blocking. All rows yielded are consistent with each other -- if any part of
4894
- # the read observes a transaction, all parts of the read see the transaction.
4895
- # Boundedly stale reads are not repeatable: two stale reads, even if they use
4896
- # the same staleness bound, can execute at different timestamps and thus return
4897
- # inconsistent results. Boundedly stale reads execute in two phases: the first
4898
- # phase negotiates a timestamp among all replicas needed to serve the read. In
4899
- # the second phase, reads are executed at the negotiated timestamp. As a result
4900
- # of the two phase execution, bounded staleness reads are usually a little
4901
- # slower than comparable exact staleness reads. However, they are typically able
4902
- # to return fresher results, and are more likely to execute at the closest
4903
- # replica. Because the timestamp negotiation requires up-front knowledge of
4904
- # which rows will be read, it can only be used with single-use read-only
4905
- # transactions. See TransactionOptions.ReadOnly.max_staleness and
4906
- # TransactionOptions.ReadOnly.min_read_timestamp. Old read timestamps and
4907
- # garbage collection: Cloud Spanner continuously garbage collects deleted and
4908
- # overwritten data in the background to reclaim storage space. This process is
4909
- # known as "version GC". By default, version GC reclaims versions after they are
4910
- # one hour old. Because of this, Cloud Spanner cannot perform reads at read
4911
- # timestamps more than one hour in the past. This restriction also applies to in-
4912
- # progress reads and/or SQL queries whose timestamp become too old while
4913
- # executing. Reads and SQL queries with too-old read timestamps fail with the
4914
- # error `FAILED_PRECONDITION`. You can configure and extend the `
4915
- # VERSION_RETENTION_PERIOD` of a database up to a period as long as one week,
4916
- # which allows Cloud Spanner to perform reads up to one week in the past.
4917
- # Querying change Streams: A Change Stream is a schema object that can be
6732
+ # of success than the previous. Note that the lock priority is preserved per
6733
+ # session (not per transaction). Lock priority is set by the first read or write
6734
+ # in the first attempt of a read-write transaction. If the application starts a
6735
+ # new session to retry the whole transaction, the transaction loses its original
6736
+ # lock priority. Moreover, the lock priority is only preserved if the
6737
+ # transaction fails with an `ABORTED` error. Under some circumstances (for
6738
+ # example, many transactions attempting to modify the same row(s)), a
6739
+ # transaction can abort many times in a short period before successfully
6740
+ # committing. Thus, it is not a good idea to cap the number of retries a
6741
+ # transaction can attempt; instead, it is better to limit the total amount of
6742
+ # time spent retrying. Idle transactions: A transaction is considered idle if it
6743
+ # has no outstanding reads or SQL queries and has not started a read or SQL
6744
+ # query within the last 10 seconds. Idle transactions can be aborted by Cloud
6745
+ # Spanner so that they don't hold on to locks indefinitely. If an idle
6746
+ # transaction is aborted, the commit will fail with error `ABORTED`. If this
6747
+ # behavior is undesirable, periodically executing a simple SQL query in the
6748
+ # transaction (for example, `SELECT 1`) prevents the transaction from becoming
6749
+ # idle. Snapshot read-only transactions: Snapshot read-only transactions
6750
+ # provides a simpler method than locking read-write transactions for doing
6751
+ # several consistent reads. However, this type of transaction does not support
6752
+ # writes. Snapshot transactions do not take locks. Instead, they work by
6753
+ # choosing a Cloud Spanner timestamp, then executing all reads at that timestamp.
6754
+ # Since they do not acquire locks, they do not block concurrent read-write
6755
+ # transactions. Unlike locking read-write transactions, snapshot read-only
6756
+ # transactions never abort. They can fail if the chosen read timestamp is
6757
+ # garbage collected; however, the default garbage collection policy is generous
6758
+ # enough that most applications do not need to worry about this in practice.
6759
+ # Snapshot read-only transactions do not need to call Commit or Rollback (and in
6760
+ # fact are not permitted to do so). To execute a snapshot transaction, the
6761
+ # client specifies a timestamp bound, which tells Cloud Spanner how to choose a
6762
+ # read timestamp. The types of timestamp bound are: - Strong (the default). -
6763
+ # Bounded staleness. - Exact staleness. If the Cloud Spanner database to be read
6764
+ # is geographically distributed, stale read-only transactions can execute more
6765
+ # quickly than strong or read-write transactions, because they are able to
6766
+ # execute far from the leader replica. Each type of timestamp bound is discussed
6767
+ # in detail below. Strong: Strong reads are guaranteed to see the effects of all
6768
+ # transactions that have committed before the start of the read. Furthermore,
6769
+ # all rows yielded by a single read are consistent with each other -- if any
6770
+ # part of the read observes a transaction, all parts of the read see the
6771
+ # transaction. Strong reads are not repeatable: two consecutive strong read-only
6772
+ # transactions might return inconsistent results if there are concurrent writes.
6773
+ # If consistency across reads is required, the reads should be executed within a
6774
+ # transaction or at an exact read timestamp. Queries on change streams (see
6775
+ # below for more details) must also specify the strong read timestamp bound. See
6776
+ # TransactionOptions.ReadOnly.strong. Exact staleness: These timestamp bounds
6777
+ # execute reads at a user-specified timestamp. Reads at a timestamp are
6778
+ # guaranteed to see a consistent prefix of the global transaction history: they
6779
+ # observe modifications done by all transactions with a commit timestamp less
6780
+ # than or equal to the read timestamp, and observe none of the modifications
6781
+ # done by transactions with a larger commit timestamp. They will block until all
6782
+ # conflicting transactions that may be assigned commit timestamps <= the read
6783
+ # timestamp have finished. The timestamp can either be expressed as an absolute
6784
+ # Cloud Spanner commit timestamp or a staleness relative to the current time.
6785
+ # These modes do not require a "negotiation phase" to pick a timestamp. As a
6786
+ # result, they execute slightly faster than the equivalent boundedly stale
6787
+ # concurrency modes. On the other hand, boundedly stale reads usually return
6788
+ # fresher results. See TransactionOptions.ReadOnly.read_timestamp and
6789
+ # TransactionOptions.ReadOnly.exact_staleness. Bounded staleness: Bounded
6790
+ # staleness modes allow Cloud Spanner to pick the read timestamp, subject to a
6791
+ # user-provided staleness bound. Cloud Spanner chooses the newest timestamp
6792
+ # within the staleness bound that allows execution of the reads at the closest
6793
+ # available replica without blocking. All rows yielded are consistent with each
6794
+ # other -- if any part of the read observes a transaction, all parts of the read
6795
+ # see the transaction. Boundedly stale reads are not repeatable: two stale reads,
6796
+ # even if they use the same staleness bound, can execute at different
6797
+ # timestamps and thus return inconsistent results. Boundedly stale reads execute
6798
+ # in two phases: the first phase negotiates a timestamp among all replicas
6799
+ # needed to serve the read. In the second phase, reads are executed at the
6800
+ # negotiated timestamp. As a result of the two phase execution, bounded
6801
+ # staleness reads are usually a little slower than comparable exact staleness
6802
+ # reads. However, they are typically able to return fresher results, and are
6803
+ # more likely to execute at the closest replica. Because the timestamp
6804
+ # negotiation requires up-front knowledge of which rows will be read, it can
6805
+ # only be used with single-use read-only transactions. See TransactionOptions.
6806
+ # ReadOnly.max_staleness and TransactionOptions.ReadOnly.min_read_timestamp. Old
6807
+ # read timestamps and garbage collection: Cloud Spanner continuously garbage
6808
+ # collects deleted and overwritten data in the background to reclaim storage
6809
+ # space. This process is known as "version GC". By default, version GC reclaims
6810
+ # versions after they are one hour old. Because of this, Cloud Spanner cannot
6811
+ # perform reads at read timestamps more than one hour in the past. This
6812
+ # restriction also applies to in-progress reads and/or SQL queries whose
6813
+ # timestamp become too old while executing. Reads and SQL queries with too-old
6814
+ # read timestamps fail with the error `FAILED_PRECONDITION`. You can configure
6815
+ # and extend the `VERSION_RETENTION_PERIOD` of a database up to a period as long
6816
+ # as one week, which allows Cloud Spanner to perform reads up to one week in the
6817
+ # past. Querying change Streams: A Change Stream is a schema object that can be
4918
6818
  # configured to watch data changes on the entire database, a set of tables, or a
4919
6819
  # set of columns in a database. When a change stream is created, Spanner
4920
6820
  # automatically defines a corresponding SQL Table-Valued Function (TVF) that can
@@ -4950,12 +6850,12 @@ module Google
4950
6850
  # of the table. Rather, the statement is applied atomically to partitions of the
4951
6851
  # table, in independent transactions. Secondary index rows are updated
4952
6852
  # atomically with the base table rows. - Partitioned DML does not guarantee
4953
- # exactly-once execution semantics against a partition. The statement will be
4954
- # applied at least once to each partition. It is strongly recommended that the
4955
- # DML statement should be idempotent to avoid unexpected results. For instance,
4956
- # it is potentially dangerous to run a statement such as `UPDATE table SET
4957
- # column = column + 1` as it could be run multiple times against some rows. -
4958
- # The partitions are committed automatically - there is no support for Commit or
6853
+ # exactly-once execution semantics against a partition. The statement is applied
6854
+ # at least once to each partition. It is strongly recommended that the DML
6855
+ # statement should be idempotent to avoid unexpected results. For instance, it
6856
+ # is potentially dangerous to run a statement such as `UPDATE table SET column =
6857
+ # column + 1` as it could be run multiple times against some rows. - The
6858
+ # partitions are committed automatically - there is no support for Commit or
4959
6859
  # Rollback. If the call returns an error, or if the client issuing the
4960
6860
  # ExecuteSql call dies, it is possible that some rows had the statement executed
4961
6861
  # on them successfully. It is also possible that statement was never executed
@@ -5001,6 +6901,12 @@ module Google
5001
6901
  # @return [String]
5002
6902
  attr_accessor :code
5003
6903
 
6904
+ # If code == PROTO or code == ENUM, then `proto_type_fqn` is the fully qualified
6905
+ # name of the proto type representing the proto/enum definition.
6906
+ # Corresponds to the JSON property `protoTypeFqn`
6907
+ # @return [String]
6908
+ attr_accessor :proto_type_fqn
6909
+
5004
6910
  # `StructType` defines the fields of a STRUCT type.
5005
6911
  # Corresponds to the JSON property `structType`
5006
6912
  # @return [Google::Apis::SpannerV1::StructType]
@@ -5024,6 +6930,7 @@ module Google
5024
6930
  def update!(**args)
5025
6931
  @array_element_type = args[:array_element_type] if args.key?(:array_element_type)
5026
6932
  @code = args[:code] if args.key?(:code)
6933
+ @proto_type_fqn = args[:proto_type_fqn] if args.key?(:proto_type_fqn)
5027
6934
  @struct_type = args[:struct_type] if args.key?(:struct_type)
5028
6935
  @type_annotation = args[:type_annotation] if args.key?(:type_annotation)
5029
6936
  end
@@ -5033,6 +6940,12 @@ module Google
5033
6940
  class UpdateDatabaseDdlMetadata
5034
6941
  include Google::Apis::Core::Hashable
5035
6942
 
6943
+ # The brief action info for the DDL statements. `actions[i]` is the brief info
6944
+ # for `statements[i]`.
6945
+ # Corresponds to the JSON property `actions`
6946
+ # @return [Array<Google::Apis::SpannerV1::DdlStatementActionInfo>]
6947
+ attr_accessor :actions
6948
+
5036
6949
  # Reports the commit timestamps of all statements that have succeeded so far,
5037
6950
  # where `commit_timestamps[i]` is the commit timestamp for the statement `
5038
6951
  # statements[i]`.
@@ -5045,12 +6958,11 @@ module Google
5045
6958
  # @return [String]
5046
6959
  attr_accessor :database
5047
6960
 
5048
- # The progress of the UpdateDatabaseDdl operations. Currently, only index
5049
- # creation statements will have a continuously updating progress. For non-index
5050
- # creation statements, `progress[i]` will have start time and end time populated
5051
- # with commit timestamp of operation, as well as a progress of 100% once the
5052
- # operation has completed. `progress[i]` is the operation progress for `
5053
- # statements[i]`.
6961
+ # The progress of the UpdateDatabaseDdl operations. All DDL statements will have
6962
+ # continuously updating progress, and `progress[i]` is the operation progress
6963
+ # for `statements[i]`. Also, `progress[i]` will have start time and end time
6964
+ # populated with commit timestamp of operation, as well as a progress of 100%
6965
+ # once the operation has completed.
5054
6966
  # Corresponds to the JSON property `progress`
5055
6967
  # @return [Array<Google::Apis::SpannerV1::OperationProgress>]
5056
6968
  attr_accessor :progress
@@ -5061,7 +6973,7 @@ module Google
5061
6973
  # @return [Array<String>]
5062
6974
  attr_accessor :statements
5063
6975
 
5064
- # Output only. When true, indicates that the operation is throttled e.g due to
6976
+ # Output only. When true, indicates that the operation is throttled e.g. due to
5065
6977
  # resource constraints. When resources become available the operation will
5066
6978
  # resume and this field will be false again.
5067
6979
  # Corresponds to the JSON property `throttled`
@@ -5075,6 +6987,7 @@ module Google
5075
6987
 
5076
6988
  # Update properties of this object
5077
6989
  def update!(**args)
6990
+ @actions = args[:actions] if args.key?(:actions)
5078
6991
  @commit_timestamps = args[:commit_timestamps] if args.key?(:commit_timestamps)
5079
6992
  @database = args[:database] if args.key?(:database)
5080
6993
  @progress = args[:progress] if args.key?(:progress)
@@ -5102,7 +7015,7 @@ module Google
5102
7015
  # resulting Operation. Specifying an explicit operation ID simplifies
5103
7016
  # determining whether the statements were executed in the event that the
5104
7017
  # UpdateDatabaseDdl call is replayed, or the return value is otherwise lost: the
5105
- # database and `operation_id` fields can be combined to form the name of the
7018
+ # database and `operation_id` fields can be combined to form the `name` of the
5106
7019
  # resulting longrunning.Operation: `/operations/`. `operation_id` should be
5107
7020
  # unique within the database, and must be a valid identifier: `a-z*`. Note that
5108
7021
  # automatically-generated operation IDs always begin with an underscore. If the
@@ -5111,6 +7024,21 @@ module Google
5111
7024
  # @return [String]
5112
7025
  attr_accessor :operation_id
5113
7026
 
7027
+ # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.
7028
+ # Contains a protobuf-serialized [google.protobufFileDescriptorSet](https://
7029
+ # github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.
7030
+ # proto). To generate it, [install](https://grpc.io/docs/protoc-installation/)
7031
+ # and run `protoc` with --include_imports and --descriptor_set_out. For example,
7032
+ # to generate for moon/shot/app.proto, run ``` $protoc --proto_path=/app_path --
7033
+ # proto_path=/lib_path \ --include_imports \ --descriptor_set_out=descriptors.
7034
+ # data \ moon/shot/app.proto ``` For more details, see protobuffer [self
7035
+ # description](https://developers.google.com/protocol-buffers/docs/techniques#
7036
+ # self-description).
7037
+ # Corresponds to the JSON property `protoDescriptors`
7038
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
7039
+ # @return [String]
7040
+ attr_accessor :proto_descriptors
7041
+
5114
7042
  # Required. DDL statements to be applied to the database.
5115
7043
  # Corresponds to the JSON property `statements`
5116
7044
  # @return [Array<String>]
@@ -5123,10 +7051,140 @@ module Google
5123
7051
  # Update properties of this object
5124
7052
  def update!(**args)
5125
7053
  @operation_id = args[:operation_id] if args.key?(:operation_id)
7054
+ @proto_descriptors = args[:proto_descriptors] if args.key?(:proto_descriptors)
5126
7055
  @statements = args[:statements] if args.key?(:statements)
5127
7056
  end
5128
7057
  end
5129
7058
 
7059
+ # Metadata type for the operation returned by UpdateDatabase.
7060
+ class UpdateDatabaseMetadata
7061
+ include Google::Apis::Core::Hashable
7062
+
7063
+ # The time at which this operation was cancelled. If set, this operation is in
7064
+ # the process of undoing itself (which is best-effort).
7065
+ # Corresponds to the JSON property `cancelTime`
7066
+ # @return [String]
7067
+ attr_accessor :cancel_time
7068
+
7069
+ # Encapsulates progress related information for a Cloud Spanner long running
7070
+ # operation.
7071
+ # Corresponds to the JSON property `progress`
7072
+ # @return [Google::Apis::SpannerV1::OperationProgress]
7073
+ attr_accessor :progress
7074
+
7075
+ # The request for UpdateDatabase.
7076
+ # Corresponds to the JSON property `request`
7077
+ # @return [Google::Apis::SpannerV1::UpdateDatabaseRequest]
7078
+ attr_accessor :request
7079
+
7080
+ def initialize(**args)
7081
+ update!(**args)
7082
+ end
7083
+
7084
+ # Update properties of this object
7085
+ def update!(**args)
7086
+ @cancel_time = args[:cancel_time] if args.key?(:cancel_time)
7087
+ @progress = args[:progress] if args.key?(:progress)
7088
+ @request = args[:request] if args.key?(:request)
7089
+ end
7090
+ end
7091
+
7092
+ # The request for UpdateDatabase.
7093
+ class UpdateDatabaseRequest
7094
+ include Google::Apis::Core::Hashable
7095
+
7096
+ # A Cloud Spanner database.
7097
+ # Corresponds to the JSON property `database`
7098
+ # @return [Google::Apis::SpannerV1::Database]
7099
+ attr_accessor :database
7100
+
7101
+ # Required. The list of fields to update. Currently, only `
7102
+ # enable_drop_protection` field can be updated.
7103
+ # Corresponds to the JSON property `updateMask`
7104
+ # @return [String]
7105
+ attr_accessor :update_mask
7106
+
7107
+ def initialize(**args)
7108
+ update!(**args)
7109
+ end
7110
+
7111
+ # Update properties of this object
7112
+ def update!(**args)
7113
+ @database = args[:database] if args.key?(:database)
7114
+ @update_mask = args[:update_mask] if args.key?(:update_mask)
7115
+ end
7116
+ end
7117
+
7118
+ # Metadata type for the operation returned by UpdateInstanceConfig.
7119
+ class UpdateInstanceConfigMetadata
7120
+ include Google::Apis::Core::Hashable
7121
+
7122
+ # The time at which this operation was cancelled.
7123
+ # Corresponds to the JSON property `cancelTime`
7124
+ # @return [String]
7125
+ attr_accessor :cancel_time
7126
+
7127
+ # A possible configuration for a Cloud Spanner instance. Configurations define
7128
+ # the geographic placement of nodes and their replication.
7129
+ # Corresponds to the JSON property `instanceConfig`
7130
+ # @return [Google::Apis::SpannerV1::InstanceConfig]
7131
+ attr_accessor :instance_config
7132
+
7133
+ # Encapsulates progress related information for a Cloud Spanner long running
7134
+ # instance operations.
7135
+ # Corresponds to the JSON property `progress`
7136
+ # @return [Google::Apis::SpannerV1::InstanceOperationProgress]
7137
+ attr_accessor :progress
7138
+
7139
+ def initialize(**args)
7140
+ update!(**args)
7141
+ end
7142
+
7143
+ # Update properties of this object
7144
+ def update!(**args)
7145
+ @cancel_time = args[:cancel_time] if args.key?(:cancel_time)
7146
+ @instance_config = args[:instance_config] if args.key?(:instance_config)
7147
+ @progress = args[:progress] if args.key?(:progress)
7148
+ end
7149
+ end
7150
+
7151
+ # The request for UpdateInstanceConfig.
7152
+ class UpdateInstanceConfigRequest
7153
+ include Google::Apis::Core::Hashable
7154
+
7155
+ # A possible configuration for a Cloud Spanner instance. Configurations define
7156
+ # the geographic placement of nodes and their replication.
7157
+ # Corresponds to the JSON property `instanceConfig`
7158
+ # @return [Google::Apis::SpannerV1::InstanceConfig]
7159
+ attr_accessor :instance_config
7160
+
7161
+ # Required. A mask specifying which fields in InstanceConfig should be updated.
7162
+ # The field mask must always be specified; this prevents any future fields in
7163
+ # InstanceConfig from being erased accidentally by clients that do not know
7164
+ # about them. Only display_name and labels can be updated.
7165
+ # Corresponds to the JSON property `updateMask`
7166
+ # @return [String]
7167
+ attr_accessor :update_mask
7168
+
7169
+ # An option to validate, but not actually execute, a request, and provide the
7170
+ # same response.
7171
+ # Corresponds to the JSON property `validateOnly`
7172
+ # @return [Boolean]
7173
+ attr_accessor :validate_only
7174
+ alias_method :validate_only?, :validate_only
7175
+
7176
+ def initialize(**args)
7177
+ update!(**args)
7178
+ end
7179
+
7180
+ # Update properties of this object
7181
+ def update!(**args)
7182
+ @instance_config = args[:instance_config] if args.key?(:instance_config)
7183
+ @update_mask = args[:update_mask] if args.key?(:update_mask)
7184
+ @validate_only = args[:validate_only] if args.key?(:validate_only)
7185
+ end
7186
+ end
7187
+
5130
7188
  # Metadata type for the operation returned by UpdateInstance.
5131
7189
  class UpdateInstanceMetadata
5132
7190
  include Google::Apis::Core::Hashable
@@ -5143,6 +7201,11 @@ module Google
5143
7201
  # @return [String]
5144
7202
  attr_accessor :end_time
5145
7203
 
7204
+ # The expected fulfillment period of this update operation.
7205
+ # Corresponds to the JSON property `expectedFulfillmentPeriod`
7206
+ # @return [String]
7207
+ attr_accessor :expected_fulfillment_period
7208
+
5146
7209
  # An isolated set of Cloud Spanner resources on which databases can be hosted.
5147
7210
  # Corresponds to the JSON property `instance`
5148
7211
  # @return [Google::Apis::SpannerV1::Instance]
@@ -5161,11 +7224,81 @@ module Google
5161
7224
  def update!(**args)
5162
7225
  @cancel_time = args[:cancel_time] if args.key?(:cancel_time)
5163
7226
  @end_time = args[:end_time] if args.key?(:end_time)
7227
+ @expected_fulfillment_period = args[:expected_fulfillment_period] if args.key?(:expected_fulfillment_period)
5164
7228
  @instance = args[:instance] if args.key?(:instance)
5165
7229
  @start_time = args[:start_time] if args.key?(:start_time)
5166
7230
  end
5167
7231
  end
5168
7232
 
7233
+ # Metadata type for the operation returned by UpdateInstancePartition.
7234
+ class UpdateInstancePartitionMetadata
7235
+ include Google::Apis::Core::Hashable
7236
+
7237
+ # The time at which this operation was cancelled. If set, this operation is in
7238
+ # the process of undoing itself (which is guaranteed to succeed) and cannot be
7239
+ # cancelled again.
7240
+ # Corresponds to the JSON property `cancelTime`
7241
+ # @return [String]
7242
+ attr_accessor :cancel_time
7243
+
7244
+ # The time at which this operation failed or was completed successfully.
7245
+ # Corresponds to the JSON property `endTime`
7246
+ # @return [String]
7247
+ attr_accessor :end_time
7248
+
7249
+ # An isolated set of Cloud Spanner resources that databases can define
7250
+ # placements on.
7251
+ # Corresponds to the JSON property `instancePartition`
7252
+ # @return [Google::Apis::SpannerV1::InstancePartition]
7253
+ attr_accessor :instance_partition
7254
+
7255
+ # The time at which UpdateInstancePartition request was received.
7256
+ # Corresponds to the JSON property `startTime`
7257
+ # @return [String]
7258
+ attr_accessor :start_time
7259
+
7260
+ def initialize(**args)
7261
+ update!(**args)
7262
+ end
7263
+
7264
+ # Update properties of this object
7265
+ def update!(**args)
7266
+ @cancel_time = args[:cancel_time] if args.key?(:cancel_time)
7267
+ @end_time = args[:end_time] if args.key?(:end_time)
7268
+ @instance_partition = args[:instance_partition] if args.key?(:instance_partition)
7269
+ @start_time = args[:start_time] if args.key?(:start_time)
7270
+ end
7271
+ end
7272
+
7273
+ # The request for UpdateInstancePartition.
7274
+ class UpdateInstancePartitionRequest
7275
+ include Google::Apis::Core::Hashable
7276
+
7277
+ # Required. A mask specifying which fields in InstancePartition should be
7278
+ # updated. The field mask must always be specified; this prevents any future
7279
+ # fields in InstancePartition from being erased accidentally by clients that do
7280
+ # not know about them.
7281
+ # Corresponds to the JSON property `fieldMask`
7282
+ # @return [String]
7283
+ attr_accessor :field_mask
7284
+
7285
+ # An isolated set of Cloud Spanner resources that databases can define
7286
+ # placements on.
7287
+ # Corresponds to the JSON property `instancePartition`
7288
+ # @return [Google::Apis::SpannerV1::InstancePartition]
7289
+ attr_accessor :instance_partition
7290
+
7291
+ def initialize(**args)
7292
+ update!(**args)
7293
+ end
7294
+
7295
+ # Update properties of this object
7296
+ def update!(**args)
7297
+ @field_mask = args[:field_mask] if args.key?(:field_mask)
7298
+ @instance_partition = args[:instance_partition] if args.key?(:instance_partition)
7299
+ end
7300
+ end
7301
+
5169
7302
  # The request for UpdateInstance.
5170
7303
  class UpdateInstanceRequest
5171
7304
  include Google::Apis::Core::Hashable