gcp_sdk_secretmanager_v1/traits/mod.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use gax::error::Error;
pub(crate) mod dyntraits;
/// Secret Manager Service
///
/// Manages secrets and operations using those secrets. Implements a REST
/// model with the following objects:
///
/// * [Secret][google.cloud.secretmanager.v1.Secret]
/// * [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]
///
/// [google.cloud.secretmanager.v1.Secret]: crate::model::Secret
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
///
/// # Mocking
///
/// Application developers may use this trait to mock the secretmanager clients.
///
/// Services gain new RPCs routinely. Consequently, this trait gains new methods
/// too. To avoid breaking applications the trait provides a default
/// implementation for each method. These implementations return an error.
pub trait SecretManagerService: std::fmt::Debug + Send + Sync {
/// Lists [Secrets][google.cloud.secretmanager.v1.Secret].
///
/// [google.cloud.secretmanager.v1.Secret]: crate::model::Secret
fn list_secrets(
&self,
_req: crate::model::ListSecretsRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::ListSecretsResponse>> + Send
{
std::future::ready::<crate::Result<crate::model::ListSecretsResponse>>(Err(Error::other(
"unimplemented",
)))
}
/// Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no
/// [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
///
/// [google.cloud.secretmanager.v1.Secret]: crate::model::Secret
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
fn create_secret(
&self,
_req: crate::model::CreateSecretRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::Secret>> + Send {
std::future::ready::<crate::Result<crate::model::Secret>>(Err(Error::other(
"unimplemented",
)))
}
/// Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]
/// containing secret data and attaches it to an existing
/// [Secret][google.cloud.secretmanager.v1.Secret].
///
/// [google.cloud.secretmanager.v1.Secret]: crate::model::Secret
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
fn add_secret_version(
&self,
_req: crate::model::AddSecretVersionRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::SecretVersion>> + Send {
std::future::ready::<crate::Result<crate::model::SecretVersion>>(Err(Error::other(
"unimplemented",
)))
}
/// Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].
///
/// [google.cloud.secretmanager.v1.Secret]: crate::model::Secret
fn get_secret(
&self,
_req: crate::model::GetSecretRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::Secret>> + Send {
std::future::ready::<crate::Result<crate::model::Secret>>(Err(Error::other(
"unimplemented",
)))
}
/// Updates metadata of an existing
/// [Secret][google.cloud.secretmanager.v1.Secret].
///
/// [google.cloud.secretmanager.v1.Secret]: crate::model::Secret
fn update_secret(
&self,
_req: crate::model::UpdateSecretRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::Secret>> + Send {
std::future::ready::<crate::Result<crate::model::Secret>>(Err(Error::other(
"unimplemented",
)))
}
/// Deletes a [Secret][google.cloud.secretmanager.v1.Secret].
///
/// [google.cloud.secretmanager.v1.Secret]: crate::model::Secret
fn delete_secret(
&self,
_req: crate::model::DeleteSecretRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<wkt::Empty>> + Send {
std::future::ready::<crate::Result<wkt::Empty>>(Err(Error::other("unimplemented")))
}
/// Lists [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. This
/// call does not return secret data.
///
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
fn list_secret_versions(
&self,
_req: crate::model::ListSecretVersionsRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::ListSecretVersionsResponse>> + Send
{
std::future::ready::<crate::Result<crate::model::ListSecretVersionsResponse>>(Err(
Error::other("unimplemented"),
))
}
/// Gets metadata for a
/// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
///
/// `projects/*/secrets/*/versions/latest` is an alias to the most recently
/// created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
///
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
fn get_secret_version(
&self,
_req: crate::model::GetSecretVersionRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::SecretVersion>> + Send {
std::future::ready::<crate::Result<crate::model::SecretVersion>>(Err(Error::other(
"unimplemented",
)))
}
/// Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
/// This call returns the secret data.
///
/// `projects/*/secrets/*/versions/latest` is an alias to the most recently
/// created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
///
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
fn access_secret_version(
&self,
_req: crate::model::AccessSecretVersionRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::AccessSecretVersionResponse>> + Send
{
std::future::ready::<crate::Result<crate::model::AccessSecretVersionResponse>>(Err(
Error::other("unimplemented"),
))
}
/// Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
///
/// Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the
/// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to
/// [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].
///
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
/// [google.cloud.secretmanager.v1.SecretVersion.State.DISABLED]: crate::model::secret_version::state::DISABLED
/// [google.cloud.secretmanager.v1.SecretVersion.state]: crate::model::SecretVersion::state
fn disable_secret_version(
&self,
_req: crate::model::DisableSecretVersionRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::SecretVersion>> + Send {
std::future::ready::<crate::Result<crate::model::SecretVersion>>(Err(Error::other(
"unimplemented",
)))
}
/// Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
///
/// Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the
/// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to
/// [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].
///
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
/// [google.cloud.secretmanager.v1.SecretVersion.State.ENABLED]: crate::model::secret_version::state::ENABLED
/// [google.cloud.secretmanager.v1.SecretVersion.state]: crate::model::SecretVersion::state
fn enable_secret_version(
&self,
_req: crate::model::EnableSecretVersionRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::SecretVersion>> + Send {
std::future::ready::<crate::Result<crate::model::SecretVersion>>(Err(Error::other(
"unimplemented",
)))
}
/// Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
///
/// Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the
/// [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to
/// [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED]
/// and irrevocably destroys the secret data.
///
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
/// [google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED]: crate::model::secret_version::state::DESTROYED
/// [google.cloud.secretmanager.v1.SecretVersion.state]: crate::model::SecretVersion::state
fn destroy_secret_version(
&self,
_req: crate::model::DestroySecretVersionRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<crate::model::SecretVersion>> + Send {
std::future::ready::<crate::Result<crate::model::SecretVersion>>(Err(Error::other(
"unimplemented",
)))
}
/// Sets the access control policy on the specified secret. Replaces any
/// existing policy.
///
/// Permissions on
/// [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] are enforced
/// according to the policy set on the associated
/// [Secret][google.cloud.secretmanager.v1.Secret].
///
/// [google.cloud.secretmanager.v1.Secret]: crate::model::Secret
/// [google.cloud.secretmanager.v1.SecretVersion]: crate::model::SecretVersion
fn set_iam_policy(
&self,
_req: iam_v1::model::SetIamPolicyRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<iam_v1::model::Policy>> + Send {
std::future::ready::<crate::Result<iam_v1::model::Policy>>(Err(Error::other(
"unimplemented",
)))
}
/// Gets the access control policy for a secret.
/// Returns empty policy if the secret exists and does not have a policy set.
fn get_iam_policy(
&self,
_req: iam_v1::model::GetIamPolicyRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<iam_v1::model::Policy>> + Send {
std::future::ready::<crate::Result<iam_v1::model::Policy>>(Err(Error::other(
"unimplemented",
)))
}
/// Returns permissions that a caller has for the specified secret.
/// If the secret does not exist, this call returns an empty set of
/// permissions, not a NOT_FOUND error.
///
/// Note: This operation is designed to be used for building permission-aware
/// UIs and command-line tools, not for authorization checking. This operation
/// may "fail open" without warning.
fn test_iam_permissions(
&self,
_req: iam_v1::model::TestIamPermissionsRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<iam_v1::model::TestIamPermissionsResponse>> + Send
{
std::future::ready::<crate::Result<iam_v1::model::TestIamPermissionsResponse>>(Err(
Error::other("unimplemented"),
))
}
}
/// Manages location-related information with an API service.
///
/// # Mocking
///
/// Application developers may use this trait to mock the secretmanager clients.
///
/// Services gain new RPCs routinely. Consequently, this trait gains new methods
/// too. To avoid breaking applications the trait provides a default
/// implementation for each method. These implementations return an error.
pub trait Locations: std::fmt::Debug + Send + Sync {
/// Lists information about the supported locations for this service.
fn list_locations(
&self,
_req: location::model::ListLocationsRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<location::model::ListLocationsResponse>> + Send
{
std::future::ready::<crate::Result<location::model::ListLocationsResponse>>(Err(
Error::other("unimplemented"),
))
}
/// Gets information about a location.
fn get_location(
&self,
_req: location::model::GetLocationRequest,
_options: gax::options::RequestOptions,
) -> impl std::future::Future<Output = crate::Result<location::model::Location>> + Send {
std::future::ready::<crate::Result<location::model::Location>>(Err(Error::other(
"unimplemented",
)))
}
}