// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::delete_certificate_authority::_delete_certificate_authority_output::DeleteCertificateAuthorityOutputBuilder;
pub use crate::operation::delete_certificate_authority::_delete_certificate_authority_input::DeleteCertificateAuthorityInputBuilder;
impl crate::operation::delete_certificate_authority::builders::DeleteCertificateAuthorityInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.delete_certificate_authority();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `DeleteCertificateAuthority`.
///
/// <p>Deletes a private certificate authority (CA). You must provide the Amazon Resource Name (ARN) of the private CA that you want to delete. You can find the ARN by calling the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action.</p><note>
/// <p>Deleting a CA will invalidate other CAs and certificates below it in your CA hierarchy.</p>
/// </note>
/// <p>Before you can delete a CA that you have created and activated, you must disable it. To do this, call the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_UpdateCertificateAuthority.html">UpdateCertificateAuthority</a> action and set the <b>CertificateAuthorityStatus</b> parameter to <code>DISABLED</code>.</p>
/// <p>Additionally, you can delete a CA if you are waiting for it to be created (that is, the status of the CA is <code>CREATING</code>). You can also delete it if the CA has been created but you haven't yet imported the signed certificate into Amazon Web Services Private CA (that is, the status of the CA is <code>PENDING_CERTIFICATE</code>).</p>
/// <p>When you successfully call <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_DeleteCertificateAuthority.html">DeleteCertificateAuthority</a>, the CA's status changes to <code>DELETED</code>. However, the CA won't be permanently deleted until the restoration period has passed. By default, if you do not set the <code>PermanentDeletionTimeInDays</code> parameter, the CA remains restorable for 30 days. You can set the parameter from 7 to 30 days. The <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_DescribeCertificateAuthority.html">DescribeCertificateAuthority</a> action returns the time remaining in the restoration window of a private CA in the <code>DELETED</code> state. To restore an eligible CA, call the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_RestoreCertificateAuthority.html">RestoreCertificateAuthority</a> action.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DeleteCertificateAuthorityFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::delete_certificate_authority::builders::DeleteCertificateAuthorityInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityOutput,
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityError,
> for DeleteCertificateAuthorityFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityOutput,
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl DeleteCertificateAuthorityFluentBuilder {
/// Creates a new `DeleteCertificateAuthorityFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the DeleteCertificateAuthority as a reference.
pub fn as_input(&self) -> &crate::operation::delete_certificate_authority::builders::DeleteCertificateAuthorityInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::delete_certificate_authority::DeleteCertificateAuthority::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::delete_certificate_authority::DeleteCertificateAuthority::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityOutput,
crate::operation::delete_certificate_authority::DeleteCertificateAuthorityError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must have the following form:</p>
/// <p><code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>.</p>
pub fn certificate_authority_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.certificate_authority_arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must have the following form:</p>
/// <p><code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>.</p>
pub fn set_certificate_authority_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_certificate_authority_arn(input);
self
}
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must have the following form:</p>
/// <p><code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>.</p>
pub fn get_certificate_authority_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_certificate_authority_arn()
}
/// <p>The number of days to make a CA restorable after it has been deleted. This can be anywhere from 7 to 30 days, with 30 being the default.</p>
pub fn permanent_deletion_time_in_days(mut self, input: i32) -> Self {
self.inner = self.inner.permanent_deletion_time_in_days(input);
self
}
/// <p>The number of days to make a CA restorable after it has been deleted. This can be anywhere from 7 to 30 days, with 30 being the default.</p>
pub fn set_permanent_deletion_time_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_permanent_deletion_time_in_days(input);
self
}
/// <p>The number of days to make a CA restorable after it has been deleted. This can be anywhere from 7 to 30 days, with 30 being the default.</p>
pub fn get_permanent_deletion_time_in_days(&self) -> &::std::option::Option<i32> {
self.inner.get_permanent_deletion_time_in_days()
}
}