google-cloud-spanner 1.14.0 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/lib/google-cloud-spanner.rb +13 -0
  4. data/lib/google/cloud/spanner.rb +2 -1
  5. data/lib/google/cloud/spanner/admin/database.rb +3 -2
  6. data/lib/google/cloud/spanner/admin/database/v1.rb +3 -2
  7. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +742 -20
  8. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client_config.json +40 -0
  9. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/field_mask.rb +222 -0
  10. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/timestamp.rb +113 -0
  11. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/backup.rb +325 -0
  12. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +197 -30
  13. data/lib/google/cloud/spanner/admin/instance.rb +1 -1
  14. data/lib/google/cloud/spanner/admin/instance/v1.rb +1 -1
  15. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +6 -13
  16. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +8 -5
  17. data/lib/google/cloud/spanner/batch_client.rb +5 -3
  18. data/lib/google/cloud/spanner/batch_snapshot.rb +43 -8
  19. data/lib/google/cloud/spanner/client.rb +57 -8
  20. data/lib/google/cloud/spanner/project.rb +31 -6
  21. data/lib/google/cloud/spanner/results.rb +4 -2
  22. data/lib/google/cloud/spanner/service.rb +3 -1
  23. data/lib/google/cloud/spanner/session.rb +37 -6
  24. data/lib/google/cloud/spanner/snapshot.rb +26 -3
  25. data/lib/google/cloud/spanner/transaction.rb +49 -5
  26. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +8 -1
  27. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +91 -102
  28. data/lib/google/cloud/spanner/v1/spanner_client.rb +112 -136
  29. data/lib/google/cloud/spanner/version.rb +1 -1
  30. data/lib/google/spanner/admin/database/v1/backup_pb.rb +98 -0
  31. data/lib/google/spanner/admin/database/v1/common_pb.rb +28 -0
  32. data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +53 -0
  33. data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +82 -12
  34. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +1 -2
  35. data/lib/google/spanner/v1/spanner_pb.rb +5 -0
  36. data/lib/google/spanner/v1/spanner_services_pb.rb +31 -40
  37. metadata +7 -2
@@ -18,6 +18,16 @@ module Google
18
18
  module Admin
19
19
  module Database
20
20
  module V1
21
+ # Information about the database restore.
22
+ # @!attribute [rw] source_type
23
+ # @return [Google::Spanner::Admin::Database::V1::RestoreSourceType]
24
+ # The type of the restore source.
25
+ # @!attribute [rw] backup_info
26
+ # @return [Google::Spanner::Admin::Database::V1::BackupInfo]
27
+ # Information about the backup used to restore the database. The backup
28
+ # may no longer exist.
29
+ class RestoreInfo; end
30
+
21
31
  # A Cloud Spanner database.
22
32
  # @!attribute [rw] name
23
33
  # @return [String]
@@ -29,6 +39,13 @@ module Google
29
39
  # @!attribute [rw] state
30
40
  # @return [Google::Spanner::Admin::Database::V1::Database::State]
31
41
  # Output only. The current database state.
42
+ # @!attribute [rw] create_time
43
+ # @return [Google::Protobuf::Timestamp]
44
+ # Output only. If exists, the time at which the database creation started.
45
+ # @!attribute [rw] restore_info
46
+ # @return [Google::Spanner::Admin::Database::V1::RestoreInfo]
47
+ # Output only. Applicable only for restored databases. Contains information
48
+ # about the restore source.
32
49
  class Database
33
50
  # Indicates the current state of the database.
34
51
  module State
@@ -41,11 +58,20 @@ module Google
41
58
 
42
59
  # The database is fully created and ready for use.
43
60
  READY = 2
61
+
62
+ # The database is fully created and ready for use, but is still
63
+ # being optimized for performance and cannot handle full load.
64
+ #
65
+ # In this state, the database still references the backup
66
+ # it was restore from, preventing the backup
67
+ # from being deleted. When optimizations are complete, the full performance
68
+ # of the database will be restored, and the database will transition to
69
+ # `READY` state.
70
+ READY_OPTIMIZING = 3
44
71
  end
45
72
  end
