Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
database_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/database/v1/spanner_database_admin.proto
18 
19 #include "google/cloud/spanner/admin/database_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 DefaultDatabaseAdminConnectionIdempotencyPolicy
36  public:
37  ~DefaultDatabaseAdminConnectionIdempotencyPolicy() override = default;
38 
39  /// Create a new copy of this object.
40  std::unique_ptr<DatabaseAdminConnectionIdempotencyPolicy> clone()
41  const override {
42  return absl::make_unique<DefaultDatabaseAdminConnectionIdempotencyPolicy>(
43  *this);
44  }
45 
46  Idempotency ListDatabases(
47  google::spanner::admin::database::v1::ListDatabasesRequest) override {
48  return Idempotency::kIdempotent;
49  }
50 
51  Idempotency CreateDatabase(
52  google::spanner::admin::database::v1::CreateDatabaseRequest const&)
53  override {
54  return Idempotency::kNonIdempotent;
55  }
56 
57  Idempotency GetDatabase(
58  google::spanner::admin::database::v1::GetDatabaseRequest const&)
59  override {
60  return Idempotency::kIdempotent;
61  }
62 
63  Idempotency UpdateDatabaseDdl(
64  google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&)
65  override {
66  return Idempotency::kNonIdempotent;
67  }
68 
69  Idempotency DropDatabase(
70  google::spanner::admin::database::v1::DropDatabaseRequest const&)
71  override {
72  return Idempotency::kNonIdempotent;
73  }
74 
75  Idempotency GetDatabaseDdl(
76  google::spanner::admin::database::v1::GetDatabaseDdlRequest const&)
77  override {
78  return Idempotency::kIdempotent;
79  }
80 
81  Idempotency SetIamPolicy(
82  google::iam::v1::SetIamPolicyRequest const&) override {
83  return Idempotency::kNonIdempotent;
84  }
85 
86  Idempotency GetIamPolicy(
87  google::iam::v1::GetIamPolicyRequest const&) override {
88  return Idempotency::kNonIdempotent;
89  }
90 
91  Idempotency TestIamPermissions(
92  google::iam::v1::TestIamPermissionsRequest const&) override {
93  return Idempotency::kNonIdempotent;
94  }
95 
96  Idempotency CreateBackup(
97  google::spanner::admin::database::v1::CreateBackupRequest const&)
98  override {
99  return Idempotency::kNonIdempotent;
100  }
101 
102  Idempotency GetBackup(
103  google::spanner::admin::database::v1::GetBackupRequest const&) override {
104  return Idempotency::kIdempotent;
105  }
106 
107  Idempotency UpdateBackup(
108  google::spanner::admin::database::v1::UpdateBackupRequest const&)
109  override {
110  return Idempotency::kNonIdempotent;
111  }
112 
113  Idempotency DeleteBackup(
114  google::spanner::admin::database::v1::DeleteBackupRequest const&)
115  override {
116  return Idempotency::kNonIdempotent;
117  }
118 
119  Idempotency ListBackups(
120  google::spanner::admin::database::v1::ListBackupsRequest) override {
121  return Idempotency::kIdempotent;
122  }
123 
124  Idempotency RestoreDatabase(
125  google::spanner::admin::database::v1::RestoreDatabaseRequest const&)
126  override {
127  return Idempotency::kNonIdempotent;
128  }
129 
130  Idempotency ListDatabaseOperations(
131  google::spanner::admin::database::v1::ListDatabaseOperationsRequest)
132  override {
133  return Idempotency::kIdempotent;
134  }
135 
136  Idempotency ListBackupOperations(
137  google::spanner::admin::database::v1::ListBackupOperationsRequest)
138  override {
139  return Idempotency::kIdempotent;
140  }
141 };
142 } // namespace
143 
146  return absl::make_unique<DefaultDatabaseAdminConnectionIdempotencyPolicy>();
147 }
148 
149 } // namespace GOOGLE_CLOUD_CPP_GENERATED_NS
150 } // namespace spanner_admin
151 } // namespace cloud
152 } // namespace google