Google Cloud Spanner C++ Client  2.6.0
A C++ Client Library for Google Cloud Spanner
instance_admin_client.h
Go to the documentation of this file.
1 // Copyright 2021 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 // Generated by the Codegen C++ plugin.
16 // If you make any local changes, they will be lost.
17 // source: google/spanner/admin/instance/v1/spanner_instance_admin.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CLIENT_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CLIENT_H
21 
22 #include "google/cloud/spanner/admin/instance_admin_connection.h"
23 #include "google/cloud/future.h"
24 #include "google/cloud/iam_updater.h"
25 #include "google/cloud/options.h"
26 #include "google/cloud/polling_policy.h"
27 #include "google/cloud/status_or.h"
28 #include "google/cloud/version.h"
29 #include <google/longrunning/operations.grpc.pb.h>
30 #include <map>
31 #include <memory>
32 
33 namespace google {
34 namespace cloud {
35 namespace spanner_admin {
37 
38 ///
39 /// Cloud Spanner Instance Admin API
40 ///
41 /// The Cloud Spanner Instance Admin API can be used to create, delete,
42 /// modify and list instances. Instances are dedicated Cloud Spanner serving
43 /// and storage resources to be used by Cloud Spanner databases.
44 ///
45 /// Each instance has a "configuration", which dictates where the
46 /// serving resources for the Cloud Spanner instance are located (e.g.,
47 /// US-central, Europe). Configurations are created by Google based on
48 /// resource availability.
49 ///
50 /// Cloud Spanner billing is based on the instances that exist and their
51 /// sizes. After an instance exists, there are no additional
52 /// per-database or per-operation charges for use of the instance
53 /// (though there may be additional network bandwidth charges).
54 /// Instances offer isolation: problems with databases in one instance
55 /// will not affect other instances. However, within an instance
56 /// databases can affect each other. For example, if one database in an
57 /// instance receives a lot of requests and consumes most of the
58 /// instance resources, fewer resources are available for other
59 /// databases in that instance, and their performance may suffer.
60 ///
61 /// @par Equality
62 ///
63 /// Instances of this class created via copy-construction or copy-assignment
64 /// always compare equal. Instances created with equal
65 /// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
66 /// equal share the same underlying resources.
67 ///
68 /// @par Performance
69 ///
70 /// Creating a new instance of this class is a relatively expensive operation,
71 /// new objects establish new connections to the service. In contrast,
72 /// copy-construction, move-construction, and the corresponding assignment
73 /// operations are relatively efficient as the copies share all underlying
74 /// resources.
75 ///
76 /// @par Thread Safety
77 ///
78 /// Concurrent access to different instances of this class, even if they compare
79 /// equal, is guaranteed to work. Two or more threads operating on the same
80 /// instance of this class is not guaranteed to work. Since copy-construction
81 /// and move-construction is a relatively efficient operation, consider using
82 /// such a copy when using this class from multiple threads.
83 ///
85  public:
87  std::shared_ptr<InstanceAdminConnection> connection, Options opts = {});
89 
90  ///@{
91  // @name Copy and move support
96  ///@}
97 
98  ///@{
99  // @name Equality
100  friend bool operator==(InstanceAdminClient const& a,
101  InstanceAdminClient const& b) {
102  return a.connection_ == b.connection_;
103  }
104  friend bool operator!=(InstanceAdminClient const& a,
105  InstanceAdminClient const& b) {
106  return !(a == b);
107  }
108  ///@}
109 
110  ///
111  /// Lists the supported instance configurations for a given project.
112  ///
113  /// @param parent Required. The name of the project for which a list of
114  /// supported instance
115  /// configurations is requested. Values are of the form
116  /// `projects/<project>`.
117  /// @param opts Optional. Override the class-level options, such as retry and
118  /// backoff policies.
119  /// @return
120  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
121  ///
122  /// [google.spanner.admin.instance.v1.ListInstanceConfigsRequest]:
123  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L671}
124  /// [google.spanner.admin.instance.v1.InstanceConfig]:
125  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
126  ///
127  StreamRange<google::spanner::admin::instance::v1::InstanceConfig>
128  ListInstanceConfigs(std::string const& parent, Options opts = {});
129 
130  ///
131  /// Lists the supported instance configurations for a given project.
132  ///
133  /// @param request
134  /// @googleapis_link{google::spanner::admin::instance::v1::ListInstanceConfigsRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L671}
135  /// @param opts Optional. Override the class-level options, such as retry and
136  /// backoff policies.
137  /// @return
138  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
139  ///
140  /// [google.spanner.admin.instance.v1.ListInstanceConfigsRequest]:
141  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L671}
142  /// [google.spanner.admin.instance.v1.InstanceConfig]:
143  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
144  ///
145  StreamRange<google::spanner::admin::instance::v1::InstanceConfig>
147  google::spanner::admin::instance::v1::ListInstanceConfigsRequest request,
148  Options opts = {});
149 
150  ///
151  /// Gets information about a particular instance configuration.
152  ///
153  /// @param name Required. The name of the requested instance configuration.
154  /// Values are of
155  /// the form `projects/<project>/instanceConfigs/<config>`.
156  /// @param opts Optional. Override the class-level options, such as retry and
157  /// backoff policies.
158  /// @return
159  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
160  ///
161  /// [google.spanner.admin.instance.v1.GetInstanceConfigRequest]:
162  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L707}
163  /// [google.spanner.admin.instance.v1.InstanceConfig]:
164  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
165  ///
166  StatusOr<google::spanner::admin::instance::v1::InstanceConfig>
167  GetInstanceConfig(std::string const& name, Options opts = {});
168 
169  ///
170  /// Gets information about a particular instance configuration.
171  ///
172  /// @param request
173  /// @googleapis_link{google::spanner::admin::instance::v1::GetInstanceConfigRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L707}
174  /// @param opts Optional. Override the class-level options, such as retry and
175  /// backoff policies.
176  /// @return
177  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
178  ///
179  /// [google.spanner.admin.instance.v1.GetInstanceConfigRequest]:
180  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L707}
181  /// [google.spanner.admin.instance.v1.InstanceConfig]:
182  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
183  ///
184  StatusOr<google::spanner::admin::instance::v1::InstanceConfig>
186  google::spanner::admin::instance::v1::GetInstanceConfigRequest const&
187  request,
188  Options opts = {});
189 
190  ///
191  /// Creates an instance config and begins preparing it to be used. The
192  /// returned [long-running operation][google.longrunning.Operation]
193  /// can be used to track the progress of preparing the new
194  /// instance config. The instance config name is assigned by the caller. If
195  /// the named instance config already exists, `CreateInstanceConfig` returns
196  /// `ALREADY_EXISTS`.
197  ///
198  /// Immediately after the request returns:
199  ///
200  /// * The instance config is readable via the API, with all requested
201  /// attributes. The instance config's
202  /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
203  /// field is set to true. Its state is `CREATING`.
204  ///
205  /// While the operation is pending:
206  ///
207  /// * Cancelling the operation renders the instance config immediately
208  /// unreadable via the API.
209  /// * Except for deleting the creating resource, all other attempts to
210  /// modify
211  /// the instance config are rejected.
212  ///
213  /// Upon completion of the returned operation:
214  ///
215  /// * Instances can be created using the instance configuration.
216  /// * The instance config's
217  /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
218  /// field becomes false. Its state becomes `READY`.
219  ///
220  /// The returned [long-running operation][google.longrunning.Operation] will
221  /// have a name of the format
222  /// `<instance_config_name>/operations/<operation_id>` and can be used to
223  /// track creation of the instance config. The
224  /// [metadata][google.longrunning.Operation.metadata] field type is
225  /// [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata].
226  /// The [response][google.longrunning.Operation.response] field type is
227  /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
228  /// successful.
229  ///
230  /// Authorization requires `spanner.instanceConfigs.create` permission on
231  /// the resource
232  /// [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent].
233  ///
234  /// @param parent Required. The name of the project in which to create the
235  /// instance config.
236  /// Values are of the form `projects/<project>`.
237  /// @param instance_config Required. The InstanceConfig proto of the
238  /// configuration to create.
239  /// instance_config.name must be
240  /// `<parent>/instanceConfigs/<instance_config_id>`.
241  /// instance_config.base_config must be a Google managed configuration name,
242  /// e.g. `<parent>/instanceConfigs/us-east1`,
243  /// `<parent>/instanceConfigs/nam3`.
244  /// @param instance_config_id Required. The ID of the instance config to
245  /// create. Valid identifiers are
246  /// of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
247  /// characters in length. The `custom-` prefix is required to avoid name
248  /// conflicts with Google managed configurations.
249  /// @param opts Optional. Override the class-level options, such as retry and
250  /// backoff policies.
251  /// @return
252  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
253  ///
254  /// [google.spanner.admin.instance.v1.CreateInstanceConfigRequest]:
255  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L720}
256  /// [google.spanner.admin.instance.v1.InstanceConfig]:
257  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
258  ///
259  future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
261  std::string const& parent,
262  google::spanner::admin::instance::v1::InstanceConfig const&
263  instance_config,
264  std::string const& instance_config_id, Options opts = {});
265 
266  ///
267  /// Creates an instance config and begins preparing it to be used. The
268  /// returned [long-running operation][google.longrunning.Operation]
269  /// can be used to track the progress of preparing the new
270  /// instance config. The instance config name is assigned by the caller. If
271  /// the named instance config already exists, `CreateInstanceConfig` returns
272  /// `ALREADY_EXISTS`.
273  ///
274  /// Immediately after the request returns:
275  ///
276  /// * The instance config is readable via the API, with all requested
277  /// attributes. The instance config's
278  /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
279  /// field is set to true. Its state is `CREATING`.
280  ///
281  /// While the operation is pending:
282  ///
283  /// * Cancelling the operation renders the instance config immediately
284  /// unreadable via the API.
285  /// * Except for deleting the creating resource, all other attempts to
286  /// modify
287  /// the instance config are rejected.
288  ///
289  /// Upon completion of the returned operation:
290  ///
291  /// * Instances can be created using the instance configuration.
292  /// * The instance config's
293  /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
294  /// field becomes false. Its state becomes `READY`.
295  ///
296  /// The returned [long-running operation][google.longrunning.Operation] will
297  /// have a name of the format
298  /// `<instance_config_name>/operations/<operation_id>` and can be used to
299  /// track creation of the instance config. The
300  /// [metadata][google.longrunning.Operation.metadata] field type is
301  /// [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata].
302  /// The [response][google.longrunning.Operation.response] field type is
303  /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
304  /// successful.
305  ///
306  /// Authorization requires `spanner.instanceConfigs.create` permission on
307  /// the resource
308  /// [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent].
309  ///
310  /// @param request
311  /// @googleapis_link{google::spanner::admin::instance::v1::CreateInstanceConfigRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L720}
312  /// @param opts Optional. Override the class-level options, such as retry and
313  /// backoff policies.
314  /// @return
315  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
316  ///
317  /// [google.spanner.admin.instance.v1.CreateInstanceConfigRequest]:
318  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L720}
319  /// [google.spanner.admin.instance.v1.InstanceConfig]:
320  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
321  ///
322  future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
324  google::spanner::admin::instance::v1::CreateInstanceConfigRequest const&
325  request,
326  Options opts = {});
327 
328  ///
329  /// Updates an instance config. The returned
330  /// [long-running operation][google.longrunning.Operation] can be used to
331  /// track the progress of updating the instance. If the named instance config
332  /// does not exist, returns `NOT_FOUND`.
333  ///
334  /// Only user managed configurations can be updated.
335  ///
336  /// Immediately after the request returns:
337  ///
338  /// * The instance config's
339  /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
340  /// field is set to true.
341  ///
342  /// While the operation is pending:
343  ///
344  /// * Cancelling the operation sets its metadata's
345  /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time].
346  /// The operation is guaranteed to succeed at undoing all changes, after
347  /// which point it terminates with a `CANCELLED` status.
348  /// * All other attempts to modify the instance config are rejected.
349  /// * Reading the instance config via the API continues to give the
350  /// pre-request values.
351  ///
352  /// Upon completion of the returned operation:
353  ///
354  /// * Creating instances using the instance configuration uses the new
355  /// values.
356  /// * The instance config's new values are readable via the API.
357  /// * The instance config's
358  /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
359  /// field becomes false.
360  ///
361  /// The returned [long-running operation][google.longrunning.Operation] will
362  /// have a name of the format
363  /// `<instance_config_name>/operations/<operation_id>` and can be used to
364  /// track the instance config modification. The
365  /// [metadata][google.longrunning.Operation.metadata] field type is
366  /// [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata].
367  /// The [response][google.longrunning.Operation.response] field type is
368  /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
369  /// successful.
370  ///
371  /// Authorization requires `spanner.instanceConfigs.update` permission on
372  /// the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name].
373  ///
374  /// @param instance_config Required. The user instance config to update,
375  /// which must always include the
376  /// instance config name. Otherwise, only fields mentioned in
377  /// [update_mask][google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask]
378  /// need be included. To prevent conflicts of concurrent updates,
379  /// [etag][google.spanner.admin.instance.v1.InstanceConfig.reconciling] can
380  /// be used.
381  /// @param update_mask Required. A mask specifying which fields in
382  /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] should
383  /// be updated. The field mask must always be specified; this prevents any
384  /// future fields in
385  /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] from
386  /// being erased accidentally by clients that do not know about them. Only
387  /// display_name and labels can be updated.
388  /// @param opts Optional. Override the class-level options, such as retry and
389  /// backoff policies.
390  /// @return
391  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
392  ///
393  /// [google.spanner.admin.instance.v1.UpdateInstanceConfigRequest]:
394  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L750}
395  /// [google.spanner.admin.instance.v1.InstanceConfig]:
396  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
397  ///
398  future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
400  google::spanner::admin::instance::v1::InstanceConfig const&
401  instance_config,
402  google::protobuf::FieldMask const& update_mask, Options opts = {});
403 
404  ///
405  /// Updates an instance config. The returned
406  /// [long-running operation][google.longrunning.Operation] can be used to
407  /// track the progress of updating the instance. If the named instance config
408  /// does not exist, returns `NOT_FOUND`.
409  ///
410  /// Only user managed configurations can be updated.
411  ///
412  /// Immediately after the request returns:
413  ///
414  /// * The instance config's
415  /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
416  /// field is set to true.
417  ///
418  /// While the operation is pending:
419  ///
420  /// * Cancelling the operation sets its metadata's
421  /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time].
422  /// The operation is guaranteed to succeed at undoing all changes, after
423  /// which point it terminates with a `CANCELLED` status.
424  /// * All other attempts to modify the instance config are rejected.
425  /// * Reading the instance config via the API continues to give the
426  /// pre-request values.
427  ///
428  /// Upon completion of the returned operation:
429  ///
430  /// * Creating instances using the instance configuration uses the new
431  /// values.
432  /// * The instance config's new values are readable via the API.
433  /// * The instance config's
434  /// [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
435  /// field becomes false.
436  ///
437  /// The returned [long-running operation][google.longrunning.Operation] will
438  /// have a name of the format
439  /// `<instance_config_name>/operations/<operation_id>` and can be used to
440  /// track the instance config modification. The
441  /// [metadata][google.longrunning.Operation.metadata] field type is
442  /// [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata].
443  /// The [response][google.longrunning.Operation.response] field type is
444  /// [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
445  /// successful.
446  ///
447  /// Authorization requires `spanner.instanceConfigs.update` permission on
448  /// the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name].
449  ///
450  /// @param request
451  /// @googleapis_link{google::spanner::admin::instance::v1::UpdateInstanceConfigRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L750}
452  /// @param opts Optional. Override the class-level options, such as retry and
453  /// backoff policies.
454  /// @return
455  /// @googleapis_link{google::spanner::admin::instance::v1::InstanceConfig,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
456  ///
457  /// [google.spanner.admin.instance.v1.UpdateInstanceConfigRequest]:
458  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L750}
459  /// [google.spanner.admin.instance.v1.InstanceConfig]:
460  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L458}
461  ///
462  future<StatusOr<google::spanner::admin::instance::v1::InstanceConfig>>
464  google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const&
465  request,
466  Options opts = {});
467 
468  ///
469  /// Deletes the instance config. Deletion is only allowed when no
470  /// instances are using the configuration. If any instances are using
471  /// the config, returns `FAILED_PRECONDITION`.
472  ///
473  /// Only user managed configurations can be deleted.
474  ///
475  /// Authorization requires `spanner.instanceConfigs.delete` permission on
476  /// the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name].
477  ///
478  /// @param name Required. The name of the instance configuration to be
479  /// deleted.
480  /// Values are of the form
481  /// `projects/<project>/instanceConfigs/<instance_config>`
482  /// @param opts Optional. Override the class-level options, such as retry and
483  /// backoff policies.
484  ///
485  /// [google.spanner.admin.instance.v1.DeleteInstanceConfigRequest]:
486  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L775}
487  ///
488  Status DeleteInstanceConfig(std::string const& name, Options opts = {});
489 
490  ///
491  /// Deletes the instance config. Deletion is only allowed when no
492  /// instances are using the configuration. If any instances are using
493  /// the config, returns `FAILED_PRECONDITION`.
494  ///
495  /// Only user managed configurations can be deleted.
496  ///
497  /// Authorization requires `spanner.instanceConfigs.delete` permission on
498  /// the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name].
499  ///
500  /// @param request
501  /// @googleapis_link{google::spanner::admin::instance::v1::DeleteInstanceConfigRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L775}
502  /// @param opts Optional. Override the class-level options, such as retry and
503  /// backoff policies.
504  ///
505  /// [google.spanner.admin.instance.v1.DeleteInstanceConfigRequest]:
506  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L775}
507  ///
509  google::spanner::admin::instance::v1::DeleteInstanceConfigRequest const&
510  request,
511  Options opts = {});
512 
513  ///
514  /// Lists the user-managed instance config [long-running
515  /// operations][google.longrunning.Operation] in the given project. An
516  /// instance config operation has a name of the form
517  /// `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
518  /// The long-running operation
519  /// [metadata][google.longrunning.Operation.metadata] field type
520  /// `metadata.type_url` describes the type of the metadata. Operations
521  /// returned include those that have completed/failed/canceled within the last
522  /// 7 days, and pending operations. Operations returned are ordered by
523  /// `operation.metadata.value.start_time` in descending order starting
524  /// from the most recently started operation.
525  ///
526  /// @param parent Required. The project of the instance config operations.
527  /// Values are of the form `projects/<project>`.
528  /// @param opts Optional. Override the class-level options, such as retry and
529  /// backoff policies.
530  /// @return
531  /// @googleapis_link{google::longrunning::Operation,google/longrunning/operations.proto#L128}
532  ///
533  /// [google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest]:
534  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L802}
535  /// [google.longrunning.Operation]:
536  /// @googleapis_reference_link{google/longrunning/operations.proto#L128}
537  ///
538  StreamRange<google::longrunning::Operation> ListInstanceConfigOperations(
539  std::string const& parent, Options opts = {});
540 
541  ///
542  /// Lists the user-managed instance config [long-running
543  /// operations][google.longrunning.Operation] in the given project. An
544  /// instance config operation has a name of the form
545  /// `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
546  /// The long-running operation
547  /// [metadata][google.longrunning.Operation.metadata] field type
548  /// `metadata.type_url` describes the type of the metadata. Operations
549  /// returned include those that have completed/failed/canceled within the last
550  /// 7 days, and pending operations. Operations returned are ordered by
551  /// `operation.metadata.value.start_time` in descending order starting
552  /// from the most recently started operation.
553  ///
554  /// @param request
555  /// @googleapis_link{google::spanner::admin::instance::v1::ListInstanceConfigOperationsRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L802}
556  /// @param opts Optional. Override the class-level options, such as retry and
557  /// backoff policies.
558  /// @return
559  /// @googleapis_link{google::longrunning::Operation,google/longrunning/operations.proto#L128}
560  ///
561  /// [google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest]:
562  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L802}
563  /// [google.longrunning.Operation]:
564  /// @googleapis_reference_link{google/longrunning/operations.proto#L128}
565  ///
566  StreamRange<google::longrunning::Operation> ListInstanceConfigOperations(
567  google::spanner::admin::instance::v1::ListInstanceConfigOperationsRequest
568  request,
569  Options opts = {});
570 
571  ///
572  /// Lists all instances in the given project.
573  ///
574  /// @param parent Required. The name of the project for which a list of
575  /// instances is
576  /// requested. Values are of the form `projects/<project>`.
577  /// @param opts Optional. Override the class-level options, such as retry and
578  /// backoff policies.
579  /// @return
580  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
581  ///
582  /// [google.spanner.admin.instance.v1.ListInstancesRequest]:
583  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L928}
584  /// [google.spanner.admin.instance.v1.Instance]:
585  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
586  ///
587  StreamRange<google::spanner::admin::instance::v1::Instance> ListInstances(
588  std::string const& parent, Options opts = {});
589 
590  ///
591  /// Lists all instances in the given project.
592  ///
593  /// @param request
594  /// @googleapis_link{google::spanner::admin::instance::v1::ListInstancesRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L928}
595  /// @param opts Optional. Override the class-level options, such as retry and
596  /// backoff policies.
597  /// @return
598  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
599  ///
600  /// [google.spanner.admin.instance.v1.ListInstancesRequest]:
601  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L928}
602  /// [google.spanner.admin.instance.v1.Instance]:
603  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
604  ///
605  StreamRange<google::spanner::admin::instance::v1::Instance> ListInstances(
606  google::spanner::admin::instance::v1::ListInstancesRequest request,
607  Options opts = {});
608 
609  ///
610  /// Gets information about a particular instance.
611  ///
612  /// @param name Required. The name of the requested instance. Values are of
613  /// the form
614  /// `projects/<project>/instances/<instance>`.
615  /// @param opts Optional. Override the class-level options, such as retry and
616  /// backoff policies.
617  /// @return
618  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
619  ///
620  /// [google.spanner.admin.instance.v1.GetInstanceRequest]:
621  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L887}
622  /// [google.spanner.admin.instance.v1.Instance]:
623  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
624  ///
625  StatusOr<google::spanner::admin::instance::v1::Instance> GetInstance(
626  std::string const& name, Options opts = {});
627 
628  ///
629  /// Gets information about a particular instance.
630  ///
631  /// @param request
632  /// @googleapis_link{google::spanner::admin::instance::v1::GetInstanceRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L887}
633  /// @param opts Optional. Override the class-level options, such as retry and
634  /// backoff policies.
635  /// @return
636  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
637  ///
638  /// [google.spanner.admin.instance.v1.GetInstanceRequest]:
639  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L887}
640  /// [google.spanner.admin.instance.v1.Instance]:
641  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
642  ///
643  StatusOr<google::spanner::admin::instance::v1::Instance> GetInstance(
644  google::spanner::admin::instance::v1::GetInstanceRequest const& request,
645  Options opts = {});
646 
647  ///
648  /// Creates an instance and begins preparing it to begin serving. The
649  /// returned [long-running operation][google.longrunning.Operation]
650  /// can be used to track the progress of preparing the new
651  /// instance. The instance name is assigned by the caller. If the
652  /// named instance already exists, `CreateInstance` returns
653  /// `ALREADY_EXISTS`.
654  ///
655  /// Immediately upon completion of this request:
656  ///
657  /// * The instance is readable via the API, with all requested attributes
658  /// but no allocated resources. Its state is `CREATING`.
659  ///
660  /// Until completion of the returned operation:
661  ///
662  /// * Cancelling the operation renders the instance immediately unreadable
663  /// via the API.
664  /// * The instance can be deleted.
665  /// * All other attempts to modify the instance are rejected.
666  ///
667  /// Upon completion of the returned operation:
668  ///
669  /// * Billing for all successfully-allocated resources begins (some types
670  /// may have lower than the requested levels).
671  /// * Databases can be created in the instance.
672  /// * The instance's allocated resource levels are readable via the API.
673  /// * The instance's state becomes `READY`.
674  ///
675  /// The returned [long-running operation][google.longrunning.Operation] will
676  /// have a name of the format `<instance_name>/operations/<operation_id>` and
677  /// can be used to track creation of the instance. The
678  /// [metadata][google.longrunning.Operation.metadata] field type is
679  /// [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
680  /// The [response][google.longrunning.Operation.response] field type is
681  /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
682  ///
683  /// @param parent Required. The name of the project in which to create the
684  /// instance. Values
685  /// are of the form `projects/<project>`.
686  /// @param instance_id Required. The ID of the instance to create. Valid
687  /// identifiers are of the
688  /// form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in
689  /// length.
690  /// @param instance Required. The instance to create. The name may be
691  /// omitted, but if
692  /// specified must be `<parent>/instances/<instance_id>`.
693  /// @param opts Optional. Override the class-level options, such as retry and
694  /// backoff policies.
695  /// @return
696  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
697  ///
698  /// [google.spanner.admin.instance.v1.CreateInstanceRequest]:
699  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L906}
700  /// [google.spanner.admin.instance.v1.Instance]:
701  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
702  ///
703  future<StatusOr<google::spanner::admin::instance::v1::Instance>>
704  CreateInstance(std::string const& parent, std::string const& instance_id,
705  google::spanner::admin::instance::v1::Instance const& instance,
706  Options opts = {});
707 
708  ///
709  /// Creates an instance and begins preparing it to begin serving. The
710  /// returned [long-running operation][google.longrunning.Operation]
711  /// can be used to track the progress of preparing the new
712  /// instance. The instance name is assigned by the caller. If the
713  /// named instance already exists, `CreateInstance` returns
714  /// `ALREADY_EXISTS`.
715  ///
716  /// Immediately upon completion of this request:
717  ///
718  /// * The instance is readable via the API, with all requested attributes
719  /// but no allocated resources. Its state is `CREATING`.
720  ///
721  /// Until completion of the returned operation:
722  ///
723  /// * Cancelling the operation renders the instance immediately unreadable
724  /// via the API.
725  /// * The instance can be deleted.
726  /// * All other attempts to modify the instance are rejected.
727  ///
728  /// Upon completion of the returned operation:
729  ///
730  /// * Billing for all successfully-allocated resources begins (some types
731  /// may have lower than the requested levels).
732  /// * Databases can be created in the instance.
733  /// * The instance's allocated resource levels are readable via the API.
734  /// * The instance's state becomes `READY`.
735  ///
736  /// The returned [long-running operation][google.longrunning.Operation] will
737  /// have a name of the format `<instance_name>/operations/<operation_id>` and
738  /// can be used to track creation of the instance. The
739  /// [metadata][google.longrunning.Operation.metadata] field type is
740  /// [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
741  /// The [response][google.longrunning.Operation.response] field type is
742  /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
743  ///
744  /// @param request
745  /// @googleapis_link{google::spanner::admin::instance::v1::CreateInstanceRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L906}
746  /// @param opts Optional. Override the class-level options, such as retry and
747  /// backoff policies.
748  /// @return
749  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
750  ///
751  /// [google.spanner.admin.instance.v1.CreateInstanceRequest]:
752  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L906}
753  /// [google.spanner.admin.instance.v1.Instance]:
754  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
755  ///
756  future<StatusOr<google::spanner::admin::instance::v1::Instance>>
758  google::spanner::admin::instance::v1::CreateInstanceRequest const&
759  request,
760  Options opts = {});
761 
762  ///
763  /// Updates an instance, and begins allocating or releasing resources
764  /// as requested. The returned [long-running
765  /// operation][google.longrunning.Operation] can be used to track the
766  /// progress of updating the instance. If the named instance does not
767  /// exist, returns `NOT_FOUND`.
768  ///
769  /// Immediately upon completion of this request:
770  ///
771  /// * For resource types for which a decrease in the instance's allocation
772  /// has been requested, billing is based on the newly-requested level.
773  ///
774  /// Until completion of the returned operation:
775  ///
776  /// * Cancelling the operation sets its metadata's
777  /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time],
778  /// and begins restoring resources to their pre-request values. The
779  /// operation is guaranteed to succeed at undoing all resource changes,
780  /// after which point it terminates with a `CANCELLED` status.
781  /// * All other attempts to modify the instance are rejected.
782  /// * Reading the instance via the API continues to give the pre-request
783  /// resource levels.
784  ///
785  /// Upon completion of the returned operation:
786  ///
787  /// * Billing begins for all successfully-allocated resources (some types
788  /// may have lower than the requested levels).
789  /// * All newly-reserved resources are available for serving the instance's
790  /// tables.
791  /// * The instance's new resource levels are readable via the API.
792  ///
793  /// The returned [long-running operation][google.longrunning.Operation] will
794  /// have a name of the format `<instance_name>/operations/<operation_id>` and
795  /// can be used to track the instance modification. The
796  /// [metadata][google.longrunning.Operation.metadata] field type is
797  /// [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
798  /// The [response][google.longrunning.Operation.response] field type is
799  /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
800  ///
801  /// Authorization requires `spanner.instances.update` permission on
802  /// the resource [name][google.spanner.admin.instance.v1.Instance.name].
803  ///
804  /// @param instance Required. The instance to update, which must always
805  /// include the instance
806  /// name. Otherwise, only fields mentioned in
807  /// [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask]
808  /// need be included.
809  /// @param field_mask Required. A mask specifying which fields in
810  /// [Instance][google.spanner.admin.instance.v1.Instance] should be updated.
811  /// The field mask must always be specified; this prevents any future fields
812  /// in [Instance][google.spanner.admin.instance.v1.Instance] from being
813  /// erased accidentally by clients that do not know about them.
814  /// @param opts Optional. Override the class-level options, such as retry and
815  /// backoff policies.
816  /// @return
817  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
818  ///
819  /// [google.spanner.admin.instance.v1.UpdateInstanceRequest]:
820  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L984}
821  /// [google.spanner.admin.instance.v1.Instance]:
822  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
823  ///
824  future<StatusOr<google::spanner::admin::instance::v1::Instance>>
825  UpdateInstance(google::spanner::admin::instance::v1::Instance const& instance,
826  google::protobuf::FieldMask const& field_mask,
827  Options opts = {});
828 
829  ///
830  /// Updates an instance, and begins allocating or releasing resources
831  /// as requested. The returned [long-running
832  /// operation][google.longrunning.Operation] can be used to track the
833  /// progress of updating the instance. If the named instance does not
834  /// exist, returns `NOT_FOUND`.
835  ///
836  /// Immediately upon completion of this request:
837  ///
838  /// * For resource types for which a decrease in the instance's allocation
839  /// has been requested, billing is based on the newly-requested level.
840  ///
841  /// Until completion of the returned operation:
842  ///
843  /// * Cancelling the operation sets its metadata's
844  /// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time],
845  /// and begins restoring resources to their pre-request values. The
846  /// operation is guaranteed to succeed at undoing all resource changes,
847  /// after which point it terminates with a `CANCELLED` status.
848  /// * All other attempts to modify the instance are rejected.
849  /// * Reading the instance via the API continues to give the pre-request
850  /// resource levels.
851  ///
852  /// Upon completion of the returned operation:
853  ///
854  /// * Billing begins for all successfully-allocated resources (some types
855  /// may have lower than the requested levels).
856  /// * All newly-reserved resources are available for serving the instance's
857  /// tables.
858  /// * The instance's new resource levels are readable via the API.
859  ///
860  /// The returned [long-running operation][google.longrunning.Operation] will
861  /// have a name of the format `<instance_name>/operations/<operation_id>` and
862  /// can be used to track the instance modification. The
863  /// [metadata][google.longrunning.Operation.metadata] field type is
864  /// [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
865  /// The [response][google.longrunning.Operation.response] field type is
866  /// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
867  ///
868  /// Authorization requires `spanner.instances.update` permission on
869  /// the resource [name][google.spanner.admin.instance.v1.Instance.name].
870  ///
871  /// @param request
872  /// @googleapis_link{google::spanner::admin::instance::v1::UpdateInstanceRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L984}
873  /// @param opts Optional. Override the class-level options, such as retry and
874  /// backoff policies.
875  /// @return
876  /// @googleapis_link{google::spanner::admin::instance::v1::Instance,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
877  ///
878  /// [google.spanner.admin.instance.v1.UpdateInstanceRequest]:
879  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L984}
880  /// [google.spanner.admin.instance.v1.Instance]:
881  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L566}
882  ///
883  future<StatusOr<google::spanner::admin::instance::v1::Instance>>
885  google::spanner::admin::instance::v1::UpdateInstanceRequest const&
886  request,
887  Options opts = {});
888 
889  ///
890  /// Deletes an instance.
891  ///
892  /// Immediately upon completion of the request:
893  ///
894  /// * Billing ceases for all of the instance's reserved resources.
895  ///
896  /// Soon afterward:
897  ///
898  /// * The instance and *all of its databases* immediately and
899  /// irrevocably disappear from the API. All data in the databases
900  /// is permanently deleted.
901  ///
902  /// @param name Required. The name of the instance to be deleted. Values are
903  /// of the form
904  /// `projects/<project>/instances/<instance>`
905  /// @param opts Optional. Override the class-level options, such as retry and
906  /// backoff policies.
907  ///
908  /// [google.spanner.admin.instance.v1.DeleteInstanceRequest]:
909  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1002}
910  ///
911  Status DeleteInstance(std::string const& name, Options opts = {});
912 
913  ///
914  /// Deletes an instance.
915  ///
916  /// Immediately upon completion of the request:
917  ///
918  /// * Billing ceases for all of the instance's reserved resources.
919  ///
920  /// Soon afterward:
921  ///
922  /// * The instance and *all of its databases* immediately and
923  /// irrevocably disappear from the API. All data in the databases
924  /// is permanently deleted.
925  ///
926  /// @param request
927  /// @googleapis_link{google::spanner::admin::instance::v1::DeleteInstanceRequest,google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1002}
928  /// @param opts Optional. Override the class-level options, such as retry and
929  /// backoff policies.
930  ///
931  /// [google.spanner.admin.instance.v1.DeleteInstanceRequest]:
932  /// @googleapis_reference_link{google/spanner/admin/instance/v1/spanner_instance_admin.proto#L1002}
933  ///
935  google::spanner::admin::instance::v1::DeleteInstanceRequest const&
936  request,
937  Options opts = {});
938 
939  ///
940  /// Sets the access control policy on an instance resource. Replaces any
941  /// existing policy.
942  ///
943  /// Authorization requires `spanner.instances.setIamPolicy` on
944  /// [resource][google.iam.v1.SetIamPolicyRequest.resource].
945  ///
946  /// @param resource REQUIRED: The resource for which the policy is being
947  /// specified.
948  /// See the operation documentation for the appropriate value for this field.
949  /// @param policy REQUIRED: The complete policy to be applied to the
950  /// `resource`. The size of
951  /// the policy is limited to a few 10s of KB. An empty policy is a
952  /// valid policy but certain Cloud Platform services (such as Projects)
953  /// might reject them.
954  /// @param opts Optional. Override the class-level options, such as retry and
955  /// backoff policies.
956  /// @return
957  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
958  ///
959  /// [google.iam.v1.SetIamPolicyRequest]:
960  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
961  /// [google.iam.v1.Policy]:
962  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
963  ///
964  StatusOr<google::iam::v1::Policy> SetIamPolicy(
965  std::string const& resource, google::iam::v1::Policy const& policy,
966  Options opts = {});
967 
968  /**
969  * Updates the IAM policy for @p resource using an optimistic concurrency
970  * control loop.
971  *
972  * The loop fetches the current policy for @p resource, and passes it to @p
973  * updater, which should return the new policy. This new policy should use the
974  * current etag so that the read-modify-write cycle can detect races and rerun
975  * the update when there is a mismatch. If the new policy does not have an
976  * etag, the existing policy will be blindly overwritten. If @p updater does
977  * not yield a policy, the control loop is terminated and kCancelled is
978  * returned.
979  *
980  * @param resource Required. The resource for which the policy is being
981  * specified. See the operation documentation for the appropriate value for
982  * this field.
983  * @param updater Required. Functor to map the current policy to a new one.
984  * @param opts Optional. Override the class-level options, such as retry and
985  * backoff policies.
986  * @return google::iam::v1::Policy
987  */
988  StatusOr<google::iam::v1::Policy> SetIamPolicy(std::string const& resource,
989  IamUpdater const& updater,
990  Options opts = {});
991 
992  ///
993  /// Sets the access control policy on an instance resource. Replaces any
994  /// existing policy.
995  ///
996  /// Authorization requires `spanner.instances.setIamPolicy` on
997  /// [resource][google.iam.v1.SetIamPolicyRequest.resource].
998  ///
999  /// @param request
1000  /// @googleapis_link{google::iam::v1::SetIamPolicyRequest,google/iam/v1/iam_policy.proto#L101}
1001  /// @param opts Optional. Override the class-level options, such as retry and
1002  /// backoff policies.
1003  /// @return
1004  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
1005  ///
1006  /// [google.iam.v1.SetIamPolicyRequest]:
1007  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
1008  /// [google.iam.v1.Policy]:
1009  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
1010  ///
1011  StatusOr<google::iam::v1::Policy> SetIamPolicy(
1012  google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
1013 
1014  ///
1015  /// Gets the access control policy for an instance resource. Returns an empty
1016  /// policy if an instance exists but does not have a policy set.
1017  ///
1018  /// Authorization requires `spanner.instances.getIamPolicy` on
1019  /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
1020  ///
1021  /// @param resource REQUIRED: The resource for which the policy is being
1022  /// requested.
1023  /// See the operation documentation for the appropriate value for this field.
1024  /// @param opts Optional. Override the class-level options, such as retry and
1025  /// backoff policies.
1026  /// @return
1027  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
1028  ///
1029  /// [google.iam.v1.GetIamPolicyRequest]:
1030  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
1031  /// [google.iam.v1.Policy]:
1032  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
1033  ///
1034  StatusOr<google::iam::v1::Policy> GetIamPolicy(std::string const& resource,
1035  Options opts = {});
1036 
1037  ///
1038  /// Gets the access control policy for an instance resource. Returns an empty
1039  /// policy if an instance exists but does not have a policy set.
1040  ///
1041  /// Authorization requires `spanner.instances.getIamPolicy` on
1042  /// [resource][google.iam.v1.GetIamPolicyRequest.resource].
1043  ///
1044  /// @param request
1045  /// @googleapis_link{google::iam::v1::GetIamPolicyRequest,google/iam/v1/iam_policy.proto#L123}
1046  /// @param opts Optional. Override the class-level options, such as retry and
1047  /// backoff policies.
1048  /// @return
1049  /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L96}
1050  ///
1051  /// [google.iam.v1.GetIamPolicyRequest]:
1052  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
1053  /// [google.iam.v1.Policy]:
1054  /// @googleapis_reference_link{google/iam/v1/policy.proto#L96}
1055  ///
1056  StatusOr<google::iam::v1::Policy> GetIamPolicy(
1057  google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
1058 
1059  ///
1060  /// Returns permissions that the caller has on the specified instance
1061  /// resource.
1062  ///
1063  /// Attempting this RPC on a non-existent Cloud Spanner instance resource will
1064  /// result in a NOT_FOUND error if the user has `spanner.instances.list`
1065  /// permission on the containing Google Cloud Project. Otherwise returns an
1066  /// empty set of permissions.
1067  ///
1068  /// @param resource REQUIRED: The resource for which the policy detail is
1069  /// being requested.
1070  /// See the operation documentation for the appropriate value for this field.
1071  /// @param permissions The set of permissions to check for the `resource`.
1072  /// Permissions with
1073  /// wildcards (such as '*' or 'storage.*') are not allowed. For more
1074  /// information see
1075  /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1076  /// @param opts Optional. Override the class-level options, such as retry and
1077  /// backoff policies.
1078  /// @return
1079  /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
1080  ///
1081  /// [google.iam.v1.TestIamPermissionsRequest]:
1082  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
1083  /// [google.iam.v1.TestIamPermissionsResponse]:
1084  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
1085  ///
1086  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
1087  std::string const& resource, std::vector<std::string> const& permissions,
1088  Options opts = {});
1089 
1090  ///
1091  /// Returns permissions that the caller has on the specified instance
1092  /// resource.
1093  ///
1094  /// Attempting this RPC on a non-existent Cloud Spanner instance resource will
1095  /// result in a NOT_FOUND error if the user has `spanner.instances.list`
1096  /// permission on the containing Google Cloud Project. Otherwise returns an
1097  /// empty set of permissions.
1098  ///
1099  /// @param request
1100  /// @googleapis_link{google::iam::v1::TestIamPermissionsRequest,google/iam/v1/iam_policy.proto#L136}
1101  /// @param opts Optional. Override the class-level options, such as retry and
1102  /// backoff policies.
1103  /// @return
1104  /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
1105  ///
1106  /// [google.iam.v1.TestIamPermissionsRequest]:
1107  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
1108  /// [google.iam.v1.TestIamPermissionsResponse]:
1109  /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
1110  ///
1111  StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
1112  google::iam::v1::TestIamPermissionsRequest const& request,
1113  Options opts = {});
1114 
1115  private:
1116  std::shared_ptr<InstanceAdminConnection> connection_;
1117  Options options_;
1118 };
1119 
1121 namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
1122 } // namespace spanner_admin
1123 } // namespace cloud
1124 } // namespace google
1125 
1126 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INSTANCE_ADMIN_CLIENT_H