46
73
 
47
- # The request for
48
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabases ListDatabases}.
74
+ # The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabases ListDatabases}.
49
75
  # @!attribute [rw] parent
50
76
  # @return [String]
51
77
  # Required. The instance whose databases should be listed.
@@ -57,25 +83,22 @@ module Google
57
83
  # @!attribute [rw] page_token
58
84
  # @return [String]
59
85
  # If non-empty, `page_token` should contain a
60
- # {Google::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token}
61
- # from a previous
62
- # {Google::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}.
86
+ # {Google::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token} from a
87
+ # previous {Google::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}.
63
88
  class ListDatabasesRequest; end
64
89
 
65
- # The response for
66
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabases ListDatabases}.
90
+ # The response for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabases ListDatabases}.
67
91
  # @!attribute [rw] databases
68
92
  # @return [Array<Google::Spanner::Admin::Database::V1::Database>]
69
93
  # Databases that matched the request.
70
94
  # @!attribute [rw] next_page_token
71
95
  # @return [String]
72
96
  # `next_page_token` can be sent in a subsequent
73
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabases ListDatabases}
74
- # call to fetch more of the matching databases.
97
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabases ListDatabases} call to fetch more
98
+ # of the matching databases.
75
99
  class ListDatabasesResponse; end
76
100
 
77
- # The request for
78
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateDatabase CreateDatabase}.
101
+ # The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateDatabase CreateDatabase}.
79
102
  # @!attribute [rw] parent
80
103
  # @return [String]
81
104
  # Required. The name of the instance that will serve the new database.
@@ -89,7 +112,7 @@ module Google
89
112
  # database ID must be enclosed in backticks (`` ` ``).
90
113
  # @!attribute [rw] extra_statements
91
114
  # @return [Array<String>]
92
- # An optional list of DDL statements to run inside the newly created
115
+ # Optional. A list of DDL statements to run inside the newly created
93
116
  # database. Statements can create tables, indexes, etc. These
94
117
  # statements execute atomically with the creation of the database:
95
118
  # if there is an error in any statement, the database is not created.
@@ -102,8 +125,7 @@ module Google
102
125
  # The database being created.
103
126
  class CreateDatabaseMetadata; end
104
127
 
105
- # The request for
106
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::GetDatabase GetDatabase}.
128
+ # The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::GetDatabase GetDatabase}.
107
129
  # @!attribute [rw] name
108
130
  # @return [String]
109
131
  # Required. The name of the requested database. Values are of the form
@@ -124,8 +146,8 @@ module Google
124
146
  # Each batch of statements is assigned a name which can be used with
125
147
  # the {Google::Longrunning::Operations Operations} API to monitor
126
148
  # progress. See the
127
- # {Google::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#operation_id operation_id}
128
- # field for more details.
149
+ # {Google::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#operation_id operation_id} field for more
150
+ # details.
129
151
  # @!attribute [rw] database
130
152
  # @return [String]
131
153
  # Required. The database to update.
@@ -141,20 +163,18 @@ module Google
141
163
  #
142
164
  # Specifying an explicit operation ID simplifies determining
143
165
  # whether the statements were executed in the event that the
144
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::UpdateDatabaseDdl UpdateDatabaseDdl}
145
- # call is replayed, or the return value is otherwise lost: the
146
- # {Google::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database}
147
- # and `operation_id` fields can be combined to form the
166
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::UpdateDatabaseDdl UpdateDatabaseDdl} call is replayed,
167
+ # or the return value is otherwise lost: the {Google::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database} and
168
+ # `operation_id` fields can be combined to form the
148
169
  # {Google::Longrunning::Operation#name name} of the resulting
149
- # {Google::Longrunning::Operation longrunning::Operation}:
150
- # `<database>/operations/<operation_id>`.
170
+ # {Google::Longrunning::Operation longrunning::Operation}: `<database>/operations/<operation_id>`.
151
171
  #
152
172
  # `operation_id` should be unique within the database, and must be
153
173
  # a valid identifier: `[a-z][a-z0-9_]*`. Note that
154
174
  # automatically-generated operation IDs always begin with an
