aws-sdk-inspector2 1.121.0

AWS SDK for Inspector2
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_configuration::_update_configuration_input::UpdateConfigurationInputBuilder;

pub use crate::operation::update_configuration::_update_configuration_output::UpdateConfigurationOutputBuilder;

impl crate::operation::update_configuration::builders::UpdateConfigurationInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_configuration::UpdateConfigurationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_configuration::UpdateConfigurationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_configuration();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateConfiguration`.
///
/// <p>Updates the scan configuration for your Amazon Inspector account. If you don't specify an <code>accountId</code>, this operation updates the delegated administrator's configuration and propagates it to member accounts that have not been individually configured. If you specify an <code>accountId</code>, this operation updates that member account's configuration. Only the delegated administrator can specify an <code>accountId</code>; member accounts cannot call this operation.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateConfigurationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_configuration::builders::UpdateConfigurationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_configuration::UpdateConfigurationOutput,
        crate::operation::update_configuration::UpdateConfigurationError,
    > for UpdateConfigurationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_configuration::UpdateConfigurationOutput,
            crate::operation::update_configuration::UpdateConfigurationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateConfigurationFluentBuilder {
    /// Creates a new `UpdateConfigurationFluentBuilder`.
    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 UpdateConfiguration as a reference.
    pub fn as_input(&self) -> &crate::operation::update_configuration::builders::UpdateConfigurationInputBuilder {
        &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::update_configuration::UpdateConfigurationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_configuration::UpdateConfigurationError,
            ::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::update_configuration::UpdateConfiguration::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_configuration::UpdateConfiguration::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::update_configuration::UpdateConfigurationOutput,
        crate::operation::update_configuration::UpdateConfigurationError,
        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 12-digit Amazon Web Services account ID of the member account whose scan configuration you want to update. When specified, you must be the delegated administrator for this member account. If not specified, the operation updates your own configuration and propagates changes to any member accounts that have not been individually configured.</p>
    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.account_id(input.into());
        self
    }
    /// <p>The 12-digit Amazon Web Services account ID of the member account whose scan configuration you want to update. When specified, you must be the delegated administrator for this member account. If not specified, the operation updates your own configuration and propagates changes to any member accounts that have not been individually configured.</p>
    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_account_id(input);
        self
    }
    /// <p>The 12-digit Amazon Web Services account ID of the member account whose scan configuration you want to update. When specified, you must be the delegated administrator for this member account. If not specified, the operation updates your own configuration and propagates changes to any member accounts that have not been individually configured.</p>
    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_account_id()
    }
    /// <p>Specifies how the ECR automated re-scan will be updated for your environment.</p>
    pub fn ecr_configuration(mut self, input: crate::types::EcrConfiguration) -> Self {
        self.inner = self.inner.ecr_configuration(input);
        self
    }
    /// <p>Specifies how the ECR automated re-scan will be updated for your environment.</p>
    pub fn set_ecr_configuration(mut self, input: ::std::option::Option<crate::types::EcrConfiguration>) -> Self {
        self.inner = self.inner.set_ecr_configuration(input);
        self
    }
    /// <p>Specifies how the ECR automated re-scan will be updated for your environment.</p>
    pub fn get_ecr_configuration(&self) -> &::std::option::Option<crate::types::EcrConfiguration> {
        self.inner.get_ecr_configuration()
    }
    /// <p>Specifies how the Amazon EC2 automated scan will be updated for your environment.</p>
    pub fn ec2_configuration(mut self, input: crate::types::Ec2Configuration) -> Self {
        self.inner = self.inner.ec2_configuration(input);
        self
    }
    /// <p>Specifies how the Amazon EC2 automated scan will be updated for your environment.</p>
    pub fn set_ec2_configuration(mut self, input: ::std::option::Option<crate::types::Ec2Configuration>) -> Self {
        self.inner = self.inner.set_ec2_configuration(input);
        self
    }
    /// <p>Specifies how the Amazon EC2 automated scan will be updated for your environment.</p>
    pub fn get_ec2_configuration(&self) -> &::std::option::Option<crate::types::Ec2Configuration> {
        self.inner.get_ec2_configuration()
    }
    /// <p>Specifies which scan-type configurations to reset to the delegated administrator's inherited values for the targeted member account. Each member of this structure is independently optional. When specified, <code>ec2Configuration</code> and <code>ecrConfiguration</code> must be absent, and <code>accountId</code> must also be present. Only <code>INHERIT_FROM_ADMIN</code> is valid for each member. If not specified, the operation uses the <code>ec2Configuration</code> and <code>ecrConfiguration</code> parameters instead.</p>
    pub fn update_configuration_inheritance(mut self, input: crate::types::UpdateConfigurationInheritance) -> Self {
        self.inner = self.inner.update_configuration_inheritance(input);
        self
    }
    /// <p>Specifies which scan-type configurations to reset to the delegated administrator's inherited values for the targeted member account. Each member of this structure is independently optional. When specified, <code>ec2Configuration</code> and <code>ecrConfiguration</code> must be absent, and <code>accountId</code> must also be present. Only <code>INHERIT_FROM_ADMIN</code> is valid for each member. If not specified, the operation uses the <code>ec2Configuration</code> and <code>ecrConfiguration</code> parameters instead.</p>
    pub fn set_update_configuration_inheritance(mut self, input: ::std::option::Option<crate::types::UpdateConfigurationInheritance>) -> Self {
        self.inner = self.inner.set_update_configuration_inheritance(input);
        self
    }
    /// <p>Specifies which scan-type configurations to reset to the delegated administrator's inherited values for the targeted member account. Each member of this structure is independently optional. When specified, <code>ec2Configuration</code> and <code>ecrConfiguration</code> must be absent, and <code>accountId</code> must also be present. Only <code>INHERIT_FROM_ADMIN</code> is valid for each member. If not specified, the operation uses the <code>ec2Configuration</code> and <code>ecrConfiguration</code> parameters instead.</p>
    pub fn get_update_configuration_inheritance(&self) -> &::std::option::Option<crate::types::UpdateConfigurationInheritance> {
        self.inner.get_update_configuration_inheritance()
    }
}