aws-sdk-networkfirewall 1.121.0

AWS SDK for AWS Network Firewall
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_container_association::_update_container_association_input::UpdateContainerAssociationInputBuilder;

pub use crate::operation::update_container_association::_update_container_association_output::UpdateContainerAssociationOutputBuilder;

impl crate::operation::update_container_association::builders::UpdateContainerAssociationInputBuilder {
    /// 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_container_association::UpdateContainerAssociationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_container_association::UpdateContainerAssociationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_container_association();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateContainerAssociation`.
///
/// <p>Updates the monitoring configurations and description of a container association. You can't change the container type after creation. Provide an update token to enable optimistic concurrency control.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateContainerAssociationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_container_association::builders::UpdateContainerAssociationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_container_association::UpdateContainerAssociationOutput,
        crate::operation::update_container_association::UpdateContainerAssociationError,
    > for UpdateContainerAssociationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_container_association::UpdateContainerAssociationOutput,
            crate::operation::update_container_association::UpdateContainerAssociationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateContainerAssociationFluentBuilder {
    /// Creates a new `UpdateContainerAssociationFluentBuilder`.
    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 UpdateContainerAssociation as a reference.
    pub fn as_input(&self) -> &crate::operation::update_container_association::builders::UpdateContainerAssociationInputBuilder {
        &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_container_association::UpdateContainerAssociationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_container_association::UpdateContainerAssociationError,
            ::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_container_association::UpdateContainerAssociation::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_container_association::UpdateContainerAssociation::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_container_association::UpdateContainerAssociationOutput,
        crate::operation::update_container_association::UpdateContainerAssociationError,
        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 descriptive name of the container association.</p>
    /// <p>You must specify the ARN or the name, and you can specify both.</p>
    pub fn container_association_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.container_association_name(input.into());
        self
    }
    /// <p>The descriptive name of the container association.</p>
    /// <p>You must specify the ARN or the name, and you can specify both.</p>
    pub fn set_container_association_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_container_association_name(input);
        self
    }
    /// <p>The descriptive name of the container association.</p>
    /// <p>You must specify the ARN or the name, and you can specify both.</p>
    pub fn get_container_association_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_container_association_name()
    }
    /// <p>The Amazon Resource Name (ARN) of the container association.</p>
    /// <p>You must specify the ARN or the name, and you can specify both.</p>
    pub fn container_association_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.container_association_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the container association.</p>
    /// <p>You must specify the ARN or the name, and you can specify both.</p>
    pub fn set_container_association_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_container_association_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the container association.</p>
    /// <p>You must specify the ARN or the name, and you can specify both.</p>
    pub fn get_container_association_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_container_association_arn()
    }
    /// <p>A description of the container association. When omitted, the existing description remains unchanged. To clear the description, pass an empty string.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A description of the container association. When omitted, the existing description remains unchanged. To clear the description, pass an empty string.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A description of the container association. When omitted, the existing description remains unchanged. To clear the description, pass an empty string.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The container type. This value must match the existing type and can't be changed. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>ECS</code> - Amazon Elastic Container Service</p></li>
    /// <li>
    /// <p><code>EKS</code> - Amazon Elastic Kubernetes Service</p></li>
    /// </ul>
    pub fn r#type(mut self, input: crate::types::ContainerMonitoringType) -> Self {
        self.inner = self.inner.r#type(input);
        self
    }
    /// <p>The container type. This value must match the existing type and can't be changed. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>ECS</code> - Amazon Elastic Container Service</p></li>
    /// <li>
    /// <p><code>EKS</code> - Amazon Elastic Kubernetes Service</p></li>
    /// </ul>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ContainerMonitoringType>) -> Self {
        self.inner = self.inner.set_type(input);
        self
    }
    /// <p>The container type. This value must match the existing type and can't be changed. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>ECS</code> - Amazon Elastic Container Service</p></li>
    /// <li>
    /// <p><code>EKS</code> - Amazon Elastic Kubernetes Service</p></li>
    /// </ul>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::ContainerMonitoringType> {
        self.inner.get_type()
    }
    ///
    /// Appends an item to `ContainerMonitoringConfigurations`.
    ///
    /// To override the contents of this collection use [`set_container_monitoring_configurations`](Self::set_container_monitoring_configurations).
    ///
    /// <p>The updated monitoring configurations for the container association. Each configuration specifies an Amazon ECS or Amazon EKS cluster to monitor and optional attribute filters.</p>
    pub fn container_monitoring_configurations(mut self, input: crate::types::ContainerMonitoringConfiguration) -> Self {
        self.inner = self.inner.container_monitoring_configurations(input);
        self
    }
    /// <p>The updated monitoring configurations for the container association. Each configuration specifies an Amazon ECS or Amazon EKS cluster to monitor and optional attribute filters.</p>
    pub fn set_container_monitoring_configurations(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::ContainerMonitoringConfiguration>>,
    ) -> Self {
        self.inner = self.inner.set_container_monitoring_configurations(input);
        self
    }
    /// <p>The updated monitoring configurations for the container association. Each configuration specifies an Amazon ECS or Amazon EKS cluster to monitor and optional attribute filters.</p>
    pub fn get_container_monitoring_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContainerMonitoringConfiguration>> {
        self.inner.get_container_monitoring_configurations()
    }
    ///
    /// Appends an item to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The key:value pairs to associate with the resource.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>The key:value pairs to associate with the resource.</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>The key:value pairs to associate with the resource.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the container association. The token marks the state of the container association resource at the time of the request.</p>
    /// <p>To make changes to the container association, you provide the token in your request. Network Firewall uses the token to ensure that the container association hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the container association again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
    pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.update_token(input.into());
        self
    }
    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the container association. The token marks the state of the container association resource at the time of the request.</p>
    /// <p>To make changes to the container association, you provide the token in your request. Network Firewall uses the token to ensure that the container association hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the container association again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
    pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_update_token(input);
        self
    }
    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the container association. The token marks the state of the container association resource at the time of the request.</p>
    /// <p>To make changes to the container association, you provide the token in your request. Network Firewall uses the token to ensure that the container association hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the container association again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
    pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_update_token()
    }
}