aws-sdk-cloudwatchlogs 1.76.0

AWS SDK for Amazon CloudWatch Logs
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::put_integration::_put_integration_output::PutIntegrationOutputBuilder;

pub use crate::operation::put_integration::_put_integration_input::PutIntegrationInputBuilder;

impl crate::operation::put_integration::builders::PutIntegrationInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::put_integration::PutIntegrationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_integration::PutIntegrationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.put_integration();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PutIntegration`.
///
/// <p>Creates an integration between CloudWatch Logs and another service in this account. Currently, only integrations with OpenSearch Service are supported, and currently you can have only one integration in your account.</p>
/// <p>Integrating with OpenSearch Service makes it possible for you to create curated vended logs dashboards, powered by OpenSearch Service analytics. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-OpenSearch-Dashboards.html">Vended log dashboards powered by Amazon OpenSearch Service</a>.</p>
/// <p>You can use this operation only to create a new integration. You can't modify an existing integration.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutIntegrationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::put_integration::builders::PutIntegrationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::put_integration::PutIntegrationOutput,
        crate::operation::put_integration::PutIntegrationError,
    > for PutIntegrationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::put_integration::PutIntegrationOutput,
            crate::operation::put_integration::PutIntegrationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PutIntegrationFluentBuilder {
    /// Creates a new `PutIntegrationFluentBuilder`.
    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 PutIntegration as a reference.
    pub fn as_input(&self) -> &crate::operation::put_integration::builders::PutIntegrationInputBuilder {
        &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::put_integration::PutIntegrationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_integration::PutIntegrationError,
            ::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::put_integration::PutIntegration::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::put_integration::PutIntegration::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::put_integration::PutIntegrationOutput,
        crate::operation::put_integration::PutIntegrationError,
        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>A name for the integration.</p>
    pub fn integration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.integration_name(input.into());
        self
    }
    /// <p>A name for the integration.</p>
    pub fn set_integration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_integration_name(input);
        self
    }
    /// <p>A name for the integration.</p>
    pub fn get_integration_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_integration_name()
    }
    /// <p>A structure that contains configuration information for the integration that you are creating.</p>
    pub fn resource_config(mut self, input: crate::types::ResourceConfig) -> Self {
        self.inner = self.inner.resource_config(input);
        self
    }
    /// <p>A structure that contains configuration information for the integration that you are creating.</p>
    pub fn set_resource_config(mut self, input: ::std::option::Option<crate::types::ResourceConfig>) -> Self {
        self.inner = self.inner.set_resource_config(input);
        self
    }
    /// <p>A structure that contains configuration information for the integration that you are creating.</p>
    pub fn get_resource_config(&self) -> &::std::option::Option<crate::types::ResourceConfig> {
        self.inner.get_resource_config()
    }
    /// <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>
    pub fn integration_type(mut self, input: crate::types::IntegrationType) -> Self {
        self.inner = self.inner.integration_type(input);
        self
    }
    /// <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>
    pub fn set_integration_type(mut self, input: ::std::option::Option<crate::types::IntegrationType>) -> Self {
        self.inner = self.inner.set_integration_type(input);
        self
    }
    /// <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>
    pub fn get_integration_type(&self) -> &::std::option::Option<crate::types::IntegrationType> {
        self.inner.get_integration_type()
    }
}