19 #include "google/cloud/spanner/admin/database_admin_connection_idempotency_policy.h"
20 #include "absl/memory/memory.h"
34 class DefaultDatabaseAdminConnectionIdempotencyPolicy
37 ~DefaultDatabaseAdminConnectionIdempotencyPolicy()
override =
default;
42 return absl::make_unique<DefaultDatabaseAdminConnectionIdempotencyPolicy>(
46 Idempotency ListDatabases(
47 google::spanner::admin::database::v1::ListDatabasesRequest)
override {
48 return Idempotency::kIdempotent;
51 Idempotency CreateDatabase(
52 google::spanner::admin::database::v1::CreateDatabaseRequest
const&)
54 return Idempotency::kNonIdempotent;
57 Idempotency GetDatabase(
58 google::spanner::admin::database::v1::GetDatabaseRequest
const&)
60 return Idempotency::kIdempotent;
63 Idempotency UpdateDatabaseDdl(
64 google::spanner::admin::database::v1::UpdateDatabaseDdlRequest
const&)
66 return Idempotency::kNonIdempotent;
69 Idempotency DropDatabase(
70 google::spanner::admin::database::v1::DropDatabaseRequest
const&)
72 return Idempotency::kNonIdempotent;
75 Idempotency GetDatabaseDdl(
76 google::spanner::admin::database::v1::GetDatabaseDdlRequest
const&)
78 return Idempotency::kIdempotent;
81 Idempotency SetIamPolicy(
82 google::iam::v1::SetIamPolicyRequest
const&)
override {
83 return Idempotency::kNonIdempotent;
86 Idempotency GetIamPolicy(
87 google::iam::v1::GetIamPolicyRequest
const&)
override {
88 return Idempotency::kNonIdempotent;
91 Idempotency TestIamPermissions(
92 google::iam::v1::TestIamPermissionsRequest
const&)
override {
93 return Idempotency::kNonIdempotent;
96 Idempotency CreateBackup(
97 google::spanner::admin::database::v1::CreateBackupRequest
const&)
99 return Idempotency::kNonIdempotent;
102 Idempotency GetBackup(
103 google::spanner::admin::database::v1::GetBackupRequest
const&)
override {
104 return Idempotency::kIdempotent;
107 Idempotency UpdateBackup(
108 google::spanner::admin::database::v1::UpdateBackupRequest
const&)
110 return Idempotency::kNonIdempotent;
113 Idempotency DeleteBackup(
114 google::spanner::admin::database::v1::DeleteBackupRequest
const&)
116 return Idempotency::kNonIdempotent;
119 Idempotency ListBackups(
120 google::spanner::admin::database::v1::ListBackupsRequest)
override {
121 return Idempotency::kIdempotent;
124 Idempotency RestoreDatabase(
125 google::spanner::admin::database::v1::RestoreDatabaseRequest
const&)
127 return Idempotency::kNonIdempotent;
130 Idempotency ListDatabaseOperations(
131 google::spanner::admin::database::v1::ListDatabaseOperationsRequest)
133 return Idempotency::kIdempotent;
136 Idempotency ListBackupOperations(
137 google::spanner::admin::database::v1::ListBackupOperationsRequest)
139 return Idempotency::kIdempotent;
146 return absl::make_unique<DefaultDatabaseAdminConnectionIdempotencyPolicy>();