19 #include "google/cloud/spanner/admin/instance_admin_client.h"
20 #include "google/cloud/spanner/admin/instance_admin_options.h"
21 #include "google/cloud/spanner/admin/internal/instance_admin_option_defaults.h"
32 : connection_(std::move(connection)) {}
35 StreamRange<
google::spanner::admin::instance::v1::InstanceConfig>
37 google::spanner::admin::instance::v1::ListInstanceConfigsRequest request;
38 request.set_parent(parent);
42 StatusOr<
google::spanner::admin::instance::v1::InstanceConfig>
44 google::spanner::admin::instance::v1::GetInstanceConfigRequest request;
45 request.set_name(name);
49 StreamRange<
google::spanner::admin::instance::v1::Instance>
51 google::spanner::admin::instance::v1::ListInstancesRequest request;
52 request.set_parent(parent);
56 StatusOr<
google::spanner::admin::instance::v1::Instance>
58 google::spanner::admin::instance::v1::GetInstanceRequest request;
59 request.set_name(name);
63 future<StatusOr<
google::spanner::admin::instance::v1::Instance>>
65 std::string
const& parent, std::string
const& instance_id,
66 google::spanner::admin::instance::v1::Instance
const& instance) {
67 google::spanner::admin::instance::v1::CreateInstanceRequest request;
68 request.set_parent(parent);
69 request.set_instance_id(instance_id);
70 *request.mutable_instance() = instance;
74 future<StatusOr<
google::spanner::admin::instance::v1::Instance>>
76 google::spanner::admin::instance::v1::Instance
const& instance,
77 google::protobuf::FieldMask
const& field_mask) {
78 google::spanner::admin::instance::v1::UpdateInstanceRequest request;
79 *request.mutable_instance() = instance;
80 *request.mutable_field_mask() = field_mask;
85 google::spanner::admin::instance::v1::DeleteInstanceRequest request;
86 request.set_name(name);
91 std::string
const& resource,
google::iam::v1::Policy
const& policy) {
92 google::iam::v1::SetIamPolicyRequest request;
93 request.set_resource(resource);
94 *request.mutable_policy() = policy;
99 std::string
const& resource, IamUpdater
const& updater,
Options options) {
104 auto backoff_policy =
111 auto policy = updater(
*std::move(recent));
119 std::this_thread::sleep_for(backoff_policy->OnCompletion());
124 std::string
const& resource) {
125 google::iam::v1::GetIamPolicyRequest request;
126 request.set_resource(resource);
130 StatusOr<
google::iam::v1::TestIamPermissionsResponse>
132 std::string
const& resource, std::vector<std::string>
const& permissions) {
133 google::iam::v1::TestIamPermissionsRequest request;
134 request.set_resource(resource);
135 *request.mutable_permissions() = {permissions.begin(), permissions.end()};
139 StreamRange<
google::spanner::admin::instance::v1::InstanceConfig>
141 google::spanner::admin::instance::v1::ListInstanceConfigsRequest request) {
145 StatusOr<
google::spanner::admin::instance::v1::InstanceConfig>
147 google::spanner::admin::instance::v1::GetInstanceConfigRequest
const&
152 StreamRange<
google::spanner::admin::instance::v1::Instance>
154 google::spanner::admin::instance::v1::ListInstancesRequest request) {
158 StatusOr<
google::spanner::admin::instance::v1::Instance>
160 google::spanner::admin::instance::v1::GetInstanceRequest
const& request) {
164 future<StatusOr<
google::spanner::admin::instance::v1::Instance>>
166 google::spanner::admin::instance::v1::CreateInstanceRequest
const&
171 future<StatusOr<
google::spanner::admin::instance::v1::Instance>>
173 google::spanner::admin::instance::v1::UpdateInstanceRequest
const&
179 google::spanner::admin::instance::v1::DeleteInstanceRequest
const&
185 google::iam::v1::SetIamPolicyRequest
const& request) {
190 google::iam::v1::GetIamPolicyRequest
const& request) {
194 StatusOr<
google::iam::v1::TestIamPermissionsResponse>
196 google::iam::v1::TestIamPermissionsRequest
const& request) {