aws-sdk-iot 1.112.0

AWS SDK for AWS IoT
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_thing_groups_for_thing::_update_thing_groups_for_thing_input::UpdateThingGroupsForThingInputBuilder;

pub use crate::operation::update_thing_groups_for_thing::_update_thing_groups_for_thing_output::UpdateThingGroupsForThingOutputBuilder;

impl crate::operation::update_thing_groups_for_thing::builders::UpdateThingGroupsForThingInputBuilder {
    /// 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_thing_groups_for_thing::UpdateThingGroupsForThingOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_thing_groups_for_thing::UpdateThingGroupsForThingError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_thing_groups_for_thing();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateThingGroupsForThing`.
///
/// <p>Updates the groups to which the thing belongs.</p>
/// <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">UpdateThingGroupsForThing</a> action.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateThingGroupsForThingFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_thing_groups_for_thing::builders::UpdateThingGroupsForThingInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_thing_groups_for_thing::UpdateThingGroupsForThingOutput,
        crate::operation::update_thing_groups_for_thing::UpdateThingGroupsForThingError,
    > for UpdateThingGroupsForThingFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_thing_groups_for_thing::UpdateThingGroupsForThingOutput,
            crate::operation::update_thing_groups_for_thing::UpdateThingGroupsForThingError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateThingGroupsForThingFluentBuilder {
    /// Creates a new `UpdateThingGroupsForThingFluentBuilder`.
    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 UpdateThingGroupsForThing as a reference.
    pub fn as_input(&self) -> &crate::operation::update_thing_groups_for_thing::builders::UpdateThingGroupsForThingInputBuilder {
        &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_thing_groups_for_thing::UpdateThingGroupsForThingOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_thing_groups_for_thing::UpdateThingGroupsForThingError,
            ::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_thing_groups_for_thing::UpdateThingGroupsForThing::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_thing_groups_for_thing::UpdateThingGroupsForThing::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_thing_groups_for_thing::UpdateThingGroupsForThingOutput,
        crate::operation::update_thing_groups_for_thing::UpdateThingGroupsForThingError,
        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 thing whose group memberships will be updated.</p>
    pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.thing_name(input.into());
        self
    }
    /// <p>The thing whose group memberships will be updated.</p>
    pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_thing_name(input);
        self
    }
    /// <p>The thing whose group memberships will be updated.</p>
    pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_thing_name()
    }
    ///
    /// Appends an item to `thingGroupsToAdd`.
    ///
    /// To override the contents of this collection use [`set_thing_groups_to_add`](Self::set_thing_groups_to_add).
    ///
    /// <p>The groups to which the thing will be added.</p>
    pub fn thing_groups_to_add(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.thing_groups_to_add(input.into());
        self
    }
    /// <p>The groups to which the thing will be added.</p>
    pub fn set_thing_groups_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_thing_groups_to_add(input);
        self
    }
    /// <p>The groups to which the thing will be added.</p>
    pub fn get_thing_groups_to_add(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_thing_groups_to_add()
    }
    ///
    /// Appends an item to `thingGroupsToRemove`.
    ///
    /// To override the contents of this collection use [`set_thing_groups_to_remove`](Self::set_thing_groups_to_remove).
    ///
    /// <p>The groups from which the thing will be removed.</p>
    pub fn thing_groups_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.thing_groups_to_remove(input.into());
        self
    }
    /// <p>The groups from which the thing will be removed.</p>
    pub fn set_thing_groups_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_thing_groups_to_remove(input);
        self
    }
    /// <p>The groups from which the thing will be removed.</p>
    pub fn get_thing_groups_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_thing_groups_to_remove()
    }
    /// <p>Override dynamic thing groups with static thing groups when 10-group limit is reached. If a thing belongs to 10 thing groups, and one or more of those groups are dynamic thing groups, adding a thing to a static group removes the thing from the last dynamic group.</p>
    pub fn override_dynamic_groups(mut self, input: bool) -> Self {
        self.inner = self.inner.override_dynamic_groups(input);
        self
    }
    /// <p>Override dynamic thing groups with static thing groups when 10-group limit is reached. If a thing belongs to 10 thing groups, and one or more of those groups are dynamic thing groups, adding a thing to a static group removes the thing from the last dynamic group.</p>
    pub fn set_override_dynamic_groups(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_override_dynamic_groups(input);
        self
    }
    /// <p>Override dynamic thing groups with static thing groups when 10-group limit is reached. If a thing belongs to 10 thing groups, and one or more of those groups are dynamic thing groups, adding a thing to a static group removes the thing from the last dynamic group.</p>
    pub fn get_override_dynamic_groups(&self) -> &::std::option::Option<bool> {
        self.inner.get_override_dynamic_groups()
    }
}