// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_certificate_authority::_create_certificate_authority_output::CreateCertificateAuthorityOutputBuilder;
pub use crate::operation::create_certificate_authority::_create_certificate_authority_input::CreateCertificateAuthorityInputBuilder;
impl crate::operation::create_certificate_authority::builders::CreateCertificateAuthorityInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::create_certificate_authority::CreateCertificateAuthorityOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_certificate_authority::CreateCertificateAuthorityError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_certificate_authority();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateCertificateAuthority`.
///
/// <p>Creates a root or subordinate private certificate authority (CA). You must specify the CA configuration, an optional configuration for Online Certificate Status Protocol (OCSP) and/or a certificate revocation list (CRL), the CA type, and an optional idempotency token to avoid accidental creation of multiple CAs. The CA configuration specifies the name of the algorithm and key size to be used to create the CA private key, the type of signing algorithm that the CA uses, and X.500 subject information. The OCSP configuration can optionally specify a custom URL for the OCSP responder. The CRL configuration specifies the CRL expiration period in days (the validity period of the CRL), the Amazon S3 bucket that will contain the CRL, and a CNAME alias for the S3 bucket that is included in certificates issued by the CA. If successful, this action returns the Amazon Resource Name (ARN) of the CA.</p><note>
/// <p>Both Amazon Web Services Private CA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/crl-planning.html#s3-policies">Access policies for CRLs in Amazon S3</a>.</p>
/// </note>
/// <p>Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/crl-planning.html#crl-encryption">Encrypting Your CRLs</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateCertificateAuthorityFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_certificate_authority::builders::CreateCertificateAuthorityInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_certificate_authority::CreateCertificateAuthorityOutput,
crate::operation::create_certificate_authority::CreateCertificateAuthorityError,
> for CreateCertificateAuthorityFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_certificate_authority::CreateCertificateAuthorityOutput,
crate::operation::create_certificate_authority::CreateCertificateAuthorityError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateCertificateAuthorityFluentBuilder {
/// Creates a new `CreateCertificateAuthorityFluentBuilder`.
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 CreateCertificateAuthority as a reference.
pub fn as_input(&self) -> &crate::operation::create_certificate_authority::builders::CreateCertificateAuthorityInputBuilder {
&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::create_certificate_authority::CreateCertificateAuthorityOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_certificate_authority::CreateCertificateAuthorityError,
::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::create_certificate_authority::CreateCertificateAuthority::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_certificate_authority::CreateCertificateAuthority::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::create_certificate_authority::CreateCertificateAuthorityOutput,
crate::operation::create_certificate_authority::CreateCertificateAuthorityError,
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>Name and bit size of the private key algorithm, the name of the signing algorithm, and X.500 certificate subject information.</p>
pub fn certificate_authority_configuration(mut self, input: crate::types::CertificateAuthorityConfiguration) -> Self {
self.inner = self.inner.certificate_authority_configuration(input);
self
}
/// <p>Name and bit size of the private key algorithm, the name of the signing algorithm, and X.500 certificate subject information.</p>
pub fn set_certificate_authority_configuration(mut self, input: ::std::option::Option<crate::types::CertificateAuthorityConfiguration>) -> Self {
self.inner = self.inner.set_certificate_authority_configuration(input);
self
}
/// <p>Name and bit size of the private key algorithm, the name of the signing algorithm, and X.500 certificate subject information.</p>
pub fn get_certificate_authority_configuration(&self) -> &::std::option::Option<crate::types::CertificateAuthorityConfiguration> {
self.inner.get_certificate_authority_configuration()
}
/// <p>Contains information to enable Online Certificate Status Protocol (OCSP) support, to enable a certificate revocation list (CRL), to enable both, or to enable neither. The default is for both certificate validation mechanisms to be disabled.</p><note>
/// <p>The following requirements apply to revocation configurations.</p>
/// <ul>
/// <li>
/// <p>A configuration disabling CRLs or OCSP must contain only the <code>Enabled=False</code> parameter, and will fail if other parameters such as <code>CustomCname</code> or <code>ExpirationInDays</code> are included.</p></li>
/// <li>
/// <p>In a CRL configuration, the <code>S3BucketName</code> parameter must conform to <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Amazon S3 bucket naming rules</a>.</p></li>
/// <li>
/// <p>A configuration containing a custom Canonical Name (CNAME) parameter for CRLs or OCSP must conform to <a href="https://www.ietf.org/rfc/rfc2396.txt">RFC2396</a> restrictions on the use of special characters in a CNAME.</p></li>
/// <li>
/// <p>In a CRL or OCSP configuration, the value of a CNAME parameter must not include a protocol prefix such as "http://" or "https://".</p></li>
/// </ul>
/// </note>
/// <p>For more information, see the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_OcspConfiguration.html">OcspConfiguration</a> and <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CrlConfiguration.html">CrlConfiguration</a> types.</p>
pub fn revocation_configuration(mut self, input: crate::types::RevocationConfiguration) -> Self {
self.inner = self.inner.revocation_configuration(input);
self
}
/// <p>Contains information to enable Online Certificate Status Protocol (OCSP) support, to enable a certificate revocation list (CRL), to enable both, or to enable neither. The default is for both certificate validation mechanisms to be disabled.</p><note>
/// <p>The following requirements apply to revocation configurations.</p>
/// <ul>
/// <li>
/// <p>A configuration disabling CRLs or OCSP must contain only the <code>Enabled=False</code> parameter, and will fail if other parameters such as <code>CustomCname</code> or <code>ExpirationInDays</code> are included.</p></li>
/// <li>
/// <p>In a CRL configuration, the <code>S3BucketName</code> parameter must conform to <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Amazon S3 bucket naming rules</a>.</p></li>
/// <li>
/// <p>A configuration containing a custom Canonical Name (CNAME) parameter for CRLs or OCSP must conform to <a href="https://www.ietf.org/rfc/rfc2396.txt">RFC2396</a> restrictions on the use of special characters in a CNAME.</p></li>
/// <li>
/// <p>In a CRL or OCSP configuration, the value of a CNAME parameter must not include a protocol prefix such as "http://" or "https://".</p></li>
/// </ul>
/// </note>
/// <p>For more information, see the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_OcspConfiguration.html">OcspConfiguration</a> and <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CrlConfiguration.html">CrlConfiguration</a> types.</p>
pub fn set_revocation_configuration(mut self, input: ::std::option::Option<crate::types::RevocationConfiguration>) -> Self {
self.inner = self.inner.set_revocation_configuration(input);
self
}
/// <p>Contains information to enable Online Certificate Status Protocol (OCSP) support, to enable a certificate revocation list (CRL), to enable both, or to enable neither. The default is for both certificate validation mechanisms to be disabled.</p><note>
/// <p>The following requirements apply to revocation configurations.</p>
/// <ul>
/// <li>
/// <p>A configuration disabling CRLs or OCSP must contain only the <code>Enabled=False</code> parameter, and will fail if other parameters such as <code>CustomCname</code> or <code>ExpirationInDays</code> are included.</p></li>
/// <li>
/// <p>In a CRL configuration, the <code>S3BucketName</code> parameter must conform to <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Amazon S3 bucket naming rules</a>.</p></li>
/// <li>
/// <p>A configuration containing a custom Canonical Name (CNAME) parameter for CRLs or OCSP must conform to <a href="https://www.ietf.org/rfc/rfc2396.txt">RFC2396</a> restrictions on the use of special characters in a CNAME.</p></li>
/// <li>
/// <p>In a CRL or OCSP configuration, the value of a CNAME parameter must not include a protocol prefix such as "http://" or "https://".</p></li>
/// </ul>
/// </note>
/// <p>For more information, see the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_OcspConfiguration.html">OcspConfiguration</a> and <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CrlConfiguration.html">CrlConfiguration</a> types.</p>
pub fn get_revocation_configuration(&self) -> &::std::option::Option<crate::types::RevocationConfiguration> {
self.inner.get_revocation_configuration()
}
/// <p>The type of the certificate authority.</p>
pub fn certificate_authority_type(mut self, input: crate::types::CertificateAuthorityType) -> Self {
self.inner = self.inner.certificate_authority_type(input);
self
}
/// <p>The type of the certificate authority.</p>
pub fn set_certificate_authority_type(mut self, input: ::std::option::Option<crate::types::CertificateAuthorityType>) -> Self {
self.inner = self.inner.set_certificate_authority_type(input);
self
}
/// <p>The type of the certificate authority.</p>
pub fn get_certificate_authority_type(&self) -> &::std::option::Option<crate::types::CertificateAuthorityType> {
self.inner.get_certificate_authority_type()
}
/// <p>Custom string that can be used to distinguish between calls to the <b>CreateCertificateAuthority</b> action. Idempotency tokens for <b>CreateCertificateAuthority</b> time out after five minutes. Therefore, if you call <b>CreateCertificateAuthority</b> multiple times with the same idempotency token within five minutes, Amazon Web Services Private CA recognizes that you are requesting only certificate authority and will issue only one. If you change the idempotency token for each call, Amazon Web Services Private CA recognizes that you are requesting multiple certificate authorities.</p>
pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.idempotency_token(input.into());
self
}
/// <p>Custom string that can be used to distinguish between calls to the <b>CreateCertificateAuthority</b> action. Idempotency tokens for <b>CreateCertificateAuthority</b> time out after five minutes. Therefore, if you call <b>CreateCertificateAuthority</b> multiple times with the same idempotency token within five minutes, Amazon Web Services Private CA recognizes that you are requesting only certificate authority and will issue only one. If you change the idempotency token for each call, Amazon Web Services Private CA recognizes that you are requesting multiple certificate authorities.</p>
pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_idempotency_token(input);
self
}
/// <p>Custom string that can be used to distinguish between calls to the <b>CreateCertificateAuthority</b> action. Idempotency tokens for <b>CreateCertificateAuthority</b> time out after five minutes. Therefore, if you call <b>CreateCertificateAuthority</b> multiple times with the same idempotency token within five minutes, Amazon Web Services Private CA recognizes that you are requesting only certificate authority and will issue only one. If you change the idempotency token for each call, Amazon Web Services Private CA recognizes that you are requesting multiple certificate authorities.</p>
pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_idempotency_token()
}
/// <p>Specifies a cryptographic key management compliance standard used for handling CA keys.</p>
/// <p>Default: FIPS_140_2_LEVEL_3_OR_HIGHER</p><note>
/// <p>Some Amazon Web Services Regions do not support the default. When creating a CA in these Regions, you must provide <code>FIPS_140_2_LEVEL_2_OR_HIGHER</code> as the argument for <code>KeyStorageSecurityStandard</code>. Failure to do this results in an <code>InvalidArgsException</code> with the message, "A certificate authority cannot be created in this region with the specified security standard."</p>
/// <p>For information about security standard support in various Regions, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/data-protection.html#private-keys">Storage and security compliance of Amazon Web Services Private CA private keys</a>.</p>
/// </note>
pub fn key_storage_security_standard(mut self, input: crate::types::KeyStorageSecurityStandard) -> Self {
self.inner = self.inner.key_storage_security_standard(input);
self
}
/// <p>Specifies a cryptographic key management compliance standard used for handling CA keys.</p>
/// <p>Default: FIPS_140_2_LEVEL_3_OR_HIGHER</p><note>
/// <p>Some Amazon Web Services Regions do not support the default. When creating a CA in these Regions, you must provide <code>FIPS_140_2_LEVEL_2_OR_HIGHER</code> as the argument for <code>KeyStorageSecurityStandard</code>. Failure to do this results in an <code>InvalidArgsException</code> with the message, "A certificate authority cannot be created in this region with the specified security standard."</p>
/// <p>For information about security standard support in various Regions, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/data-protection.html#private-keys">Storage and security compliance of Amazon Web Services Private CA private keys</a>.</p>
/// </note>
pub fn set_key_storage_security_standard(mut self, input: ::std::option::Option<crate::types::KeyStorageSecurityStandard>) -> Self {
self.inner = self.inner.set_key_storage_security_standard(input);
self
}
/// <p>Specifies a cryptographic key management compliance standard used for handling CA keys.</p>
/// <p>Default: FIPS_140_2_LEVEL_3_OR_HIGHER</p><note>
/// <p>Some Amazon Web Services Regions do not support the default. When creating a CA in these Regions, you must provide <code>FIPS_140_2_LEVEL_2_OR_HIGHER</code> as the argument for <code>KeyStorageSecurityStandard</code>. Failure to do this results in an <code>InvalidArgsException</code> with the message, "A certificate authority cannot be created in this region with the specified security standard."</p>
/// <p>For information about security standard support in various Regions, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/data-protection.html#private-keys">Storage and security compliance of Amazon Web Services Private CA private keys</a>.</p>
/// </note>
pub fn get_key_storage_security_standard(&self) -> &::std::option::Option<crate::types::KeyStorageSecurityStandard> {
self.inner.get_key_storage_security_standard()
}
///
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>Key-value pairs that will be attached to the new private CA. You can associate up to 50 tags with a private CA. For information using tags with IAM to manage permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html">Controlling Access Using IAM Tags</a>.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>Key-value pairs that will be attached to the new private CA. You can associate up to 50 tags with a private CA. For information using tags with IAM to manage permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html">Controlling Access Using IAM Tags</a>.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>Key-value pairs that will be attached to the new private CA. You can associate up to 50 tags with a private CA. For information using tags with IAM to manage permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html">Controlling Access Using IAM Tags</a>.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
self.inner.get_tags()
}
/// <p>Specifies whether the CA issues general-purpose certificates that typically require a revocation mechanism, or short-lived certificates that may optionally omit revocation because they expire quickly. Short-lived certificate validity is limited to seven days.</p>
/// <p>The default value is GENERAL_PURPOSE.</p>
pub fn usage_mode(mut self, input: crate::types::CertificateAuthorityUsageMode) -> Self {
self.inner = self.inner.usage_mode(input);
self
}
/// <p>Specifies whether the CA issues general-purpose certificates that typically require a revocation mechanism, or short-lived certificates that may optionally omit revocation because they expire quickly. Short-lived certificate validity is limited to seven days.</p>
/// <p>The default value is GENERAL_PURPOSE.</p>
pub fn set_usage_mode(mut self, input: ::std::option::Option<crate::types::CertificateAuthorityUsageMode>) -> Self {
self.inner = self.inner.set_usage_mode(input);
self
}
/// <p>Specifies whether the CA issues general-purpose certificates that typically require a revocation mechanism, or short-lived certificates that may optionally omit revocation because they expire quickly. Short-lived certificate validity is limited to seven days.</p>
/// <p>The default value is GENERAL_PURPOSE.</p>
pub fn get_usage_mode(&self) -> &::std::option::Option<crate::types::CertificateAuthorityUsageMode> {
self.inner.get_usage_mode()
}
}