155
175
  # underscore. If the named operation already exists,
156
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::UpdateDatabaseDdl UpdateDatabaseDdl}
157
- # returns `ALREADY_EXISTS`.
176
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::UpdateDatabaseDdl UpdateDatabaseDdl} returns
177
+ # `ALREADY_EXISTS`.
158
178
  class UpdateDatabaseDdlRequest; end
159
179
 
160
180
  # Metadata type for the operation returned by
@@ -173,27 +193,174 @@ module Google
173
193
  # timestamp for the statement `statements[i]`.
174
194
  class UpdateDatabaseDdlMetadata; end
175
195
 
176
- # The request for
177
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::DropDatabase DropDatabase}.
196
+ # The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::DropDatabase DropDatabase}.
178
197
  # @!attribute [rw] database
179
198
  # @return [String]
180
199
  # Required. The database to be dropped.
181
200
  class DropDatabaseRequest; end
182
201
 
183
- # The request for
184
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::GetDatabaseDdl GetDatabaseDdl}.
202
+ # The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::GetDatabaseDdl GetDatabaseDdl}.
185
203
  # @!attribute [rw] database
186
204
  # @return [String]
187
205
  # Required. The database whose schema we wish to get.
188
206
  class GetDatabaseDdlRequest; end
189
207
 
190
- # The response for
191
- # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::GetDatabaseDdl GetDatabaseDdl}.
208
+ # The response for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::GetDatabaseDdl GetDatabaseDdl}.
192
209
  # @!attribute [rw] statements
193
210
  # @return [Array<String>]
194
211
  # A list of formatted DDL statements defining the schema of the database
195
212
  # specified in the request.
196
213
  class GetDatabaseDdlResponse; end
