Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
instance_admin_connection_idempotency_policy.cc
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 #include "google/cloud/spanner/admin/instance_admin_connection_idempotency_policy.h"
20 #include "absl/memory/memory.h"
21 #include <memory>
22 
23 namespace google {
24 namespace cloud {
25 namespace spanner_admin {
26 inline namespace GOOGLE_CLOUD_CPP_GENERATED_NS {
27 
28 using ::google::cloud::internal::Idempotency;
29 
32 
33 namespace {
34 class DefaultInstanceAdminConnectionIdempotencyPolicy
36  public:
37  ~DefaultInstanceAdminConnectionIdempotencyPolicy() override = default;
38 
39  /// Create a new copy of this object.
40  std::unique_ptr<InstanceAdminConnectionIdempotencyPolicy> clone()
41  const override {
42  return absl::make_unique<DefaultInstanceAdminConnectionIdempotencyPolicy>(
43  *this);
44  }
45 
46  Idempotency ListInstanceConfigs(
47  google::spanner::admin::instance::v1::ListInstanceConfigsRequest)
48  override {
49  return Idempotency::kIdempotent;
50  }
51 
52  Idempotency GetInstanceConfig(
53  google::spanner::admin::instance::v1::GetInstanceConfigRequest const&)
54  override {
55  return Idempotency::kIdempotent;
56  }
57 
58  Idempotency ListInstances(
59  google::spanner::admin::instance::v1::ListInstancesRequest) override {
60  return Idempotency::kIdempotent;
61  }
62 
63  Idempotency GetInstance(
64  google::spanner::admin::instance::v1::GetInstanceRequest const&)
65  override {
66  return Idempotency::kIdempotent;
67  }
68 
69  Idempotency CreateInstance(
70  google::spanner::admin::instance::v1::CreateInstanceRequest const&)
71  override {
72  return Idempotency::kNonIdempotent;
73  }
74 
75  Idempotency UpdateInstance(
76  google::spanner::admin::instance::v1::UpdateInstanceRequest const&)
77  override {
78  return Idempotency::kNonIdempotent;
79  }
80 
81  Idempotency DeleteInstance(
82  google::spanner::admin::instance::v1::DeleteInstanceRequest const&)
83  override {
84  return Idempotency::kNonIdempotent;
85  }
86 
87  Idempotency SetIamPolicy(
88  google::iam::v1::SetIamPolicyRequest const&) override {
89  return Idempotency::kNonIdempotent;
90  }
91 
92  Idempotency GetIamPolicy(
93  google::iam::v1::GetIamPolicyRequest const&) override {
94  return Idempotency::kNonIdempotent;
95  }
96 
97  Idempotency TestIamPermissions(
98  google::iam::v1::TestIamPermissionsRequest const&) override {
99  return Idempotency::kNonIdempotent;
100  }
101 };
102 } // namespace
103 
106  return absl::make_unique<DefaultInstanceAdminConnectionIdempotencyPolicy>();
107 }
108 
109 } // namespace GOOGLE_CLOUD_CPP_GENERATED_NS
110 } // namespace spanner_admin
111 } // namespace cloud
112 } // namespace google