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.

/// <p>Describes the name and data type at a field.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Field {
    /// <p>The name of the field.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The data type of the field.</p>
    pub r#type: ::std::option::Option<crate::types::FieldType>,
}
impl Field {
    /// <p>The name of the field.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The data type of the field.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::FieldType> {
        self.r#type.as_ref()
    }
}
impl Field {
    /// Creates a new builder-style object to manufacture [`Field`](crate::types::Field).
    pub fn builder() -> crate::types::builders::FieldBuilder {
        crate::types::builders::FieldBuilder::default()
    }
}

/// A builder for [`Field`](crate::types::Field).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct FieldBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::FieldType>,
}
impl FieldBuilder {
    /// <p>The name of the field.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the field.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the field.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The data type of the field.</p>
    pub fn r#type(mut self, input: crate::types::FieldType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The data type of the field.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::FieldType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The data type of the field.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::FieldType> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`Field`](crate::types::Field).
    pub fn build(self) -> crate::types::Field {
        crate::types::Field {
            name: self.name,
            r#type: self.r#type,
        }
    }
}