aws-sdk-oam 0.5.0

AWS SDK for CloudWatch Observability Access Manager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_link::_update_link_output::UpdateLinkOutputBuilder;

pub use crate::operation::update_link::_update_link_input::UpdateLinkInputBuilder;

/// Fluent builder constructing a request to `UpdateLink`.
///
/// <p>Use this operation to change what types of data are shared from a source account to its linked monitoring account sink. You can't change the sink or change the monitoring account with this operation.</p>
/// <p>To update the list of tags associated with the sink, use <a href="https://docs.aws.amazon.com/OAM/latest/APIReference/API_TagResource.html">TagResource</a>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UpdateLinkFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_link::builders::UpdateLinkInputBuilder,
}
impl UpdateLinkFluentBuilder {
    /// Creates a new `UpdateLink`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }
    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::update_link::UpdateLink,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<crate::operation::update_link::UpdateLinkError>,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// 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_link::UpdateLinkOutput,
        aws_smithy_http::result::SdkError<crate::operation::update_link::UpdateLinkError>,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// <p>The ARN of the link that you want to update.</p>
    pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.identifier(input.into());
        self
    }
    /// <p>The ARN of the link that you want to update.</p>
    pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_identifier(input);
        self
    }
    /// Appends an item to `ResourceTypes`.
    ///
    /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
    ///
    /// <p>An array of strings that define which types of data that the source account will send to the monitoring account.</p>
    /// <p>Your input here replaces the current set of data types that are shared.</p>
    pub fn resource_types(mut self, input: crate::types::ResourceType) -> Self {
        self.inner = self.inner.resource_types(input);
        self
    }
    /// <p>An array of strings that define which types of data that the source account will send to the monitoring account.</p>
    /// <p>Your input here replaces the current set of data types that are shared.</p>
    pub fn set_resource_types(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::ResourceType>>,
    ) -> Self {
        self.inner = self.inner.set_resource_types(input);
        self
    }
}