214
+
215
+ # The request for
216
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabaseOperations ListDatabaseOperations}.
217
+ # @!attribute [rw] parent
218
+ # @return [String]
219
+ # Required. The instance of the database operations.
220
+ # Values are of the form `projects/<project>/instances/<instance>`.
221
+ # @!attribute [rw] filter
222
+ # @return [String]
223
+ # An expression that filters the list of returned operations.
224
+ #
225
+ # A filter expression consists of a field name, a
226
+ # comparison operator, and a value for filtering.
227
+ # The value must be a string, a number, or a boolean. The comparison operator
228
+ # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
229
+ # Colon `:` is the contains operator. Filter rules are not case sensitive.
230
+ #
231
+ # The following fields in the {Google::Longrunning::Operation Operation}
232
+ # are eligible for filtering:
233
+ #
234
+ # * `name` - The name of the long-running operation
235
+ # * `done` - False if the operation is in progress, else true.
236
+ # * `metadata.@type` - the type of metadata. For example, the type string
237
+ # for {Google::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} is
238
+ # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
239
+ # * `metadata.<field_name>` - any field in metadata.value.
240
+ # * `error` - Error associated with the long-running operation.
241
+ # * `response.@type` - the type of response.
242
+ # * `response.<field_name>` - any field in response.value.
243
+ #
244
+ # You can combine multiple expressions by enclosing each expression in
245
+ # parentheses. By default, expressions are combined with AND logic. However,
246
+ # you can specify AND, OR, and NOT logic explicitly.
247
+ #
248
+ # Here are a few examples:
249
+ #
250
+ # * `done:true` - The operation is complete.
251
+ # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
252
+ # `(metadata.source_type:BACKUP) AND` <br/>
253
+ # `(metadata.backup_info.backup:backup_howl) AND` <br/>
254
+ # `(metadata.name:restored_howl) AND` <br/>
255
+ # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
256
+ # `(error:*)` - Return operations where:
257
+ # * The operation's metadata type is {Google::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}.
258
+ # * The database is restored from a backup.
259
+ # * The backup name contains "backup_howl".
260
+ # * The restored database's name contains "restored_howl".
261
+ # * The operation started before 2018-03-28T14:50:00Z.
262
+ # * The operation resulted in an error.
263
+ # @!attribute [rw] page_size
264
+ # @return [Integer]
265
+ # Number of operations to be returned in the response. If 0 or
266
+ # less, defaults to the server's maximum allowed page size.
267
+ # @!attribute [rw] page_token
268
+ # @return [String]
269
+ # If non-empty, `page_token` should contain a
270
+ # {Google::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token}
271
+ # from a previous {Google::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse} to the
272
+ # same `parent` and with the same `filter`.
273
+ class ListDatabaseOperationsRequest; end
274
+
275
+ # The response for
276
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabaseOperations ListDatabaseOperations}.
277
+ # @!attribute [rw] operations
278
+ # @return [Array<Google::Longrunning::Operation>]
279
+ # The list of matching database [long-running
280
+ # operations][google.longrunning.Operation]. Each operation's name will be
281
+ # prefixed by the database's name. The operation's
282
+ # {Google::Longrunning::Operation#metadata metadata} field type
283
+ # `metadata.type_url` describes the type of the metadata.
284
+ # @!attribute [rw] next_page_token
285
+ # @return [String]
286
+ # `next_page_token` can be sent in a subsequent
287
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListDatabaseOperations ListDatabaseOperations}
288
+ # call to fetch more of the matching metadata.
289
+ class ListDatabaseOperationsResponse; end
290
+
291
+ # The request for
292
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::RestoreDatabase RestoreDatabase}.
293
+ # @!attribute [rw] parent
294
+ # @return [String]
295
+ # Required. The name of the instance in which to create the
296
+ # restored database. This instance must be in the same project and
297
+ # have the same instance configuration as the instance containing
298
+ # the source backup. Values are of the form
299
+ # `projects/<project>/instances/<instance>`.
300
+ # @!attribute [rw] database_id
301
+ # @return [String]
302
+ # Required. The id of the database to create and restore to. This
303
+ # database must not already exist. The `database_id` appended to
304
+ # `parent` forms the full database name of the form
305
+ # `projects/<project>/instances/<instance>/databases/<database_id>`.
306
+ # @!attribute [rw] backup
307
+ # @return [String]
308
+ # Name of the backup from which to restore. Values are of the form
309
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
310
+ class RestoreDatabaseRequest; end
311
+
312
+ # Metadata type for the long-running operation returned by
313
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::RestoreDatabase RestoreDatabase}.
314
+ # @!attribute [rw] name
315
+ # @return [String]
316
+ # Name of the database being created and restored to.
317
+ # @!attribute [rw] source_type
318
+ # @return [Google::Spanner::Admin::Database::V1::RestoreSourceType]
319
+ # The type of the restore source.
320
+ # @!attribute [rw] backup_info
321
+ # @return [Google::Spanner::Admin::Database::V1::BackupInfo]
322
+ # Information about the backup used to restore the database.
323
+ # @!attribute [rw] progress
324
+ # @return [Google::Spanner::Admin::Database::V1::OperationProgress]
325
+ # The progress of the
326
+ # {Google::Spanner::Admin::Database::V1::DatabaseAdmin::RestoreDatabase RestoreDatabase}
327
+ # operation.
328
+ # @!attribute [rw] cancel_time
329
+ # @return [Google::Protobuf::Timestamp]
330
+ # The time at which cancellation of this operation was received.
331
+ # {Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}
332
+ # starts asynchronous cancellation on a long-running operation. The server
333
+ # makes a best effort to cancel the operation, but success is not guaranteed.
334
+ # Clients can use
335
+ # {Google::Longrunning::Operations::GetOperation Operations::GetOperation} or
336
+ # other methods to check whether the cancellation succeeded or whether the
337
+ # operation completed despite cancellation. On successful cancellation,
338
+ # the operation is not deleted; instead, it becomes an operation with
339
+ # an {Google::Longrunning::Operation#error Operation#error} value with a
340
+ # {Google::Rpc::Status#code} of 1, corresponding to `Code.CANCELLED`.
341
+ # @!attribute [rw] optimize_database_operation_name
342
+ # @return [String]
343
+ # If exists, the name of the long-running operation that will be used to
344
+ # track the post-restore optimization process to optimize the performance of
345
+ # the restored database, and remove the dependency on the restore source.
346
+ # The name is of the form
347
+ # `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
348
+ # where the <database> is the name of database being created and restored to.
349
+ # The metadata type of the long-running operation is
350
+ # {Google::Spanner::Admin::Database::V1::OptimizeRestoredDatabaseMetadata OptimizeRestoredDatabaseMetadata}. This long-running operation will be
351
+ # automatically created by the system after the RestoreDatabase long-running
352
+ # operation completes successfully. This operation will not be created if the
353
+ # restore was not successful.
354
+ class RestoreDatabaseMetadata; end
355
+
356
+ # Indicates the type of the restore source.
357
+ module RestoreSourceType
358
+ # No restore associated.
359
+ TYPE_UNSPECIFIED = 0
360
+
361
+ # A backup was used as the source of the restore.
362
+ BACKUP = 1
363
+ end
197
364
  end
