// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
use std::fmt::Write;
/// See [`CancelRotateSecretInput`](crate::input::CancelRotateSecretInput)
pub mod cancel_rotate_secret_input {
/// A builder for [`CancelRotateSecretInput`](crate::input::CancelRotateSecretInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Consumes the builder and constructs a [`CancelRotateSecretInput`](crate::input::CancelRotateSecretInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::CancelRotateSecretInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CancelRotateSecretInput {
secret_id: self.secret_id,
})
}
}
}
#[doc(hidden)]
pub type CancelRotateSecretInputOperationOutputAlias = crate::operation::CancelRotateSecret;
#[doc(hidden)]
pub type CancelRotateSecretInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl CancelRotateSecretInput {
/// Consumes the builder and constructs an Operation<[`CancelRotateSecret`](crate::operation::CancelRotateSecret)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CancelRotateSecret,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CancelRotateSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CancelRotateSecretInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CancelRotateSecretInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.CancelRotateSecret",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_cancel_rotate_secret(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CancelRotateSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CancelRotateSecret",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`CancelRotateSecretInput`](crate::input::CancelRotateSecretInput)
pub fn builder() -> crate::input::cancel_rotate_secret_input::Builder {
crate::input::cancel_rotate_secret_input::Builder::default()
}
}
/// See [`CreateSecretInput`](crate::input::CreateSecretInput)
pub mod create_secret_input {
/// A builder for [`CreateSecretInput`](crate::input::CreateSecretInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) kms_key_id: std::option::Option<std::string::String>,
pub(crate) secret_binary: std::option::Option<aws_smithy_types::Blob>,
pub(crate) secret_string: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) add_replica_regions:
std::option::Option<std::vec::Vec<crate::model::ReplicaRegionType>>,
pub(crate) force_overwrite_replica_secret: std::option::Option<bool>,
}
impl Builder {
/// <p>The name of the new secret.</p>
/// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
/// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the new secret.</p>
/// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
/// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version. </p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for the new version and include the value in the request.</p>
/// </note>
/// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret. </p>
/// <ul>
/// <li> <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created. </p> </li>
/// <li> <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p> </li>
/// <li> <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p> </li>
/// </ul>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
/// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version. </p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for the new version and include the value in the request.</p>
/// </note>
/// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret. </p>
/// <ul>
/// <li> <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created. </p> </li>
/// <li> <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p> </li>
/// <li> <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p> </li>
/// </ul>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
/// <p>The description of the secret.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The description of the secret.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret.</p>
/// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
/// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
/// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key. </p>
pub fn kms_key_id(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_id = Some(input.into());
self
}
/// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret.</p>
/// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
/// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
/// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key. </p>
pub fn set_kms_key_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
/// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
/// <p>This parameter is not available in the Secrets Manager console.</p>
pub fn secret_binary(mut self, input: aws_smithy_types::Blob) -> Self {
self.secret_binary = Some(input);
self
}
/// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
/// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
/// <p>This parameter is not available in the Secrets Manager console.</p>
pub fn set_secret_binary(
mut self,
input: std::option::Option<aws_smithy_types::Blob>,
) -> Self {
self.secret_binary = input;
self
}
/// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
/// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
/// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
pub fn secret_string(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_string = Some(input.into());
self
}
/// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
/// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
/// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
pub fn set_secret_string(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.secret_string = input;
self
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
/// <p> <code>[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}]</code> </p>
/// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
/// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
/// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
/// <p>The following restrictions apply to tags:</p>
/// <ul>
/// <li> <p>Maximum number of tags per secret: 50</p> </li>
/// <li> <p>Maximum key length: 127 Unicode characters in UTF-8</p> </li>
/// <li> <p>Maximum value length: 255 Unicode characters in UTF-8</p> </li>
/// <li> <p>Tag keys and values are case sensitive.</p> </li>
/// <li> <p>Do not use the <code>aws:</code> prefix in your tag names or values because Amazon Web Services reserves it for Amazon Web Services use. You can't edit or delete tag names or values with this prefix. Tags with this prefix do not count against your tags per secret limit.</p> </li>
/// <li> <p>If you use your tagging schema across multiple services and resources, other services might have restrictions on allowed characters. Generally allowed characters: letters, spaces, and numbers representable in UTF-8, plus the following special characters: + - = . _ : / @.</p> </li>
/// </ul>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
/// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
/// <p> <code>[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}]</code> </p>
/// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
/// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
/// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
/// <p>The following restrictions apply to tags:</p>
/// <ul>
/// <li> <p>Maximum number of tags per secret: 50</p> </li>
/// <li> <p>Maximum key length: 127 Unicode characters in UTF-8</p> </li>
/// <li> <p>Maximum value length: 255 Unicode characters in UTF-8</p> </li>
/// <li> <p>Tag keys and values are case sensitive.</p> </li>
/// <li> <p>Do not use the <code>aws:</code> prefix in your tag names or values because Amazon Web Services reserves it for Amazon Web Services use. You can't edit or delete tag names or values with this prefix. Tags with this prefix do not count against your tags per secret limit.</p> </li>
/// <li> <p>If you use your tagging schema across multiple services and resources, other services might have restrictions on allowed characters. Generally allowed characters: letters, spaces, and numbers representable in UTF-8, plus the following special characters: + - = . _ : / @.</p> </li>
/// </ul>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
/// Appends an item to `add_replica_regions`.
///
/// To override the contents of this collection use [`set_add_replica_regions`](Self::set_add_replica_regions).
///
/// <p>A list of Regions and KMS keys to replicate secrets.</p>
pub fn add_replica_regions(mut self, input: crate::model::ReplicaRegionType) -> Self {
let mut v = self.add_replica_regions.unwrap_or_default();
v.push(input);
self.add_replica_regions = Some(v);
self
}
/// <p>A list of Regions and KMS keys to replicate secrets.</p>
pub fn set_add_replica_regions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ReplicaRegionType>>,
) -> Self {
self.add_replica_regions = input;
self
}
/// <p>Specifies whether to overwrite a secret with the same name in the destination Region.</p>
pub fn force_overwrite_replica_secret(mut self, input: bool) -> Self {
self.force_overwrite_replica_secret = Some(input);
self
}
/// <p>Specifies whether to overwrite a secret with the same name in the destination Region.</p>
pub fn set_force_overwrite_replica_secret(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.force_overwrite_replica_secret = input;
self
}
/// Consumes the builder and constructs a [`CreateSecretInput`](crate::input::CreateSecretInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::CreateSecretInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateSecretInput {
name: self.name,
client_request_token: self.client_request_token,
description: self.description,
kms_key_id: self.kms_key_id,
secret_binary: self.secret_binary,
secret_string: self.secret_string,
tags: self.tags,
add_replica_regions: self.add_replica_regions,
force_overwrite_replica_secret: self
.force_overwrite_replica_secret
.unwrap_or_default(),
})
}
}
}
#[doc(hidden)]
pub type CreateSecretInputOperationOutputAlias = crate::operation::CreateSecret;
#[doc(hidden)]
pub type CreateSecretInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl CreateSecretInput {
/// Consumes the builder and constructs an Operation<[`CreateSecret`](crate::operation::CreateSecret)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateSecret,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateSecretInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateSecretInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.CreateSecret",
);
Ok(builder)
}
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_create_secret(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateSecret",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`CreateSecretInput`](crate::input::CreateSecretInput)
pub fn builder() -> crate::input::create_secret_input::Builder {
crate::input::create_secret_input::Builder::default()
}
}
/// See [`DeleteResourcePolicyInput`](crate::input::DeleteResourcePolicyInput)
pub mod delete_resource_policy_input {
/// A builder for [`DeleteResourcePolicyInput`](crate::input::DeleteResourcePolicyInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN or name of the secret to delete the attached resource-based policy for.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to delete the attached resource-based policy for.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Consumes the builder and constructs a [`DeleteResourcePolicyInput`](crate::input::DeleteResourcePolicyInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::DeleteResourcePolicyInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteResourcePolicyInput {
secret_id: self.secret_id,
})
}
}
}
#[doc(hidden)]
pub type DeleteResourcePolicyInputOperationOutputAlias = crate::operation::DeleteResourcePolicy;
#[doc(hidden)]
pub type DeleteResourcePolicyInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl DeleteResourcePolicyInput {
/// Consumes the builder and constructs an Operation<[`DeleteResourcePolicy`](crate::operation::DeleteResourcePolicy)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteResourcePolicy,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteResourcePolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteResourcePolicyInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DeleteResourcePolicyInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.DeleteResourcePolicy",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_delete_resource_policy(
&self,
)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteResourcePolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteResourcePolicy",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`DeleteResourcePolicyInput`](crate::input::DeleteResourcePolicyInput)
pub fn builder() -> crate::input::delete_resource_policy_input::Builder {
crate::input::delete_resource_policy_input::Builder::default()
}
}
/// See [`DeleteSecretInput`](crate::input::DeleteSecretInput)
pub mod delete_secret_input {
/// A builder for [`DeleteSecretInput`](crate::input::DeleteSecretInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) recovery_window_in_days: std::option::Option<i64>,
pub(crate) force_delete_without_recovery: std::option::Option<bool>,
}
impl Builder {
/// <p>The ARN or name of the secret to delete.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to delete.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>The number of days from 7 to 30 that Secrets Manager waits before permanently deleting the secret. You can't use both this parameter and <code>ForceDeleteWithoutRecovery</code> in the same call. If you don't use either, then Secrets Manager defaults to a 30 day recovery window.</p>
pub fn recovery_window_in_days(mut self, input: i64) -> Self {
self.recovery_window_in_days = Some(input);
self
}
/// <p>The number of days from 7 to 30 that Secrets Manager waits before permanently deleting the secret. You can't use both this parameter and <code>ForceDeleteWithoutRecovery</code> in the same call. If you don't use either, then Secrets Manager defaults to a 30 day recovery window.</p>
pub fn set_recovery_window_in_days(mut self, input: std::option::Option<i64>) -> Self {
self.recovery_window_in_days = input;
self
}
/// <p>Specifies whether to delete the secret without any recovery window. You can't use both this parameter and <code>RecoveryWindowInDays</code> in the same call. If you don't use either, then Secrets Manager defaults to a 30 day recovery window.</p>
/// <p>Secrets Manager performs the actual deletion with an asynchronous background process, so there might be a short delay before the secret is permanently deleted. If you delete a secret and then immediately create a secret with the same name, use appropriate back off and retry logic.</p> <important>
/// <p>Use this parameter with caution. This parameter causes the operation to skip the normal recovery window before the permanent deletion that Secrets Manager would normally impose with the <code>RecoveryWindowInDays</code> parameter. If you delete a secret with the <code>ForceDeleteWithouRecovery</code> parameter, then you have no opportunity to recover the secret. You lose the secret permanently.</p>
/// </important>
pub fn force_delete_without_recovery(mut self, input: bool) -> Self {
self.force_delete_without_recovery = Some(input);
self
}
/// <p>Specifies whether to delete the secret without any recovery window. You can't use both this parameter and <code>RecoveryWindowInDays</code> in the same call. If you don't use either, then Secrets Manager defaults to a 30 day recovery window.</p>
/// <p>Secrets Manager performs the actual deletion with an asynchronous background process, so there might be a short delay before the secret is permanently deleted. If you delete a secret and then immediately create a secret with the same name, use appropriate back off and retry logic.</p> <important>
/// <p>Use this parameter with caution. This parameter causes the operation to skip the normal recovery window before the permanent deletion that Secrets Manager would normally impose with the <code>RecoveryWindowInDays</code> parameter. If you delete a secret with the <code>ForceDeleteWithouRecovery</code> parameter, then you have no opportunity to recover the secret. You lose the secret permanently.</p>
/// </important>
pub fn set_force_delete_without_recovery(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.force_delete_without_recovery = input;
self
}
/// Consumes the builder and constructs a [`DeleteSecretInput`](crate::input::DeleteSecretInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::DeleteSecretInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteSecretInput {
secret_id: self.secret_id,
recovery_window_in_days: self.recovery_window_in_days,
force_delete_without_recovery: self.force_delete_without_recovery,
})
}
}
}
#[doc(hidden)]
pub type DeleteSecretInputOperationOutputAlias = crate::operation::DeleteSecret;
#[doc(hidden)]
pub type DeleteSecretInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl DeleteSecretInput {
/// Consumes the builder and constructs an Operation<[`DeleteSecret`](crate::operation::DeleteSecret)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteSecret,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteSecretInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DeleteSecretInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.DeleteSecret",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_delete_secret(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteSecret",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`DeleteSecretInput`](crate::input::DeleteSecretInput)
pub fn builder() -> crate::input::delete_secret_input::Builder {
crate::input::delete_secret_input::Builder::default()
}
}
/// See [`DescribeSecretInput`](crate::input::DescribeSecretInput)
pub mod describe_secret_input {
/// A builder for [`DescribeSecretInput`](crate::input::DescribeSecretInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN or name of the secret. </p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret. </p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Consumes the builder and constructs a [`DescribeSecretInput`](crate::input::DescribeSecretInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::DescribeSecretInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DescribeSecretInput {
secret_id: self.secret_id,
})
}
}
}
#[doc(hidden)]
pub type DescribeSecretInputOperationOutputAlias = crate::operation::DescribeSecret;
#[doc(hidden)]
pub type DescribeSecretInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl DescribeSecretInput {
/// Consumes the builder and constructs an Operation<[`DescribeSecret`](crate::operation::DescribeSecret)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DescribeSecret,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DescribeSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeSecretInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DescribeSecretInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.DescribeSecret",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_describe_secret(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeSecret",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`DescribeSecretInput`](crate::input::DescribeSecretInput)
pub fn builder() -> crate::input::describe_secret_input::Builder {
crate::input::describe_secret_input::Builder::default()
}
}
/// See [`GetRandomPasswordInput`](crate::input::GetRandomPasswordInput)
pub mod get_random_password_input {
/// A builder for [`GetRandomPasswordInput`](crate::input::GetRandomPasswordInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) password_length: std::option::Option<i64>,
pub(crate) exclude_characters: std::option::Option<std::string::String>,
pub(crate) exclude_numbers: std::option::Option<bool>,
pub(crate) exclude_punctuation: std::option::Option<bool>,
pub(crate) exclude_uppercase: std::option::Option<bool>,
pub(crate) exclude_lowercase: std::option::Option<bool>,
pub(crate) include_space: std::option::Option<bool>,
pub(crate) require_each_included_type: std::option::Option<bool>,
}
impl Builder {
/// <p>The length of the password. If you don't include this parameter, the default length is 32 characters.</p>
pub fn password_length(mut self, input: i64) -> Self {
self.password_length = Some(input);
self
}
/// <p>The length of the password. If you don't include this parameter, the default length is 32 characters.</p>
pub fn set_password_length(mut self, input: std::option::Option<i64>) -> Self {
self.password_length = input;
self
}
/// <p>A string of the characters that you don't want in the password.</p>
pub fn exclude_characters(mut self, input: impl Into<std::string::String>) -> Self {
self.exclude_characters = Some(input.into());
self
}
/// <p>A string of the characters that you don't want in the password.</p>
pub fn set_exclude_characters(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.exclude_characters = input;
self
}
/// <p>Specifies whether to exclude numbers from the password. If you don't include this switch, the password can contain numbers.</p>
pub fn exclude_numbers(mut self, input: bool) -> Self {
self.exclude_numbers = Some(input);
self
}
/// <p>Specifies whether to exclude numbers from the password. If you don't include this switch, the password can contain numbers.</p>
pub fn set_exclude_numbers(mut self, input: std::option::Option<bool>) -> Self {
self.exclude_numbers = input;
self
}
/// <p>Specifies whether to exclude the following punctuation characters from the password: <code>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~</code>. If you don't include this switch, the password can contain punctuation.</p>
pub fn exclude_punctuation(mut self, input: bool) -> Self {
self.exclude_punctuation = Some(input);
self
}
/// <p>Specifies whether to exclude the following punctuation characters from the password: <code>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~</code>. If you don't include this switch, the password can contain punctuation.</p>
pub fn set_exclude_punctuation(mut self, input: std::option::Option<bool>) -> Self {
self.exclude_punctuation = input;
self
}
/// <p>Specifies whether to exclude uppercase letters from the password. If you don't include this switch, the password can contain uppercase letters.</p>
pub fn exclude_uppercase(mut self, input: bool) -> Self {
self.exclude_uppercase = Some(input);
self
}
/// <p>Specifies whether to exclude uppercase letters from the password. If you don't include this switch, the password can contain uppercase letters.</p>
pub fn set_exclude_uppercase(mut self, input: std::option::Option<bool>) -> Self {
self.exclude_uppercase = input;
self
}
/// <p>Specifies whether to exclude lowercase letters from the password. If you don't include this switch, the password can contain lowercase letters.</p>
pub fn exclude_lowercase(mut self, input: bool) -> Self {
self.exclude_lowercase = Some(input);
self
}
/// <p>Specifies whether to exclude lowercase letters from the password. If you don't include this switch, the password can contain lowercase letters.</p>
pub fn set_exclude_lowercase(mut self, input: std::option::Option<bool>) -> Self {
self.exclude_lowercase = input;
self
}
/// <p>Specifies whether to include the space character. If you include this switch, the password can contain space characters.</p>
pub fn include_space(mut self, input: bool) -> Self {
self.include_space = Some(input);
self
}
/// <p>Specifies whether to include the space character. If you include this switch, the password can contain space characters.</p>
pub fn set_include_space(mut self, input: std::option::Option<bool>) -> Self {
self.include_space = input;
self
}
/// <p>Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. If you don't include this switch, the password contains at least one of every character type.</p>
pub fn require_each_included_type(mut self, input: bool) -> Self {
self.require_each_included_type = Some(input);
self
}
/// <p>Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. If you don't include this switch, the password contains at least one of every character type.</p>
pub fn set_require_each_included_type(mut self, input: std::option::Option<bool>) -> Self {
self.require_each_included_type = input;
self
}
/// Consumes the builder and constructs a [`GetRandomPasswordInput`](crate::input::GetRandomPasswordInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::GetRandomPasswordInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetRandomPasswordInput {
password_length: self.password_length,
exclude_characters: self.exclude_characters,
exclude_numbers: self.exclude_numbers,
exclude_punctuation: self.exclude_punctuation,
exclude_uppercase: self.exclude_uppercase,
exclude_lowercase: self.exclude_lowercase,
include_space: self.include_space,
require_each_included_type: self.require_each_included_type,
})
}
}
}
#[doc(hidden)]
pub type GetRandomPasswordInputOperationOutputAlias = crate::operation::GetRandomPassword;
#[doc(hidden)]
pub type GetRandomPasswordInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl GetRandomPasswordInput {
/// Consumes the builder and constructs an Operation<[`GetRandomPassword`](crate::operation::GetRandomPassword)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetRandomPassword,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetRandomPasswordInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetRandomPasswordInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetRandomPasswordInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.GetRandomPassword",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_get_random_password(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetRandomPassword::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetRandomPassword",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`GetRandomPasswordInput`](crate::input::GetRandomPasswordInput)
pub fn builder() -> crate::input::get_random_password_input::Builder {
crate::input::get_random_password_input::Builder::default()
}
}
/// See [`GetResourcePolicyInput`](crate::input::GetResourcePolicyInput)
pub mod get_resource_policy_input {
/// A builder for [`GetResourcePolicyInput`](crate::input::GetResourcePolicyInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN or name of the secret to retrieve the attached resource-based policy for.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to retrieve the attached resource-based policy for.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Consumes the builder and constructs a [`GetResourcePolicyInput`](crate::input::GetResourcePolicyInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::GetResourcePolicyInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetResourcePolicyInput {
secret_id: self.secret_id,
})
}
}
}
#[doc(hidden)]
pub type GetResourcePolicyInputOperationOutputAlias = crate::operation::GetResourcePolicy;
#[doc(hidden)]
pub type GetResourcePolicyInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl GetResourcePolicyInput {
/// Consumes the builder and constructs an Operation<[`GetResourcePolicy`](crate::operation::GetResourcePolicy)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetResourcePolicy,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetResourcePolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetResourcePolicyInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetResourcePolicyInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.GetResourcePolicy",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_get_resource_policy(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetResourcePolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetResourcePolicy",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`GetResourcePolicyInput`](crate::input::GetResourcePolicyInput)
pub fn builder() -> crate::input::get_resource_policy_input::Builder {
crate::input::get_resource_policy_input::Builder::default()
}
}
/// See [`GetSecretValueInput`](crate::input::GetSecretValueInput)
pub mod get_secret_value_input {
/// A builder for [`GetSecretValueInput`](crate::input::GetSecretValueInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) version_id: std::option::Option<std::string::String>,
pub(crate) version_stage: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN or name of the secret to retrieve.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to retrieve.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>The unique identifier of the version of the secret to retrieve. If you include both this parameter and <code>VersionStage</code>, the two parameters must refer to the same secret version. If you don't specify either a <code>VersionStage</code> or <code>VersionId</code>, then Secrets Manager returns the <code>AWSCURRENT</code> version.</p>
/// <p>This value is typically a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value with 32 hexadecimal digits.</p>
pub fn version_id(mut self, input: impl Into<std::string::String>) -> Self {
self.version_id = Some(input.into());
self
}
/// <p>The unique identifier of the version of the secret to retrieve. If you include both this parameter and <code>VersionStage</code>, the two parameters must refer to the same secret version. If you don't specify either a <code>VersionStage</code> or <code>VersionId</code>, then Secrets Manager returns the <code>AWSCURRENT</code> version.</p>
/// <p>This value is typically a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value with 32 hexadecimal digits.</p>
pub fn set_version_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.version_id = input;
self
}
/// <p>The staging label of the version of the secret to retrieve. </p>
/// <p>Secrets Manager uses staging labels to keep track of different versions during the rotation process. If you include both this parameter and <code>VersionId</code>, the two parameters must refer to the same secret version. If you don't specify either a <code>VersionStage</code> or <code>VersionId</code>, Secrets Manager returns the <code>AWSCURRENT</code> version.</p>
pub fn version_stage(mut self, input: impl Into<std::string::String>) -> Self {
self.version_stage = Some(input.into());
self
}
/// <p>The staging label of the version of the secret to retrieve. </p>
/// <p>Secrets Manager uses staging labels to keep track of different versions during the rotation process. If you include both this parameter and <code>VersionId</code>, the two parameters must refer to the same secret version. If you don't specify either a <code>VersionStage</code> or <code>VersionId</code>, Secrets Manager returns the <code>AWSCURRENT</code> version.</p>
pub fn set_version_stage(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.version_stage = input;
self
}
/// Consumes the builder and constructs a [`GetSecretValueInput`](crate::input::GetSecretValueInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::GetSecretValueInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetSecretValueInput {
secret_id: self.secret_id,
version_id: self.version_id,
version_stage: self.version_stage,
})
}
}
}
#[doc(hidden)]
pub type GetSecretValueInputOperationOutputAlias = crate::operation::GetSecretValue;
#[doc(hidden)]
pub type GetSecretValueInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl GetSecretValueInput {
/// Consumes the builder and constructs an Operation<[`GetSecretValue`](crate::operation::GetSecretValue)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetSecretValue,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetSecretValueInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSecretValueInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetSecretValueInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.GetSecretValue",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_get_secret_value(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetSecretValue::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSecretValue",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`GetSecretValueInput`](crate::input::GetSecretValueInput)
pub fn builder() -> crate::input::get_secret_value_input::Builder {
crate::input::get_secret_value_input::Builder::default()
}
}
/// See [`ListSecretsInput`](crate::input::ListSecretsInput)
pub mod list_secrets_input {
/// A builder for [`ListSecretsInput`](crate::input::ListSecretsInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) filters: std::option::Option<std::vec::Vec<crate::model::Filter>>,
pub(crate) sort_order: std::option::Option<crate::model::SortOrderType>,
}
impl Builder {
/// <p>The number of results to include in the response.</p>
/// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
/// <p>The number of results to include in the response.</p>
/// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
/// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
/// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
/// Appends an item to `filters`.
///
/// To override the contents of this collection use [`set_filters`](Self::set_filters).
///
/// <p>The filters to apply to the list of secrets.</p>
pub fn filters(mut self, input: crate::model::Filter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
/// <p>The filters to apply to the list of secrets.</p>
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Filter>>,
) -> Self {
self.filters = input;
self
}
/// <p>Lists secrets in the requested order. </p>
pub fn sort_order(mut self, input: crate::model::SortOrderType) -> Self {
self.sort_order = Some(input);
self
}
/// <p>Lists secrets in the requested order. </p>
pub fn set_sort_order(
mut self,
input: std::option::Option<crate::model::SortOrderType>,
) -> Self {
self.sort_order = input;
self
}
/// Consumes the builder and constructs a [`ListSecretsInput`](crate::input::ListSecretsInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::ListSecretsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListSecretsInput {
max_results: self.max_results,
next_token: self.next_token,
filters: self.filters,
sort_order: self.sort_order,
})
}
}
}
#[doc(hidden)]
pub type ListSecretsInputOperationOutputAlias = crate::operation::ListSecrets;
#[doc(hidden)]
pub type ListSecretsInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl ListSecretsInput {
/// Consumes the builder and constructs an Operation<[`ListSecrets`](crate::operation::ListSecrets)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListSecrets,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListSecretsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSecretsInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::ListSecretsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.ListSecrets",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_list_secrets(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListSecrets::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSecrets",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`ListSecretsInput`](crate::input::ListSecretsInput)
pub fn builder() -> crate::input::list_secrets_input::Builder {
crate::input::list_secrets_input::Builder::default()
}
}
/// See [`ListSecretVersionIdsInput`](crate::input::ListSecretVersionIdsInput)
pub mod list_secret_version_ids_input {
/// A builder for [`ListSecretVersionIdsInput`](crate::input::ListSecretVersionIdsInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) include_deprecated: std::option::Option<bool>,
}
impl Builder {
/// <p>The ARN or name of the secret whose versions you want to list.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret whose versions you want to list.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>The number of results to include in the response.</p>
/// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecretVersionIds</code> again with the value from <code>NextToken</code>. </p>
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
/// <p>The number of results to include in the response.</p>
/// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecretVersionIds</code> again with the value from <code>NextToken</code>. </p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
/// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecretVersionIds</code> again with this value.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
/// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecretVersionIds</code> again with this value.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
/// <p>Specifies whether to include versions of secrets that don't have any staging labels attached to them. Versions without staging labels are considered deprecated and are subject to deletion by Secrets Manager.</p>
pub fn include_deprecated(mut self, input: bool) -> Self {
self.include_deprecated = Some(input);
self
}
/// <p>Specifies whether to include versions of secrets that don't have any staging labels attached to them. Versions without staging labels are considered deprecated and are subject to deletion by Secrets Manager.</p>
pub fn set_include_deprecated(mut self, input: std::option::Option<bool>) -> Self {
self.include_deprecated = input;
self
}
/// Consumes the builder and constructs a [`ListSecretVersionIdsInput`](crate::input::ListSecretVersionIdsInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::ListSecretVersionIdsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListSecretVersionIdsInput {
secret_id: self.secret_id,
max_results: self.max_results,
next_token: self.next_token,
include_deprecated: self.include_deprecated,
})
}
}
}
#[doc(hidden)]
pub type ListSecretVersionIdsInputOperationOutputAlias = crate::operation::ListSecretVersionIds;
#[doc(hidden)]
pub type ListSecretVersionIdsInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl ListSecretVersionIdsInput {
/// Consumes the builder and constructs an Operation<[`ListSecretVersionIds`](crate::operation::ListSecretVersionIds)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListSecretVersionIds,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListSecretVersionIdsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSecretVersionIdsInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::ListSecretVersionIdsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.ListSecretVersionIds",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_list_secret_version_ids(
&self,
)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListSecretVersionIds::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSecretVersionIds",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`ListSecretVersionIdsInput`](crate::input::ListSecretVersionIdsInput)
pub fn builder() -> crate::input::list_secret_version_ids_input::Builder {
crate::input::list_secret_version_ids_input::Builder::default()
}
}
/// See [`PutResourcePolicyInput`](crate::input::PutResourcePolicyInput)
pub mod put_resource_policy_input {
/// A builder for [`PutResourcePolicyInput`](crate::input::PutResourcePolicyInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) resource_policy: std::option::Option<std::string::String>,
pub(crate) block_public_policy: std::option::Option<bool>,
}
impl Builder {
/// <p>The ARN or name of the secret to attach the resource-based policy.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to attach the resource-based policy.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>A JSON-formatted string for an Amazon Web Services resource-based policy. For example policies, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html">Permissions policy examples</a>.</p>
pub fn resource_policy(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_policy = Some(input.into());
self
}
/// <p>A JSON-formatted string for an Amazon Web Services resource-based policy. For example policies, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html">Permissions policy examples</a>.</p>
pub fn set_resource_policy(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_policy = input;
self
}
/// <p>Specifies whether to block resource-based policies that allow broad access to the secret. By default, Secrets Manager blocks policies that allow broad access, for example those that use a wildcard for the principal.</p>
pub fn block_public_policy(mut self, input: bool) -> Self {
self.block_public_policy = Some(input);
self
}
/// <p>Specifies whether to block resource-based policies that allow broad access to the secret. By default, Secrets Manager blocks policies that allow broad access, for example those that use a wildcard for the principal.</p>
pub fn set_block_public_policy(mut self, input: std::option::Option<bool>) -> Self {
self.block_public_policy = input;
self
}
/// Consumes the builder and constructs a [`PutResourcePolicyInput`](crate::input::PutResourcePolicyInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::PutResourcePolicyInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::PutResourcePolicyInput {
secret_id: self.secret_id,
resource_policy: self.resource_policy,
block_public_policy: self.block_public_policy,
})
}
}
}
#[doc(hidden)]
pub type PutResourcePolicyInputOperationOutputAlias = crate::operation::PutResourcePolicy;
#[doc(hidden)]
pub type PutResourcePolicyInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl PutResourcePolicyInput {
/// Consumes the builder and constructs an Operation<[`PutResourcePolicy`](crate::operation::PutResourcePolicy)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutResourcePolicy,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::PutResourcePolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutResourcePolicyInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::PutResourcePolicyInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.PutResourcePolicy",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_put_resource_policy(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PutResourcePolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutResourcePolicy",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`PutResourcePolicyInput`](crate::input::PutResourcePolicyInput)
pub fn builder() -> crate::input::put_resource_policy_input::Builder {
crate::input::put_resource_policy_input::Builder::default()
}
}
/// See [`PutSecretValueInput`](crate::input::PutSecretValueInput)
pub mod put_secret_value_input {
/// A builder for [`PutSecretValueInput`](crate::input::PutSecretValueInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) secret_binary: std::option::Option<aws_smithy_types::Blob>,
pub(crate) secret_string: std::option::Option<std::string::String>,
pub(crate) version_stages: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p>The ARN or name of the secret to add a new version to.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
/// <p>If the secret doesn't already exist, use <code>CreateSecret</code> instead.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to add a new version to.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
/// <p>If the secret doesn't already exist, use <code>CreateSecret</code> instead.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>A unique identifier for the new version of the secret. </p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty because they generate a random UUID for you. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for new versions and include that value in the request. </p>
/// </note>
/// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during the Lambda rotation function processing. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness within the specified secret. </p>
/// <ul>
/// <li> <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created. </p> </li>
/// <li> <p>If a version with this value already exists and that version's <code>SecretString</code> or <code>SecretBinary</code> values are the same as those in the request then the request is ignored. The operation is idempotent. </p> </li>
/// <li> <p>If a version with this value already exists and the version of the <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you can't modify a secret version. You can only create new versions to store new secret values.</p> </li>
/// </ul>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
/// <p>A unique identifier for the new version of the secret. </p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty because they generate a random UUID for you. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for new versions and include that value in the request. </p>
/// </note>
/// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during the Lambda rotation function processing. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness within the specified secret. </p>
/// <ul>
/// <li> <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created. </p> </li>
/// <li> <p>If a version with this value already exists and that version's <code>SecretString</code> or <code>SecretBinary</code> values are the same as those in the request then the request is ignored. The operation is idempotent. </p> </li>
/// <li> <p>If a version with this value already exists and the version of the <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you can't modify a secret version. You can only create new versions to store new secret values.</p> </li>
/// </ul>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
/// <p>The binary data to encrypt and store in the new version of the secret. To use this parameter in the command-line tools, we recommend that you store your binary data in a file and then pass the contents of the file as a parameter. </p>
/// <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
/// <p>You can't access this value from the Secrets Manager console.</p>
pub fn secret_binary(mut self, input: aws_smithy_types::Blob) -> Self {
self.secret_binary = Some(input);
self
}
/// <p>The binary data to encrypt and store in the new version of the secret. To use this parameter in the command-line tools, we recommend that you store your binary data in a file and then pass the contents of the file as a parameter. </p>
/// <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
/// <p>You can't access this value from the Secrets Manager console.</p>
pub fn set_secret_binary(
mut self,
input: std::option::Option<aws_smithy_types::Blob>,
) -> Self {
self.secret_binary = input;
self
}
/// <p>The text to encrypt and store in the new version of the secret. </p>
/// <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
/// <p>We recommend you create the secret string as JSON key/value pairs, as shown in the example.</p>
pub fn secret_string(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_string = Some(input.into());
self
}
/// <p>The text to encrypt and store in the new version of the secret. </p>
/// <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
/// <p>We recommend you create the secret string as JSON key/value pairs, as shown in the example.</p>
pub fn set_secret_string(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.secret_string = input;
self
}
/// Appends an item to `version_stages`.
///
/// To override the contents of this collection use [`set_version_stages`](Self::set_version_stages).
///
/// <p>A list of staging labels to attach to this version of the secret. Secrets Manager uses staging labels to track versions of a secret through the rotation process.</p>
/// <p>If you specify a staging label that's already associated with a different version of the same secret, then Secrets Manager removes the label from the other version and attaches it to this version. If you specify <code>AWSCURRENT</code>, and it is already attached to another version, then Secrets Manager also moves the staging label <code>AWSPREVIOUS</code> to the version that <code>AWSCURRENT</code> was removed from.</p>
/// <p>If you don't include <code>VersionStages</code>, then Secrets Manager automatically moves the staging label <code>AWSCURRENT</code> to this version.</p>
pub fn version_stages(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.version_stages.unwrap_or_default();
v.push(input.into());
self.version_stages = Some(v);
self
}
/// <p>A list of staging labels to attach to this version of the secret. Secrets Manager uses staging labels to track versions of a secret through the rotation process.</p>
/// <p>If you specify a staging label that's already associated with a different version of the same secret, then Secrets Manager removes the label from the other version and attaches it to this version. If you specify <code>AWSCURRENT</code>, and it is already attached to another version, then Secrets Manager also moves the staging label <code>AWSPREVIOUS</code> to the version that <code>AWSCURRENT</code> was removed from.</p>
/// <p>If you don't include <code>VersionStages</code>, then Secrets Manager automatically moves the staging label <code>AWSCURRENT</code> to this version.</p>
pub fn set_version_stages(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.version_stages = input;
self
}
/// Consumes the builder and constructs a [`PutSecretValueInput`](crate::input::PutSecretValueInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::PutSecretValueInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::PutSecretValueInput {
secret_id: self.secret_id,
client_request_token: self.client_request_token,
secret_binary: self.secret_binary,
secret_string: self.secret_string,
version_stages: self.version_stages,
})
}
}
}
#[doc(hidden)]
pub type PutSecretValueInputOperationOutputAlias = crate::operation::PutSecretValue;
#[doc(hidden)]
pub type PutSecretValueInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl PutSecretValueInput {
/// Consumes the builder and constructs an Operation<[`PutSecretValue`](crate::operation::PutSecretValue)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutSecretValue,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::PutSecretValueInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutSecretValueInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::PutSecretValueInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.PutSecretValue",
);
Ok(builder)
}
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_put_secret_value(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PutSecretValue::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutSecretValue",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`PutSecretValueInput`](crate::input::PutSecretValueInput)
pub fn builder() -> crate::input::put_secret_value_input::Builder {
crate::input::put_secret_value_input::Builder::default()
}
}
/// See [`RemoveRegionsFromReplicationInput`](crate::input::RemoveRegionsFromReplicationInput)
pub mod remove_regions_from_replication_input {
/// A builder for [`RemoveRegionsFromReplicationInput`](crate::input::RemoveRegionsFromReplicationInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) remove_replica_regions: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p>The ARN or name of the secret.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Appends an item to `remove_replica_regions`.
///
/// To override the contents of this collection use [`set_remove_replica_regions`](Self::set_remove_replica_regions).
///
/// <p>The Regions of the replicas to remove.</p>
pub fn remove_replica_regions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.remove_replica_regions.unwrap_or_default();
v.push(input.into());
self.remove_replica_regions = Some(v);
self
}
/// <p>The Regions of the replicas to remove.</p>
pub fn set_remove_replica_regions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.remove_replica_regions = input;
self
}
/// Consumes the builder and constructs a [`RemoveRegionsFromReplicationInput`](crate::input::RemoveRegionsFromReplicationInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::RemoveRegionsFromReplicationInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::RemoveRegionsFromReplicationInput {
secret_id: self.secret_id,
remove_replica_regions: self.remove_replica_regions,
})
}
}
}
#[doc(hidden)]
pub type RemoveRegionsFromReplicationInputOperationOutputAlias =
crate::operation::RemoveRegionsFromReplication;
#[doc(hidden)]
pub type RemoveRegionsFromReplicationInputOperationRetryAlias =
aws_http::retry::AwsErrorRetryPolicy;
impl RemoveRegionsFromReplicationInput {
/// Consumes the builder and constructs an Operation<[`RemoveRegionsFromReplication`](crate::operation::RemoveRegionsFromReplication)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RemoveRegionsFromReplication,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::RemoveRegionsFromReplicationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RemoveRegionsFromReplicationInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::RemoveRegionsFromReplicationInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.RemoveRegionsFromReplication",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_remove_regions_from_replication(&self)?
;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::RemoveRegionsFromReplication::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RemoveRegionsFromReplication",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`RemoveRegionsFromReplicationInput`](crate::input::RemoveRegionsFromReplicationInput)
pub fn builder() -> crate::input::remove_regions_from_replication_input::Builder {
crate::input::remove_regions_from_replication_input::Builder::default()
}
}
/// See [`ReplicateSecretToRegionsInput`](crate::input::ReplicateSecretToRegionsInput)
pub mod replicate_secret_to_regions_input {
/// A builder for [`ReplicateSecretToRegionsInput`](crate::input::ReplicateSecretToRegionsInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) add_replica_regions:
std::option::Option<std::vec::Vec<crate::model::ReplicaRegionType>>,
pub(crate) force_overwrite_replica_secret: std::option::Option<bool>,
}
impl Builder {
/// <p>The ARN or name of the secret to replicate.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to replicate.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Appends an item to `add_replica_regions`.
///
/// To override the contents of this collection use [`set_add_replica_regions`](Self::set_add_replica_regions).
///
/// <p>A list of Regions in which to replicate the secret.</p>
pub fn add_replica_regions(mut self, input: crate::model::ReplicaRegionType) -> Self {
let mut v = self.add_replica_regions.unwrap_or_default();
v.push(input);
self.add_replica_regions = Some(v);
self
}
/// <p>A list of Regions in which to replicate the secret.</p>
pub fn set_add_replica_regions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ReplicaRegionType>>,
) -> Self {
self.add_replica_regions = input;
self
}
/// <p>Specifies whether to overwrite a secret with the same name in the destination Region.</p>
pub fn force_overwrite_replica_secret(mut self, input: bool) -> Self {
self.force_overwrite_replica_secret = Some(input);
self
}
/// <p>Specifies whether to overwrite a secret with the same name in the destination Region.</p>
pub fn set_force_overwrite_replica_secret(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.force_overwrite_replica_secret = input;
self
}
/// Consumes the builder and constructs a [`ReplicateSecretToRegionsInput`](crate::input::ReplicateSecretToRegionsInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::ReplicateSecretToRegionsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ReplicateSecretToRegionsInput {
secret_id: self.secret_id,
add_replica_regions: self.add_replica_regions,
force_overwrite_replica_secret: self
.force_overwrite_replica_secret
.unwrap_or_default(),
})
}
}
}
#[doc(hidden)]
pub type ReplicateSecretToRegionsInputOperationOutputAlias =
crate::operation::ReplicateSecretToRegions;
#[doc(hidden)]
pub type ReplicateSecretToRegionsInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl ReplicateSecretToRegionsInput {
/// Consumes the builder and constructs an Operation<[`ReplicateSecretToRegions`](crate::operation::ReplicateSecretToRegions)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ReplicateSecretToRegions,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ReplicateSecretToRegionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ReplicateSecretToRegionsInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::ReplicateSecretToRegionsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.ReplicateSecretToRegions",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_replicate_secret_to_regions(
&self,
)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ReplicateSecretToRegions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ReplicateSecretToRegions",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`ReplicateSecretToRegionsInput`](crate::input::ReplicateSecretToRegionsInput)
pub fn builder() -> crate::input::replicate_secret_to_regions_input::Builder {
crate::input::replicate_secret_to_regions_input::Builder::default()
}
}
/// See [`RestoreSecretInput`](crate::input::RestoreSecretInput)
pub mod restore_secret_input {
/// A builder for [`RestoreSecretInput`](crate::input::RestoreSecretInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN or name of the secret to restore.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to restore.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Consumes the builder and constructs a [`RestoreSecretInput`](crate::input::RestoreSecretInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::RestoreSecretInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::RestoreSecretInput {
secret_id: self.secret_id,
})
}
}
}
#[doc(hidden)]
pub type RestoreSecretInputOperationOutputAlias = crate::operation::RestoreSecret;
#[doc(hidden)]
pub type RestoreSecretInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl RestoreSecretInput {
/// Consumes the builder and constructs an Operation<[`RestoreSecret`](crate::operation::RestoreSecret)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RestoreSecret,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::RestoreSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RestoreSecretInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::RestoreSecretInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.RestoreSecret",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_restore_secret(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::RestoreSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RestoreSecret",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`RestoreSecretInput`](crate::input::RestoreSecretInput)
pub fn builder() -> crate::input::restore_secret_input::Builder {
crate::input::restore_secret_input::Builder::default()
}
}
/// See [`RotateSecretInput`](crate::input::RotateSecretInput)
pub mod rotate_secret_input {
/// A builder for [`RotateSecretInput`](crate::input::RotateSecretInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) rotation_lambda_arn: std::option::Option<std::string::String>,
pub(crate) rotation_rules: std::option::Option<crate::model::RotationRulesType>,
}
impl Builder {
/// <p>The ARN or name of the secret to rotate.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret to rotate.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during rotation. This value becomes the <code>VersionId</code> of the new version.</p>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request for this parameter. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for new versions and include that value in the request.</p>
/// <p>You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness within the specified secret. </p>
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
/// <p>A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during rotation. This value becomes the <code>VersionId</code> of the new version.</p>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request for this parameter. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for new versions and include that value in the request.</p>
/// <p>You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness within the specified secret. </p>
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
/// <p>The ARN of the Lambda rotation function that can rotate the secret.</p>
pub fn rotation_lambda_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.rotation_lambda_arn = Some(input.into());
self
}
/// <p>The ARN of the Lambda rotation function that can rotate the secret.</p>
pub fn set_rotation_lambda_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.rotation_lambda_arn = input;
self
}
/// <p>A structure that defines the rotation configuration for this secret.</p>
pub fn rotation_rules(mut self, input: crate::model::RotationRulesType) -> Self {
self.rotation_rules = Some(input);
self
}
/// <p>A structure that defines the rotation configuration for this secret.</p>
pub fn set_rotation_rules(
mut self,
input: std::option::Option<crate::model::RotationRulesType>,
) -> Self {
self.rotation_rules = input;
self
}
/// Consumes the builder and constructs a [`RotateSecretInput`](crate::input::RotateSecretInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::RotateSecretInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::RotateSecretInput {
secret_id: self.secret_id,
client_request_token: self.client_request_token,
rotation_lambda_arn: self.rotation_lambda_arn,
rotation_rules: self.rotation_rules,
})
}
}
}
#[doc(hidden)]
pub type RotateSecretInputOperationOutputAlias = crate::operation::RotateSecret;
#[doc(hidden)]
pub type RotateSecretInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl RotateSecretInput {
/// Consumes the builder and constructs an Operation<[`RotateSecret`](crate::operation::RotateSecret)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RotateSecret,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::RotateSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RotateSecretInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::RotateSecretInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.RotateSecret",
);
Ok(builder)
}
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_rotate_secret(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::RotateSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RotateSecret",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`RotateSecretInput`](crate::input::RotateSecretInput)
pub fn builder() -> crate::input::rotate_secret_input::Builder {
crate::input::rotate_secret_input::Builder::default()
}
}
/// See [`StopReplicationToReplicaInput`](crate::input::StopReplicationToReplicaInput)
pub mod stop_replication_to_replica_input {
/// A builder for [`StopReplicationToReplicaInput`](crate::input::StopReplicationToReplicaInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN of the primary secret. </p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN of the primary secret. </p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Consumes the builder and constructs a [`StopReplicationToReplicaInput`](crate::input::StopReplicationToReplicaInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::StopReplicationToReplicaInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::StopReplicationToReplicaInput {
secret_id: self.secret_id,
})
}
}
}
#[doc(hidden)]
pub type StopReplicationToReplicaInputOperationOutputAlias =
crate::operation::StopReplicationToReplica;
#[doc(hidden)]
pub type StopReplicationToReplicaInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl StopReplicationToReplicaInput {
/// Consumes the builder and constructs an Operation<[`StopReplicationToReplica`](crate::operation::StopReplicationToReplica)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::StopReplicationToReplica,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::StopReplicationToReplicaInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StopReplicationToReplicaInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::StopReplicationToReplicaInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.StopReplicationToReplica",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_stop_replication_to_replica(
&self,
)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::StopReplicationToReplica::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StopReplicationToReplica",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`StopReplicationToReplicaInput`](crate::input::StopReplicationToReplicaInput)
pub fn builder() -> crate::input::stop_replication_to_replica_input::Builder {
crate::input::stop_replication_to_replica_input::Builder::default()
}
}
/// See [`TagResourceInput`](crate::input::TagResourceInput)
pub mod tag_resource_input {
/// A builder for [`TagResourceInput`](crate::input::TagResourceInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl Builder {
/// <p>The identifier for the secret to attach tags to. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The identifier for the secret to attach tags to. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags to attach to the secret as a JSON text string argument. Each element in the list consists of a <code>Key</code> and a <code>Value</code>.</p>
/// <p>For storing multiple values, we recommend that you use a JSON text string argument and specify key/value pairs. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html">Specifying parameter values for the Amazon Web Services CLI</a> in the Amazon Web Services CLI User Guide.</p>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
/// <p>The tags to attach to the secret as a JSON text string argument. Each element in the list consists of a <code>Key</code> and a <code>Value</code>.</p>
/// <p>For storing multiple values, we recommend that you use a JSON text string argument and specify key/value pairs. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html">Specifying parameter values for the Amazon Web Services CLI</a> in the Amazon Web Services CLI User Guide.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
/// Consumes the builder and constructs a [`TagResourceInput`](crate::input::TagResourceInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::TagResourceInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::TagResourceInput {
secret_id: self.secret_id,
tags: self.tags,
})
}
}
}
#[doc(hidden)]
pub type TagResourceInputOperationOutputAlias = crate::operation::TagResource;
#[doc(hidden)]
pub type TagResourceInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl TagResourceInput {
/// Consumes the builder and constructs an Operation<[`TagResource`](crate::operation::TagResource)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::TagResourceInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.TagResource",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_tag_resource(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::TagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"TagResource",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`TagResourceInput`](crate::input::TagResourceInput)
pub fn builder() -> crate::input::tag_resource_input::Builder {
crate::input::tag_resource_input::Builder::default()
}
}
/// See [`UntagResourceInput`](crate::input::UntagResourceInput)
pub mod untag_resource_input {
/// A builder for [`UntagResourceInput`](crate::input::UntagResourceInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// Appends an item to `tag_keys`.
///
/// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
///
/// <p>A list of tag key names to remove from the secret. You don't specify the value. Both the key and its associated value are removed.</p>
/// <p>This parameter requires a JSON text string argument.</p>
/// <p>For storing multiple values, we recommend that you use a JSON text string argument and specify key/value pairs. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html">Specifying parameter values for the Amazon Web Services CLI</a> in the Amazon Web Services CLI User Guide.</p>
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tag_keys.unwrap_or_default();
v.push(input.into());
self.tag_keys = Some(v);
self
}
/// <p>A list of tag key names to remove from the secret. You don't specify the value. Both the key and its associated value are removed.</p>
/// <p>This parameter requires a JSON text string argument.</p>
/// <p>For storing multiple values, we recommend that you use a JSON text string argument and specify key/value pairs. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html">Specifying parameter values for the Amazon Web Services CLI</a> in the Amazon Web Services CLI User Guide.</p>
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tag_keys = input;
self
}
/// Consumes the builder and constructs a [`UntagResourceInput`](crate::input::UntagResourceInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::UntagResourceInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UntagResourceInput {
secret_id: self.secret_id,
tag_keys: self.tag_keys,
})
}
}
}
#[doc(hidden)]
pub type UntagResourceInputOperationOutputAlias = crate::operation::UntagResource;
#[doc(hidden)]
pub type UntagResourceInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl UntagResourceInput {
/// Consumes the builder and constructs an Operation<[`UntagResource`](crate::operation::UntagResource)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UntagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UntagResourceInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.UntagResource",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_untag_resource(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`UntagResourceInput`](crate::input::UntagResourceInput)
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
/// See [`UpdateSecretInput`](crate::input::UpdateSecretInput)
pub mod update_secret_input {
/// A builder for [`UpdateSecretInput`](crate::input::UpdateSecretInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) kms_key_id: std::option::Option<std::string::String>,
pub(crate) secret_binary: std::option::Option<aws_smithy_types::Blob>,
pub(crate) secret_string: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates a new version for the secret, and this parameter specifies the unique identifier for the new version.</p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for the new version and include the value in the request.</p>
/// </note>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
/// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates a new version for the secret, and this parameter specifies the unique identifier for the new version.</p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for the new version and include the value in the request.</p>
/// </note>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
/// <p>The description of the secret.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The description of the secret.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt new secret versions as well as any existing versions the staging labels <code>AWSCURRENT</code>, <code>AWSPENDING</code>, or <code>AWSPREVIOUS</code>. For more information about versions and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version">Concepts: Version</a>.</p> <important>
/// <p>You can only use the Amazon Web Services managed key <code>aws/secretsmanager</code> if you call this operation using credentials from the same Amazon Web Services account that owns the secret. If the secret is in a different account, then you must use a customer managed key and provide the ARN of that KMS key in this field. The user making the call must have permissions to both the secret and the KMS key in their respective accounts.</p>
/// </important>
pub fn kms_key_id(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_id = Some(input.into());
self
}
/// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt new secret versions as well as any existing versions the staging labels <code>AWSCURRENT</code>, <code>AWSPENDING</code>, or <code>AWSPREVIOUS</code>. For more information about versions and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version">Concepts: Version</a>.</p> <important>
/// <p>You can only use the Amazon Web Services managed key <code>aws/secretsmanager</code> if you call this operation using credentials from the same Amazon Web Services account that owns the secret. If the secret is in a different account, then you must use a customer managed key and provide the ARN of that KMS key in this field. The user making the call must have permissions to both the secret and the KMS key in their respective accounts.</p>
/// </important>
pub fn set_kms_key_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter. </p>
/// <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have a value, but not both.</p>
/// <p>You can't access this parameter in the Secrets Manager console.</p>
pub fn secret_binary(mut self, input: aws_smithy_types::Blob) -> Self {
self.secret_binary = Some(input);
self
}
/// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter. </p>
/// <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have a value, but not both.</p>
/// <p>You can't access this parameter in the Secrets Manager console.</p>
pub fn set_secret_binary(
mut self,
input: std::option::Option<aws_smithy_types::Blob>,
) -> Self {
self.secret_binary = input;
self
}
/// <p>The text data to encrypt and store in the new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value. </p>
/// <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have a value, but not both. </p>
pub fn secret_string(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_string = Some(input.into());
self
}
/// <p>The text data to encrypt and store in the new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value. </p>
/// <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have a value, but not both. </p>
pub fn set_secret_string(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.secret_string = input;
self
}
/// Consumes the builder and constructs a [`UpdateSecretInput`](crate::input::UpdateSecretInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::UpdateSecretInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UpdateSecretInput {
secret_id: self.secret_id,
client_request_token: self.client_request_token,
description: self.description,
kms_key_id: self.kms_key_id,
secret_binary: self.secret_binary,
secret_string: self.secret_string,
})
}
}
}
#[doc(hidden)]
pub type UpdateSecretInputOperationOutputAlias = crate::operation::UpdateSecret;
#[doc(hidden)]
pub type UpdateSecretInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl UpdateSecretInput {
/// Consumes the builder and constructs an Operation<[`UpdateSecret`](crate::operation::UpdateSecret)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateSecret,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateSecretInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateSecretInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.UpdateSecret",
);
Ok(builder)
}
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_update_secret(&self)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateSecret",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`UpdateSecretInput`](crate::input::UpdateSecretInput)
pub fn builder() -> crate::input::update_secret_input::Builder {
crate::input::update_secret_input::Builder::default()
}
}
/// See [`UpdateSecretVersionStageInput`](crate::input::UpdateSecretVersionStageInput)
pub mod update_secret_version_stage_input {
/// A builder for [`UpdateSecretVersionStageInput`](crate::input::UpdateSecretVersionStageInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) version_stage: std::option::Option<std::string::String>,
pub(crate) remove_from_version_id: std::option::Option<std::string::String>,
pub(crate) move_to_version_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ARN or the name of the secret with the version and staging labelsto modify.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>The ARN or the name of the secret with the version and staging labelsto modify.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>The staging label to add to this version.</p>
pub fn version_stage(mut self, input: impl Into<std::string::String>) -> Self {
self.version_stage = Some(input.into());
self
}
/// <p>The staging label to add to this version.</p>
pub fn set_version_stage(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.version_stage = input;
self
}
/// <p>The ID of the version that the staging label is to be removed from. If the staging label you are trying to attach to one version is already attached to a different version, then you must include this parameter and specify the version that the label is to be removed from. If the label is attached and you either do not specify this parameter, or the version ID does not match, then the operation fails.</p>
pub fn remove_from_version_id(mut self, input: impl Into<std::string::String>) -> Self {
self.remove_from_version_id = Some(input.into());
self
}
/// <p>The ID of the version that the staging label is to be removed from. If the staging label you are trying to attach to one version is already attached to a different version, then you must include this parameter and specify the version that the label is to be removed from. If the label is attached and you either do not specify this parameter, or the version ID does not match, then the operation fails.</p>
pub fn set_remove_from_version_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.remove_from_version_id = input;
self
}
/// <p>The ID of the version to add the staging label to. To remove a label from a version, then do not specify this parameter.</p>
/// <p>If the staging label is already attached to a different version of the secret, then you must also specify the <code>RemoveFromVersionId</code> parameter. </p>
pub fn move_to_version_id(mut self, input: impl Into<std::string::String>) -> Self {
self.move_to_version_id = Some(input.into());
self
}
/// <p>The ID of the version to add the staging label to. To remove a label from a version, then do not specify this parameter.</p>
/// <p>If the staging label is already attached to a different version of the secret, then you must also specify the <code>RemoveFromVersionId</code> parameter. </p>
pub fn set_move_to_version_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.move_to_version_id = input;
self
}
/// Consumes the builder and constructs a [`UpdateSecretVersionStageInput`](crate::input::UpdateSecretVersionStageInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::UpdateSecretVersionStageInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UpdateSecretVersionStageInput {
secret_id: self.secret_id,
version_stage: self.version_stage,
remove_from_version_id: self.remove_from_version_id,
move_to_version_id: self.move_to_version_id,
})
}
}
}
#[doc(hidden)]
pub type UpdateSecretVersionStageInputOperationOutputAlias =
crate::operation::UpdateSecretVersionStage;
#[doc(hidden)]
pub type UpdateSecretVersionStageInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl UpdateSecretVersionStageInput {
/// Consumes the builder and constructs an Operation<[`UpdateSecretVersionStage`](crate::operation::UpdateSecretVersionStage)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateSecretVersionStage,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateSecretVersionStageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateSecretVersionStageInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateSecretVersionStageInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.UpdateSecretVersionStage",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_update_secret_version_stage(
&self,
)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateSecretVersionStage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateSecretVersionStage",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`UpdateSecretVersionStageInput`](crate::input::UpdateSecretVersionStageInput)
pub fn builder() -> crate::input::update_secret_version_stage_input::Builder {
crate::input::update_secret_version_stage_input::Builder::default()
}
}
/// See [`ValidateResourcePolicyInput`](crate::input::ValidateResourcePolicyInput)
pub mod validate_resource_policy_input {
/// A builder for [`ValidateResourcePolicyInput`](crate::input::ValidateResourcePolicyInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) secret_id: std::option::Option<std::string::String>,
pub(crate) resource_policy: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>This field is reserved for internal use.</p>
pub fn secret_id(mut self, input: impl Into<std::string::String>) -> Self {
self.secret_id = Some(input.into());
self
}
/// <p>This field is reserved for internal use.</p>
pub fn set_secret_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.secret_id = input;
self
}
/// <p>A JSON-formatted string that contains an Amazon Web Services resource-based policy. The policy in the string identifies who can access or manage this secret and its versions. For example policies, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html">Permissions policy examples</a>.</p>
pub fn resource_policy(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_policy = Some(input.into());
self
}
/// <p>A JSON-formatted string that contains an Amazon Web Services resource-based policy. The policy in the string identifies who can access or manage this secret and its versions. For example policies, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html">Permissions policy examples</a>.</p>
pub fn set_resource_policy(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_policy = input;
self
}
/// Consumes the builder and constructs a [`ValidateResourcePolicyInput`](crate::input::ValidateResourcePolicyInput)
pub fn build(
self,
) -> std::result::Result<
crate::input::ValidateResourcePolicyInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ValidateResourcePolicyInput {
secret_id: self.secret_id,
resource_policy: self.resource_policy,
})
}
}
}
#[doc(hidden)]
pub type ValidateResourcePolicyInputOperationOutputAlias = crate::operation::ValidateResourcePolicy;
#[doc(hidden)]
pub type ValidateResourcePolicyInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl ValidateResourcePolicyInput {
/// Consumes the builder and constructs an Operation<[`ValidateResourcePolicy`](crate::operation::ValidateResourcePolicy)>
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ValidateResourcePolicy,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ValidateResourcePolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ValidateResourcePolicyInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::ValidateResourcePolicyInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"secretsmanager.ValidateResourcePolicy",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_validate_resource_policy(
&self,
)?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[allow(unused_mut)]
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ValidateResourcePolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ValidateResourcePolicy",
"secretsmanager",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
/// Creates a new builder-style object to manufacture [`ValidateResourcePolicyInput`](crate::input::ValidateResourcePolicyInput)
pub fn builder() -> crate::input::validate_resource_policy_input::Builder {
crate::input::validate_resource_policy_input::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ValidateResourcePolicyInput {
/// <p>This field is reserved for internal use.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>A JSON-formatted string that contains an Amazon Web Services resource-based policy. The policy in the string identifies who can access or manage this secret and its versions. For example policies, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html">Permissions policy examples</a>.</p>
pub resource_policy: std::option::Option<std::string::String>,
}
impl ValidateResourcePolicyInput {
/// <p>This field is reserved for internal use.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>A JSON-formatted string that contains an Amazon Web Services resource-based policy. The policy in the string identifies who can access or manage this secret and its versions. For example policies, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html">Permissions policy examples</a>.</p>
pub fn resource_policy(&self) -> std::option::Option<&str> {
self.resource_policy.as_deref()
}
}
impl std::fmt::Debug for ValidateResourcePolicyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ValidateResourcePolicyInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("resource_policy", &self.resource_policy);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateSecretVersionStageInput {
/// <p>The ARN or the name of the secret with the version and staging labelsto modify.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>The staging label to add to this version.</p>
pub version_stage: std::option::Option<std::string::String>,
/// <p>The ID of the version that the staging label is to be removed from. If the staging label you are trying to attach to one version is already attached to a different version, then you must include this parameter and specify the version that the label is to be removed from. If the label is attached and you either do not specify this parameter, or the version ID does not match, then the operation fails.</p>
pub remove_from_version_id: std::option::Option<std::string::String>,
/// <p>The ID of the version to add the staging label to. To remove a label from a version, then do not specify this parameter.</p>
/// <p>If the staging label is already attached to a different version of the secret, then you must also specify the <code>RemoveFromVersionId</code> parameter. </p>
pub move_to_version_id: std::option::Option<std::string::String>,
}
impl UpdateSecretVersionStageInput {
/// <p>The ARN or the name of the secret with the version and staging labelsto modify.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>The staging label to add to this version.</p>
pub fn version_stage(&self) -> std::option::Option<&str> {
self.version_stage.as_deref()
}
/// <p>The ID of the version that the staging label is to be removed from. If the staging label you are trying to attach to one version is already attached to a different version, then you must include this parameter and specify the version that the label is to be removed from. If the label is attached and you either do not specify this parameter, or the version ID does not match, then the operation fails.</p>
pub fn remove_from_version_id(&self) -> std::option::Option<&str> {
self.remove_from_version_id.as_deref()
}
/// <p>The ID of the version to add the staging label to. To remove a label from a version, then do not specify this parameter.</p>
/// <p>If the staging label is already attached to a different version of the secret, then you must also specify the <code>RemoveFromVersionId</code> parameter. </p>
pub fn move_to_version_id(&self) -> std::option::Option<&str> {
self.move_to_version_id.as_deref()
}
}
impl std::fmt::Debug for UpdateSecretVersionStageInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateSecretVersionStageInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("version_stage", &self.version_stage);
formatter.field("remove_from_version_id", &self.remove_from_version_id);
formatter.field("move_to_version_id", &self.move_to_version_id);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateSecretInput {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates a new version for the secret, and this parameter specifies the unique identifier for the new version.</p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for the new version and include the value in the request.</p>
/// </note>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub client_request_token: std::option::Option<std::string::String>,
/// <p>The description of the secret.</p>
pub description: std::option::Option<std::string::String>,
/// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt new secret versions as well as any existing versions the staging labels <code>AWSCURRENT</code>, <code>AWSPENDING</code>, or <code>AWSPREVIOUS</code>. For more information about versions and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version">Concepts: Version</a>.</p> <important>
/// <p>You can only use the Amazon Web Services managed key <code>aws/secretsmanager</code> if you call this operation using credentials from the same Amazon Web Services account that owns the secret. If the secret is in a different account, then you must use a customer managed key and provide the ARN of that KMS key in this field. The user making the call must have permissions to both the secret and the KMS key in their respective accounts.</p>
/// </important>
pub kms_key_id: std::option::Option<std::string::String>,
/// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter. </p>
/// <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have a value, but not both.</p>
/// <p>You can't access this parameter in the Secrets Manager console.</p>
pub secret_binary: std::option::Option<aws_smithy_types::Blob>,
/// <p>The text data to encrypt and store in the new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value. </p>
/// <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have a value, but not both. </p>
pub secret_string: std::option::Option<std::string::String>,
}
impl UpdateSecretInput {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates a new version for the secret, and this parameter specifies the unique identifier for the new version.</p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for the new version and include the value in the request.</p>
/// </note>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
/// <p>The description of the secret.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt new secret versions as well as any existing versions the staging labels <code>AWSCURRENT</code>, <code>AWSPENDING</code>, or <code>AWSPREVIOUS</code>. For more information about versions and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version">Concepts: Version</a>.</p> <important>
/// <p>You can only use the Amazon Web Services managed key <code>aws/secretsmanager</code> if you call this operation using credentials from the same Amazon Web Services account that owns the secret. If the secret is in a different account, then you must use a customer managed key and provide the ARN of that KMS key in this field. The user making the call must have permissions to both the secret and the KMS key in their respective accounts.</p>
/// </important>
pub fn kms_key_id(&self) -> std::option::Option<&str> {
self.kms_key_id.as_deref()
}
/// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter. </p>
/// <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have a value, but not both.</p>
/// <p>You can't access this parameter in the Secrets Manager console.</p>
pub fn secret_binary(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.secret_binary.as_ref()
}
/// <p>The text data to encrypt and store in the new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value. </p>
/// <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have a value, but not both. </p>
pub fn secret_string(&self) -> std::option::Option<&str> {
self.secret_string.as_deref()
}
}
impl std::fmt::Debug for UpdateSecretInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateSecretInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("client_request_token", &self.client_request_token);
formatter.field("description", &self.description);
formatter.field("kms_key_id", &self.kms_key_id);
formatter.field("secret_binary", &"*** Sensitive Data Redacted ***");
formatter.field("secret_string", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UntagResourceInput {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>A list of tag key names to remove from the secret. You don't specify the value. Both the key and its associated value are removed.</p>
/// <p>This parameter requires a JSON text string argument.</p>
/// <p>For storing multiple values, we recommend that you use a JSON text string argument and specify key/value pairs. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html">Specifying parameter values for the Amazon Web Services CLI</a> in the Amazon Web Services CLI User Guide.</p>
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UntagResourceInput {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>A list of tag key names to remove from the secret. You don't specify the value. Both the key and its associated value are removed.</p>
/// <p>This parameter requires a JSON text string argument.</p>
/// <p>For storing multiple values, we recommend that you use a JSON text string argument and specify key/value pairs. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html">Specifying parameter values for the Amazon Web Services CLI</a> in the Amazon Web Services CLI User Guide.</p>
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
impl std::fmt::Debug for UntagResourceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UntagResourceInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("tag_keys", &self.tag_keys);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TagResourceInput {
/// <p>The identifier for the secret to attach tags to. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>The tags to attach to the secret as a JSON text string argument. Each element in the list consists of a <code>Key</code> and a <code>Value</code>.</p>
/// <p>For storing multiple values, we recommend that you use a JSON text string argument and specify key/value pairs. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html">Specifying parameter values for the Amazon Web Services CLI</a> in the Amazon Web Services CLI User Guide.</p>
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl TagResourceInput {
/// <p>The identifier for the secret to attach tags to. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>The tags to attach to the secret as a JSON text string argument. Each element in the list consists of a <code>Key</code> and a <code>Value</code>.</p>
/// <p>For storing multiple values, we recommend that you use a JSON text string argument and specify key/value pairs. For more information, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html">Specifying parameter values for the Amazon Web Services CLI</a> in the Amazon Web Services CLI User Guide.</p>
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
}
impl std::fmt::Debug for TagResourceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TagResourceInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct StopReplicationToReplicaInput {
/// <p>The ARN of the primary secret. </p>
pub secret_id: std::option::Option<std::string::String>,
}
impl StopReplicationToReplicaInput {
/// <p>The ARN of the primary secret. </p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
}
impl std::fmt::Debug for StopReplicationToReplicaInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("StopReplicationToReplicaInput");
formatter.field("secret_id", &self.secret_id);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct RotateSecretInput {
/// <p>The ARN or name of the secret to rotate.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during rotation. This value becomes the <code>VersionId</code> of the new version.</p>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request for this parameter. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for new versions and include that value in the request.</p>
/// <p>You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness within the specified secret. </p>
pub client_request_token: std::option::Option<std::string::String>,
/// <p>The ARN of the Lambda rotation function that can rotate the secret.</p>
pub rotation_lambda_arn: std::option::Option<std::string::String>,
/// <p>A structure that defines the rotation configuration for this secret.</p>
pub rotation_rules: std::option::Option<crate::model::RotationRulesType>,
}
impl RotateSecretInput {
/// <p>The ARN or name of the secret to rotate.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during rotation. This value becomes the <code>VersionId</code> of the new version.</p>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request for this parameter. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for new versions and include that value in the request.</p>
/// <p>You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness within the specified secret. </p>
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
/// <p>The ARN of the Lambda rotation function that can rotate the secret.</p>
pub fn rotation_lambda_arn(&self) -> std::option::Option<&str> {
self.rotation_lambda_arn.as_deref()
}
/// <p>A structure that defines the rotation configuration for this secret.</p>
pub fn rotation_rules(&self) -> std::option::Option<&crate::model::RotationRulesType> {
self.rotation_rules.as_ref()
}
}
impl std::fmt::Debug for RotateSecretInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("RotateSecretInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("client_request_token", &self.client_request_token);
formatter.field("rotation_lambda_arn", &self.rotation_lambda_arn);
formatter.field("rotation_rules", &self.rotation_rules);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct RestoreSecretInput {
/// <p>The ARN or name of the secret to restore.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
}
impl RestoreSecretInput {
/// <p>The ARN or name of the secret to restore.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
}
impl std::fmt::Debug for RestoreSecretInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("RestoreSecretInput");
formatter.field("secret_id", &self.secret_id);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ReplicateSecretToRegionsInput {
/// <p>The ARN or name of the secret to replicate.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>A list of Regions in which to replicate the secret.</p>
pub add_replica_regions: std::option::Option<std::vec::Vec<crate::model::ReplicaRegionType>>,
/// <p>Specifies whether to overwrite a secret with the same name in the destination Region.</p>
pub force_overwrite_replica_secret: bool,
}
impl ReplicateSecretToRegionsInput {
/// <p>The ARN or name of the secret to replicate.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>A list of Regions in which to replicate the secret.</p>
pub fn add_replica_regions(&self) -> std::option::Option<&[crate::model::ReplicaRegionType]> {
self.add_replica_regions.as_deref()
}
/// <p>Specifies whether to overwrite a secret with the same name in the destination Region.</p>
pub fn force_overwrite_replica_secret(&self) -> bool {
self.force_overwrite_replica_secret
}
}
impl std::fmt::Debug for ReplicateSecretToRegionsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ReplicateSecretToRegionsInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("add_replica_regions", &self.add_replica_regions);
formatter.field(
"force_overwrite_replica_secret",
&self.force_overwrite_replica_secret,
);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct RemoveRegionsFromReplicationInput {
/// <p>The ARN or name of the secret.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>The Regions of the replicas to remove.</p>
pub remove_replica_regions: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl RemoveRegionsFromReplicationInput {
/// <p>The ARN or name of the secret.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>The Regions of the replicas to remove.</p>
pub fn remove_replica_regions(&self) -> std::option::Option<&[std::string::String]> {
self.remove_replica_regions.as_deref()
}
}
impl std::fmt::Debug for RemoveRegionsFromReplicationInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("RemoveRegionsFromReplicationInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("remove_replica_regions", &self.remove_replica_regions);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PutSecretValueInput {
/// <p>The ARN or name of the secret to add a new version to.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
/// <p>If the secret doesn't already exist, use <code>CreateSecret</code> instead.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>A unique identifier for the new version of the secret. </p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty because they generate a random UUID for you. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for new versions and include that value in the request. </p>
/// </note>
/// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during the Lambda rotation function processing. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness within the specified secret. </p>
/// <ul>
/// <li> <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created. </p> </li>
/// <li> <p>If a version with this value already exists and that version's <code>SecretString</code> or <code>SecretBinary</code> values are the same as those in the request then the request is ignored. The operation is idempotent. </p> </li>
/// <li> <p>If a version with this value already exists and the version of the <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you can't modify a secret version. You can only create new versions to store new secret values.</p> </li>
/// </ul>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub client_request_token: std::option::Option<std::string::String>,
/// <p>The binary data to encrypt and store in the new version of the secret. To use this parameter in the command-line tools, we recommend that you store your binary data in a file and then pass the contents of the file as a parameter. </p>
/// <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
/// <p>You can't access this value from the Secrets Manager console.</p>
pub secret_binary: std::option::Option<aws_smithy_types::Blob>,
/// <p>The text to encrypt and store in the new version of the secret. </p>
/// <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
/// <p>We recommend you create the secret string as JSON key/value pairs, as shown in the example.</p>
pub secret_string: std::option::Option<std::string::String>,
/// <p>A list of staging labels to attach to this version of the secret. Secrets Manager uses staging labels to track versions of a secret through the rotation process.</p>
/// <p>If you specify a staging label that's already associated with a different version of the same secret, then Secrets Manager removes the label from the other version and attaches it to this version. If you specify <code>AWSCURRENT</code>, and it is already attached to another version, then Secrets Manager also moves the staging label <code>AWSPREVIOUS</code> to the version that <code>AWSCURRENT</code> was removed from.</p>
/// <p>If you don't include <code>VersionStages</code>, then Secrets Manager automatically moves the staging label <code>AWSCURRENT</code> to this version.</p>
pub version_stages: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl PutSecretValueInput {
/// <p>The ARN or name of the secret to add a new version to.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
/// <p>If the secret doesn't already exist, use <code>CreateSecret</code> instead.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>A unique identifier for the new version of the secret. </p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty because they generate a random UUID for you. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for new versions and include that value in the request. </p>
/// </note>
/// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during the Lambda rotation function processing. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness within the specified secret. </p>
/// <ul>
/// <li> <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created. </p> </li>
/// <li> <p>If a version with this value already exists and that version's <code>SecretString</code> or <code>SecretBinary</code> values are the same as those in the request then the request is ignored. The operation is idempotent. </p> </li>
/// <li> <p>If a version with this value already exists and the version of the <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you can't modify a secret version. You can only create new versions to store new secret values.</p> </li>
/// </ul>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
/// <p>The binary data to encrypt and store in the new version of the secret. To use this parameter in the command-line tools, we recommend that you store your binary data in a file and then pass the contents of the file as a parameter. </p>
/// <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
/// <p>You can't access this value from the Secrets Manager console.</p>
pub fn secret_binary(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.secret_binary.as_ref()
}
/// <p>The text to encrypt and store in the new version of the secret. </p>
/// <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
/// <p>We recommend you create the secret string as JSON key/value pairs, as shown in the example.</p>
pub fn secret_string(&self) -> std::option::Option<&str> {
self.secret_string.as_deref()
}
/// <p>A list of staging labels to attach to this version of the secret. Secrets Manager uses staging labels to track versions of a secret through the rotation process.</p>
/// <p>If you specify a staging label that's already associated with a different version of the same secret, then Secrets Manager removes the label from the other version and attaches it to this version. If you specify <code>AWSCURRENT</code>, and it is already attached to another version, then Secrets Manager also moves the staging label <code>AWSPREVIOUS</code> to the version that <code>AWSCURRENT</code> was removed from.</p>
/// <p>If you don't include <code>VersionStages</code>, then Secrets Manager automatically moves the staging label <code>AWSCURRENT</code> to this version.</p>
pub fn version_stages(&self) -> std::option::Option<&[std::string::String]> {
self.version_stages.as_deref()
}
}
impl std::fmt::Debug for PutSecretValueInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PutSecretValueInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("client_request_token", &self.client_request_token);
formatter.field("secret_binary", &"*** Sensitive Data Redacted ***");
formatter.field("secret_string", &"*** Sensitive Data Redacted ***");
formatter.field("version_stages", &self.version_stages);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PutResourcePolicyInput {
/// <p>The ARN or name of the secret to attach the resource-based policy.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>A JSON-formatted string for an Amazon Web Services resource-based policy. For example policies, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html">Permissions policy examples</a>.</p>
pub resource_policy: std::option::Option<std::string::String>,
/// <p>Specifies whether to block resource-based policies that allow broad access to the secret. By default, Secrets Manager blocks policies that allow broad access, for example those that use a wildcard for the principal.</p>
pub block_public_policy: std::option::Option<bool>,
}
impl PutResourcePolicyInput {
/// <p>The ARN or name of the secret to attach the resource-based policy.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>A JSON-formatted string for an Amazon Web Services resource-based policy. For example policies, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html">Permissions policy examples</a>.</p>
pub fn resource_policy(&self) -> std::option::Option<&str> {
self.resource_policy.as_deref()
}
/// <p>Specifies whether to block resource-based policies that allow broad access to the secret. By default, Secrets Manager blocks policies that allow broad access, for example those that use a wildcard for the principal.</p>
pub fn block_public_policy(&self) -> std::option::Option<bool> {
self.block_public_policy
}
}
impl std::fmt::Debug for PutResourcePolicyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PutResourcePolicyInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("resource_policy", &self.resource_policy);
formatter.field("block_public_policy", &self.block_public_policy);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListSecretVersionIdsInput {
/// <p>The ARN or name of the secret whose versions you want to list.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>The number of results to include in the response.</p>
/// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecretVersionIds</code> again with the value from <code>NextToken</code>. </p>
pub max_results: std::option::Option<i32>,
/// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecretVersionIds</code> again with this value.</p>
pub next_token: std::option::Option<std::string::String>,
/// <p>Specifies whether to include versions of secrets that don't have any staging labels attached to them. Versions without staging labels are considered deprecated and are subject to deletion by Secrets Manager.</p>
pub include_deprecated: std::option::Option<bool>,
}
impl ListSecretVersionIdsInput {
/// <p>The ARN or name of the secret whose versions you want to list.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>The number of results to include in the response.</p>
/// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecretVersionIds</code> again with the value from <code>NextToken</code>. </p>
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
/// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecretVersionIds</code> again with this value.</p>
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
/// <p>Specifies whether to include versions of secrets that don't have any staging labels attached to them. Versions without staging labels are considered deprecated and are subject to deletion by Secrets Manager.</p>
pub fn include_deprecated(&self) -> std::option::Option<bool> {
self.include_deprecated
}
}
impl std::fmt::Debug for ListSecretVersionIdsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListSecretVersionIdsInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.field("include_deprecated", &self.include_deprecated);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListSecretsInput {
/// <p>The number of results to include in the response.</p>
/// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
pub max_results: std::option::Option<i32>,
/// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
pub next_token: std::option::Option<std::string::String>,
/// <p>The filters to apply to the list of secrets.</p>
pub filters: std::option::Option<std::vec::Vec<crate::model::Filter>>,
/// <p>Lists secrets in the requested order. </p>
pub sort_order: std::option::Option<crate::model::SortOrderType>,
}
impl ListSecretsInput {
/// <p>The number of results to include in the response.</p>
/// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
/// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
/// <p>The filters to apply to the list of secrets.</p>
pub fn filters(&self) -> std::option::Option<&[crate::model::Filter]> {
self.filters.as_deref()
}
/// <p>Lists secrets in the requested order. </p>
pub fn sort_order(&self) -> std::option::Option<&crate::model::SortOrderType> {
self.sort_order.as_ref()
}
}
impl std::fmt::Debug for ListSecretsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListSecretsInput");
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.field("filters", &self.filters);
formatter.field("sort_order", &self.sort_order);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetSecretValueInput {
/// <p>The ARN or name of the secret to retrieve.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>The unique identifier of the version of the secret to retrieve. If you include both this parameter and <code>VersionStage</code>, the two parameters must refer to the same secret version. If you don't specify either a <code>VersionStage</code> or <code>VersionId</code>, then Secrets Manager returns the <code>AWSCURRENT</code> version.</p>
/// <p>This value is typically a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value with 32 hexadecimal digits.</p>
pub version_id: std::option::Option<std::string::String>,
/// <p>The staging label of the version of the secret to retrieve. </p>
/// <p>Secrets Manager uses staging labels to keep track of different versions during the rotation process. If you include both this parameter and <code>VersionId</code>, the two parameters must refer to the same secret version. If you don't specify either a <code>VersionStage</code> or <code>VersionId</code>, Secrets Manager returns the <code>AWSCURRENT</code> version.</p>
pub version_stage: std::option::Option<std::string::String>,
}
impl GetSecretValueInput {
/// <p>The ARN or name of the secret to retrieve.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>The unique identifier of the version of the secret to retrieve. If you include both this parameter and <code>VersionStage</code>, the two parameters must refer to the same secret version. If you don't specify either a <code>VersionStage</code> or <code>VersionId</code>, then Secrets Manager returns the <code>AWSCURRENT</code> version.</p>
/// <p>This value is typically a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value with 32 hexadecimal digits.</p>
pub fn version_id(&self) -> std::option::Option<&str> {
self.version_id.as_deref()
}
/// <p>The staging label of the version of the secret to retrieve. </p>
/// <p>Secrets Manager uses staging labels to keep track of different versions during the rotation process. If you include both this parameter and <code>VersionId</code>, the two parameters must refer to the same secret version. If you don't specify either a <code>VersionStage</code> or <code>VersionId</code>, Secrets Manager returns the <code>AWSCURRENT</code> version.</p>
pub fn version_stage(&self) -> std::option::Option<&str> {
self.version_stage.as_deref()
}
}
impl std::fmt::Debug for GetSecretValueInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetSecretValueInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("version_id", &self.version_id);
formatter.field("version_stage", &self.version_stage);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetResourcePolicyInput {
/// <p>The ARN or name of the secret to retrieve the attached resource-based policy for.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
}
impl GetResourcePolicyInput {
/// <p>The ARN or name of the secret to retrieve the attached resource-based policy for.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
}
impl std::fmt::Debug for GetResourcePolicyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetResourcePolicyInput");
formatter.field("secret_id", &self.secret_id);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetRandomPasswordInput {
/// <p>The length of the password. If you don't include this parameter, the default length is 32 characters.</p>
pub password_length: std::option::Option<i64>,
/// <p>A string of the characters that you don't want in the password.</p>
pub exclude_characters: std::option::Option<std::string::String>,
/// <p>Specifies whether to exclude numbers from the password. If you don't include this switch, the password can contain numbers.</p>
pub exclude_numbers: std::option::Option<bool>,
/// <p>Specifies whether to exclude the following punctuation characters from the password: <code>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~</code>. If you don't include this switch, the password can contain punctuation.</p>
pub exclude_punctuation: std::option::Option<bool>,
/// <p>Specifies whether to exclude uppercase letters from the password. If you don't include this switch, the password can contain uppercase letters.</p>
pub exclude_uppercase: std::option::Option<bool>,
/// <p>Specifies whether to exclude lowercase letters from the password. If you don't include this switch, the password can contain lowercase letters.</p>
pub exclude_lowercase: std::option::Option<bool>,
/// <p>Specifies whether to include the space character. If you include this switch, the password can contain space characters.</p>
pub include_space: std::option::Option<bool>,
/// <p>Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. If you don't include this switch, the password contains at least one of every character type.</p>
pub require_each_included_type: std::option::Option<bool>,
}
impl GetRandomPasswordInput {
/// <p>The length of the password. If you don't include this parameter, the default length is 32 characters.</p>
pub fn password_length(&self) -> std::option::Option<i64> {
self.password_length
}
/// <p>A string of the characters that you don't want in the password.</p>
pub fn exclude_characters(&self) -> std::option::Option<&str> {
self.exclude_characters.as_deref()
}
/// <p>Specifies whether to exclude numbers from the password. If you don't include this switch, the password can contain numbers.</p>
pub fn exclude_numbers(&self) -> std::option::Option<bool> {
self.exclude_numbers
}
/// <p>Specifies whether to exclude the following punctuation characters from the password: <code>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~</code>. If you don't include this switch, the password can contain punctuation.</p>
pub fn exclude_punctuation(&self) -> std::option::Option<bool> {
self.exclude_punctuation
}
/// <p>Specifies whether to exclude uppercase letters from the password. If you don't include this switch, the password can contain uppercase letters.</p>
pub fn exclude_uppercase(&self) -> std::option::Option<bool> {
self.exclude_uppercase
}
/// <p>Specifies whether to exclude lowercase letters from the password. If you don't include this switch, the password can contain lowercase letters.</p>
pub fn exclude_lowercase(&self) -> std::option::Option<bool> {
self.exclude_lowercase
}
/// <p>Specifies whether to include the space character. If you include this switch, the password can contain space characters.</p>
pub fn include_space(&self) -> std::option::Option<bool> {
self.include_space
}
/// <p>Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. If you don't include this switch, the password contains at least one of every character type.</p>
pub fn require_each_included_type(&self) -> std::option::Option<bool> {
self.require_each_included_type
}
}
impl std::fmt::Debug for GetRandomPasswordInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetRandomPasswordInput");
formatter.field("password_length", &self.password_length);
formatter.field("exclude_characters", &self.exclude_characters);
formatter.field("exclude_numbers", &self.exclude_numbers);
formatter.field("exclude_punctuation", &self.exclude_punctuation);
formatter.field("exclude_uppercase", &self.exclude_uppercase);
formatter.field("exclude_lowercase", &self.exclude_lowercase);
formatter.field("include_space", &self.include_space);
formatter.field(
"require_each_included_type",
&self.require_each_included_type,
);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DescribeSecretInput {
/// <p>The ARN or name of the secret. </p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
}
impl DescribeSecretInput {
/// <p>The ARN or name of the secret. </p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
}
impl std::fmt::Debug for DescribeSecretInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DescribeSecretInput");
formatter.field("secret_id", &self.secret_id);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteSecretInput {
/// <p>The ARN or name of the secret to delete.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
/// <p>The number of days from 7 to 30 that Secrets Manager waits before permanently deleting the secret. You can't use both this parameter and <code>ForceDeleteWithoutRecovery</code> in the same call. If you don't use either, then Secrets Manager defaults to a 30 day recovery window.</p>
pub recovery_window_in_days: std::option::Option<i64>,
/// <p>Specifies whether to delete the secret without any recovery window. You can't use both this parameter and <code>RecoveryWindowInDays</code> in the same call. If you don't use either, then Secrets Manager defaults to a 30 day recovery window.</p>
/// <p>Secrets Manager performs the actual deletion with an asynchronous background process, so there might be a short delay before the secret is permanently deleted. If you delete a secret and then immediately create a secret with the same name, use appropriate back off and retry logic.</p> <important>
/// <p>Use this parameter with caution. This parameter causes the operation to skip the normal recovery window before the permanent deletion that Secrets Manager would normally impose with the <code>RecoveryWindowInDays</code> parameter. If you delete a secret with the <code>ForceDeleteWithouRecovery</code> parameter, then you have no opportunity to recover the secret. You lose the secret permanently.</p>
/// </important>
pub force_delete_without_recovery: std::option::Option<bool>,
}
impl DeleteSecretInput {
/// <p>The ARN or name of the secret to delete.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
/// <p>The number of days from 7 to 30 that Secrets Manager waits before permanently deleting the secret. You can't use both this parameter and <code>ForceDeleteWithoutRecovery</code> in the same call. If you don't use either, then Secrets Manager defaults to a 30 day recovery window.</p>
pub fn recovery_window_in_days(&self) -> std::option::Option<i64> {
self.recovery_window_in_days
}
/// <p>Specifies whether to delete the secret without any recovery window. You can't use both this parameter and <code>RecoveryWindowInDays</code> in the same call. If you don't use either, then Secrets Manager defaults to a 30 day recovery window.</p>
/// <p>Secrets Manager performs the actual deletion with an asynchronous background process, so there might be a short delay before the secret is permanently deleted. If you delete a secret and then immediately create a secret with the same name, use appropriate back off and retry logic.</p> <important>
/// <p>Use this parameter with caution. This parameter causes the operation to skip the normal recovery window before the permanent deletion that Secrets Manager would normally impose with the <code>RecoveryWindowInDays</code> parameter. If you delete a secret with the <code>ForceDeleteWithouRecovery</code> parameter, then you have no opportunity to recover the secret. You lose the secret permanently.</p>
/// </important>
pub fn force_delete_without_recovery(&self) -> std::option::Option<bool> {
self.force_delete_without_recovery
}
}
impl std::fmt::Debug for DeleteSecretInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteSecretInput");
formatter.field("secret_id", &self.secret_id);
formatter.field("recovery_window_in_days", &self.recovery_window_in_days);
formatter.field(
"force_delete_without_recovery",
&self.force_delete_without_recovery,
);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteResourcePolicyInput {
/// <p>The ARN or name of the secret to delete the attached resource-based policy for.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
}
impl DeleteResourcePolicyInput {
/// <p>The ARN or name of the secret to delete the attached resource-based policy for.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
}
impl std::fmt::Debug for DeleteResourcePolicyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteResourcePolicyInput");
formatter.field("secret_id", &self.secret_id);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateSecretInput {
/// <p>The name of the new secret.</p>
/// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
/// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
pub name: std::option::Option<std::string::String>,
/// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version. </p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for the new version and include the value in the request.</p>
/// </note>
/// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret. </p>
/// <ul>
/// <li> <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created. </p> </li>
/// <li> <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p> </li>
/// <li> <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p> </li>
/// </ul>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub client_request_token: std::option::Option<std::string::String>,
/// <p>The description of the secret.</p>
pub description: std::option::Option<std::string::String>,
/// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret.</p>
/// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
/// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
/// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key. </p>
pub kms_key_id: std::option::Option<std::string::String>,
/// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
/// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
/// <p>This parameter is not available in the Secrets Manager console.</p>
pub secret_binary: std::option::Option<aws_smithy_types::Blob>,
/// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
/// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
/// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
pub secret_string: std::option::Option<std::string::String>,
/// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
/// <p> <code>[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}]</code> </p>
/// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
/// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
/// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
/// <p>The following restrictions apply to tags:</p>
/// <ul>
/// <li> <p>Maximum number of tags per secret: 50</p> </li>
/// <li> <p>Maximum key length: 127 Unicode characters in UTF-8</p> </li>
/// <li> <p>Maximum value length: 255 Unicode characters in UTF-8</p> </li>
/// <li> <p>Tag keys and values are case sensitive.</p> </li>
/// <li> <p>Do not use the <code>aws:</code> prefix in your tag names or values because Amazon Web Services reserves it for Amazon Web Services use. You can't edit or delete tag names or values with this prefix. Tags with this prefix do not count against your tags per secret limit.</p> </li>
/// <li> <p>If you use your tagging schema across multiple services and resources, other services might have restrictions on allowed characters. Generally allowed characters: letters, spaces, and numbers representable in UTF-8, plus the following special characters: + - = . _ : / @.</p> </li>
/// </ul>
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
/// <p>A list of Regions and KMS keys to replicate secrets.</p>
pub add_replica_regions: std::option::Option<std::vec::Vec<crate::model::ReplicaRegionType>>,
/// <p>Specifies whether to overwrite a secret with the same name in the destination Region.</p>
pub force_overwrite_replica_secret: bool,
}
impl CreateSecretInput {
/// <p>The name of the new secret.</p>
/// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
/// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version. </p> <note>
/// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> yourself for the new version and include the value in the request.</p>
/// </note>
/// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret. </p>
/// <ul>
/// <li> <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created. </p> </li>
/// <li> <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p> </li>
/// <li> <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p> </li>
/// </ul>
/// <p>This value becomes the <code>VersionId</code> of the new version.</p>
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
/// <p>The description of the secret.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret.</p>
/// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
/// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
/// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key. </p>
pub fn kms_key_id(&self) -> std::option::Option<&str> {
self.kms_key_id.as_deref()
}
/// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
/// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
/// <p>This parameter is not available in the Secrets Manager console.</p>
pub fn secret_binary(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.secret_binary.as_ref()
}
/// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
/// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
/// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
pub fn secret_string(&self) -> std::option::Option<&str> {
self.secret_string.as_deref()
}
/// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
/// <p> <code>[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}]</code> </p>
/// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
/// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
/// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
/// <p>The following restrictions apply to tags:</p>
/// <ul>
/// <li> <p>Maximum number of tags per secret: 50</p> </li>
/// <li> <p>Maximum key length: 127 Unicode characters in UTF-8</p> </li>
/// <li> <p>Maximum value length: 255 Unicode characters in UTF-8</p> </li>
/// <li> <p>Tag keys and values are case sensitive.</p> </li>
/// <li> <p>Do not use the <code>aws:</code> prefix in your tag names or values because Amazon Web Services reserves it for Amazon Web Services use. You can't edit or delete tag names or values with this prefix. Tags with this prefix do not count against your tags per secret limit.</p> </li>
/// <li> <p>If you use your tagging schema across multiple services and resources, other services might have restrictions on allowed characters. Generally allowed characters: letters, spaces, and numbers representable in UTF-8, plus the following special characters: + - = . _ : / @.</p> </li>
/// </ul>
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
/// <p>A list of Regions and KMS keys to replicate secrets.</p>
pub fn add_replica_regions(&self) -> std::option::Option<&[crate::model::ReplicaRegionType]> {
self.add_replica_regions.as_deref()
}
/// <p>Specifies whether to overwrite a secret with the same name in the destination Region.</p>
pub fn force_overwrite_replica_secret(&self) -> bool {
self.force_overwrite_replica_secret
}
}
impl std::fmt::Debug for CreateSecretInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateSecretInput");
formatter.field("name", &self.name);
formatter.field("client_request_token", &self.client_request_token);
formatter.field("description", &self.description);
formatter.field("kms_key_id", &self.kms_key_id);
formatter.field("secret_binary", &"*** Sensitive Data Redacted ***");
formatter.field("secret_string", &"*** Sensitive Data Redacted ***");
formatter.field("tags", &self.tags);
formatter.field("add_replica_regions", &self.add_replica_regions);
formatter.field(
"force_overwrite_replica_secret",
&self.force_overwrite_replica_secret,
);
formatter.finish()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CancelRotateSecretInput {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub secret_id: std::option::Option<std::string::String>,
}
impl CancelRotateSecretInput {
/// <p>The ARN or name of the secret.</p>
/// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.</p>
pub fn secret_id(&self) -> std::option::Option<&str> {
self.secret_id.as_deref()
}
}
impl std::fmt::Debug for CancelRotateSecretInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CancelRotateSecretInput");
formatter.field("secret_id", &self.secret_id);
formatter.finish()
}
}