aws-sdk-config 1.116.0

AWS SDK for AWS Config
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::put_connector::_put_connector_input::PutConnectorInputBuilder;

pub use crate::operation::put_connector::_put_connector_output::PutConnectorOutputBuilder;

impl crate::operation::put_connector::builders::PutConnectorInputBuilder {
    /// 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_connector::PutConnectorOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_connector::PutConnectorError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.put_connector();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PutConnector`.
///
/// <p>Creates a connector that specifies the connection between a third-party cloud service provider and Config.</p>
/// <p>A connector is required to create a service-linked configuration recorder for a third-party cloud service provider using the <a href="https://docs.aws.amazon.com/config/latest/APIReference/API_PutThirdPartyServiceLinkedConfigurationRecorder.html">PutThirdPartyServiceLinkedConfigurationRecorder</a> operation.</p>
/// <p>This API creates a service-linked role <code>AWSServiceRoleForConfigThirdParty</code> in your account. The service-linked role is created only when the role does not exist in your account.</p><note>
/// <p><b>Connectors cannot be updated</b></p>
/// <p>To update the connector configuration, you must delete all associated configuration recorders, delete the connector, and recreate it with the updated configuration.</p>
/// </note> <note>
/// <p><b>Tags are added at creation and cannot be updated with this operation</b></p>
/// <p>Use <a href="https://docs.aws.amazon.com/config/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/config/latest/APIReference/API_UntagResource.html">UntagResource</a> to update tags after creation.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutConnectorFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::put_connector::builders::PutConnectorInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::put_connector::PutConnectorOutput,
        crate::operation::put_connector::PutConnectorError,
    > for PutConnectorFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::put_connector::PutConnectorOutput,
            crate::operation::put_connector::PutConnectorError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PutConnectorFluentBuilder {
    /// Creates a new `PutConnectorFluentBuilder`.
    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 PutConnector as a reference.
    pub fn as_input(&self) -> &crate::operation::put_connector::builders::PutConnectorInputBuilder {
        &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_connector::PutConnectorOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_connector::PutConnectorError,
            ::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_connector::PutConnector::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::put_connector::PutConnector::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_connector::PutConnectorOutput,
        crate::operation::put_connector::PutConnectorError,
        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 provider-specific configuration for connecting to the third-party cloud service provider.</p>
    pub fn connector_configuration(mut self, input: crate::types::ConnectorConfiguration) -> Self {
        self.inner = self.inner.connector_configuration(input);
        self
    }
    /// <p>The provider-specific configuration for connecting to the third-party cloud service provider.</p>
    pub fn set_connector_configuration(mut self, input: ::std::option::Option<crate::types::ConnectorConfiguration>) -> Self {
        self.inner = self.inner.set_connector_configuration(input);
        self
    }
    /// <p>The provider-specific configuration for connecting to the third-party cloud service provider.</p>
    pub fn get_connector_configuration(&self) -> &::std::option::Option<crate::types::ConnectorConfiguration> {
        self.inner.get_connector_configuration()
    }
    ///
    /// Appends an item to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags for the connector. Each tag consists of a key and an optional value, both of which you define.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>The tags for the connector. Each tag consists of a key and an optional value, both of which you define.</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 tags for the connector. Each tag consists of a key and an optional value, both of which you define.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
}