198
365
  end
199
366
  end
@@ -23,7 +23,7 @@ module Google
23
23
  # rubocop:disable LineLength
24
24
 
25
25
  ##
26
- # # Ruby Client for Cloud Spanner Instance Admin API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
26
+ # # Ruby Client for Cloud Spanner Instance Admin API
27
27
  #
28
28
  # [Cloud Spanner Instance Admin API][Product Documentation]:
29
29
  #
@@ -24,7 +24,7 @@ module Google
24
24
  # rubocop:disable LineLength
25
25
 
26
26
  ##
27
- # # Ruby Client for Cloud Spanner Instance Admin API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
27
+ # # Ruby Client for Cloud Spanner Instance Admin API
28
28
  #
29
29
  # [Cloud Spanner Instance Admin API][Product Documentation]:
30
30
  #
@@ -139,14 +139,7 @@ module Google
139
139
  # allow "_" in a future release.
140
140
  # @!attribute [rw] endpoint_uris
141
141
  # @return [Array<String>]
142
- # Output only. The endpoint URIs based on the instance config.
143
- # For example, instances located in a specific cloud region (or multi region)
144
- # such as nam3, would have a nam3 specific endpoint URI.
145
- # This URI is to be used implictly by SDK clients, with fallback to default
146
- # URI. These endpoints are intended to optimize the network routing between
147
- # the client and the instance's serving resources.
148
- # If multiple endpoints are present, client may establish connections using
149
- # any of the given URIs.
142
+ # Deprecated. This field is not populated.
150
143
  class Instance
151
144
  # Indicates the current state of the instance.
152
145
  module State
@@ -207,9 +200,9 @@ module Google
207
200
  # `projects/<project>/instances/<instance>`.
208
201
  # @!attribute [rw] field_mask
209
202
  # @return [Google::Protobuf::FieldMask]
210
- # If field_mask is present, specifies the subset of [][google.spanner.admin.instance.v1.Instance] fields that
203
+ # If field_mask is present, specifies the subset of {Google::Spanner::Admin::Instance::V1::Instance Instance} fields that
211
204
  # should be returned.
212
- # If absent, all [][google.spanner.admin.instance.v1.Instance] fields are returned.
205
+ # If absent, all {Google::Spanner::Admin::Instance::V1::Instance Instance} fields are returned.
213
206
  class GetInstanceRequest; end
214
207
 
215
208
  # The request for {Google::Spanner::Admin::Instance::V1::InstanceAdmin::CreateInstance CreateInstance}.
@@ -280,12 +273,12 @@ module Google
280
273
  # @!attribute [rw] instance
281
274
  # @return [Google::Spanner::Admin::Instance::V1::Instance]
282
275
  # Required. The instance to update, which must always include the instance
283
- # name. Otherwise, only fields mentioned in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need be included.
276
+ # name. Otherwise, only fields mentioned in {Google::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} need be included.
284
277
  # @!attribute [rw] field_mask
285
278
  # @return [Google::Protobuf::FieldMask]
286
- # Required. A mask specifying which fields in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] should be updated.
279
+ # Required. A mask specifying which fields in {Google::Spanner::Admin::Instance::V1::Instance Instance} should be updated.
287
280
  # The field mask must always be specified; this prevents any future fields in
