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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateThingGroupInput {
    /// <p>The thing group name to create.</p>
    pub thing_group_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the parent thing group.</p>
    pub parent_group_name: ::std::option::Option<::std::string::String>,
    /// <p>The thing group properties.</p>
    pub thing_group_properties: ::std::option::Option<crate::types::ThingGroupProperties>,
    /// <p>Metadata which can be used to manage the thing group.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateThingGroupInput {
    /// <p>The thing group name to create.</p>
    pub fn thing_group_name(&self) -> ::std::option::Option<&str> {
        self.thing_group_name.as_deref()
    }
    /// <p>The name of the parent thing group.</p>
    pub fn parent_group_name(&self) -> ::std::option::Option<&str> {
        self.parent_group_name.as_deref()
    }
    /// <p>The thing group properties.</p>
    pub fn thing_group_properties(&self) -> ::std::option::Option<&crate::types::ThingGroupProperties> {
        self.thing_group_properties.as_ref()
    }
    /// <p>Metadata which can be used to manage the thing group.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl CreateThingGroupInput {
    /// Creates a new builder-style object to manufacture [`CreateThingGroupInput`](crate::operation::create_thing_group::CreateThingGroupInput).
    pub fn builder() -> crate::operation::create_thing_group::builders::CreateThingGroupInputBuilder {
        crate::operation::create_thing_group::builders::CreateThingGroupInputBuilder::default()
    }
}

/// A builder for [`CreateThingGroupInput`](crate::operation::create_thing_group::CreateThingGroupInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateThingGroupInputBuilder {
    pub(crate) thing_group_name: ::std::option::Option<::std::string::String>,
    pub(crate) parent_group_name: ::std::option::Option<::std::string::String>,
    pub(crate) thing_group_properties: ::std::option::Option<crate::types::ThingGroupProperties>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateThingGroupInputBuilder {
    /// <p>The thing group name to create.</p>
    /// This field is required.
    pub fn thing_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.thing_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The thing group name to create.</p>
    pub fn set_thing_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.thing_group_name = input;
        self
    }
    /// <p>The thing group name to create.</p>
    pub fn get_thing_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.thing_group_name
    }
    /// <p>The name of the parent thing group.</p>
    pub fn parent_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.parent_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the parent thing group.</p>
    pub fn set_parent_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.parent_group_name = input;
        self
    }
    /// <p>The name of the parent thing group.</p>
    pub fn get_parent_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.parent_group_name
    }
    /// <p>The thing group properties.</p>
    pub fn thing_group_properties(mut self, input: crate::types::ThingGroupProperties) -> Self {
        self.thing_group_properties = ::std::option::Option::Some(input);
        self
    }
    /// <p>The thing group properties.</p>
    pub fn set_thing_group_properties(mut self, input: ::std::option::Option<crate::types::ThingGroupProperties>) -> Self {
        self.thing_group_properties = input;
        self
    }
    /// <p>The thing group properties.</p>
    pub fn get_thing_group_properties(&self) -> &::std::option::Option<crate::types::ThingGroupProperties> {
        &self.thing_group_properties
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Metadata which can be used to manage the thing group.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Metadata which can be used to manage the thing group.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Metadata which can be used to manage the thing group.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateThingGroupInput`](crate::operation::create_thing_group::CreateThingGroupInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_thing_group::CreateThingGroupInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_thing_group::CreateThingGroupInput {
            thing_group_name: self.thing_group_name,
            parent_group_name: self.parent_group_name,
            thing_group_properties: self.thing_group_properties,
            tags: self.tags,
        })
    }
}