288
- # [][google.spanner.admin.instance.v1.Instance] from being erased accidentally by clients that do not know
281
+ # {Google::Spanner::Admin::Instance::V1::Instance Instance} from being erased accidentally by clients that do not know
289
282
  # about them.
290
283
  class UpdateInstanceRequest; end
291
284
 
@@ -240,6 +240,9 @@ module Google
240
240
  google_api_client.freeze
241
241
 
242
242
  headers = { :"x-goog-api-client" => google_api_client }
243
+ if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
244
+ headers[:"x-goog-user-project"] = credentials.quota_project_id
245
+ end
243
246
  headers.merge!(metadata) unless metadata.nil?
244
247
  client_config_file = Pathname.new(__dir__).join(
245
248
  "instance_admin_client_config.json"
@@ -526,9 +529,9 @@ module Google
526
529
  # Required. The name of the requested instance. Values are of the form
527
530
  # `projects/<project>/instances/<instance>`.
528
531
  # @param field_mask [Google::Protobuf::FieldMask | Hash]
529
- # If field_mask is present, specifies the subset of [][google.spanner.admin.instance.v1.Instance] fields that
532
+ # If field_mask is present, specifies the subset of {Google::Spanner::Admin::Instance::V1::Instance Instance} fields that
530
533
  # should be returned.
531
- # If absent, all [][google.spanner.admin.instance.v1.Instance] fields are returned.
534
+ # If absent, all {Google::Spanner::Admin::Instance::V1::Instance Instance} fields are returned.
532
535
  # A hash of the same form as `Google::Protobuf::FieldMask`
533
536
  # can also be provided.
534
537
  # @param options [Google::Gax::CallOptions]
@@ -715,13 +718,13 @@ module Google
715
718
  #
716
719
  # @param instance [Google::Spanner::Admin::Instance::V1::Instance | Hash]
717
720
  # Required. The instance to update, which must always include the instance
718
- # name. Otherwise, only fields mentioned in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need be included.
721
+ # name. Otherwise, only fields mentioned in {Google::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} need be included.
719
722
  # A hash of the same form as `Google::Spanner::Admin::Instance::V1::Instance`
720
723
  # can also be provided.
721
724
  # @param field_mask [Google::Protobuf::FieldMask | Hash]
722
- # Required. A mask specifying which fields in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] should be updated.
725
+ # Required. A mask specifying which fields in {Google::Spanner::Admin::Instance::V1::Instance Instance} should be updated.
723
726
  # The field mask must always be specified; this prevents any future fields in
724
- # [][google.spanner.admin.instance.v1.Instance] from being erased accidentally by clients that do not know
727
+ # {Google::Spanner::Admin::Instance::V1::Instance Instance} from being erased accidentally by clients that do not know
725
728
  # about them.
726
729
  # A hash of the same form as `Google::Protobuf::FieldMask`
727
730
  # can also be provided.
@@ -65,11 +65,13 @@ module Google
65
65
  class BatchClient
66
66
  ##
67
67
  # @private Creates a new Spanner BatchClient instance.
68
- def initialize project, instance_id, database_id, session_labels: nil
68
+ def initialize project, instance_id, database_id, session_labels: nil,
69
+ query_options: nil
69
70
  @project = project
70
71
  @instance_id = instance_id
71
72
  @database_id = database_id
72
73
  @session_labels = session_labels
74
+ @query_options = query_options
73
75
  end
74
76
 
75
77
  # The unique identifier for the project.
@@ -231,7 +233,7 @@ module Google
231
233
  def load_batch_snapshot serialized_snapshot
232
234
  ensure_service!
233
235
 
234
- BatchSnapshot.load serialized_snapshot, service: @project.service
236
+ BatchSnapshot.load serialized_snapshot, service: @project.service, query_options: @query_options
235
237
  end
236
238
 
237
239
  ##
@@ -409,7 +411,7 @@ module Google
409
411
  project_id, instance_id, database_id
410
412
  ),
411
413
  labels: @session_labels
412
- Session.from_grpc grpc, @project.service
414
+ Session.from_grpc grpc, @project.service, query_options: @query_options
413
415
  end
414
416
 
415
417
  ##