aws-sdk-connect 1.166.0

AWS SDK for Amazon Connect Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A toggle for an individual feature at the instance level.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Attribute {
    /// <p>The type of attribute.</p>
    pub attribute_type: ::std::option::Option<crate::types::InstanceAttributeType>,
    /// <p>The value of the attribute.</p>
    pub value: ::std::option::Option<::std::string::String>,
}
impl Attribute {
    /// <p>The type of attribute.</p>
    pub fn attribute_type(&self) -> ::std::option::Option<&crate::types::InstanceAttributeType> {
        self.attribute_type.as_ref()
    }
    /// <p>The value of the attribute.</p>
    pub fn value(&self) -> ::std::option::Option<&str> {
        self.value.as_deref()
    }
}
impl Attribute {
    /// Creates a new builder-style object to manufacture [`Attribute`](crate::types::Attribute).
    pub fn builder() -> crate::types::builders::AttributeBuilder {
        crate::types::builders::AttributeBuilder::default()
    }
}

/// A builder for [`Attribute`](crate::types::Attribute).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AttributeBuilder {
    pub(crate) attribute_type: ::std::option::Option<crate::types::InstanceAttributeType>,
    pub(crate) value: ::std::option::Option<::std::string::String>,
}
impl AttributeBuilder {
    /// <p>The type of attribute.</p>
    pub fn attribute_type(mut self, input: crate::types::InstanceAttributeType) -> Self {
        self.attribute_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of attribute.</p>
    pub fn set_attribute_type(mut self, input: ::std::option::Option<crate::types::InstanceAttributeType>) -> Self {
        self.attribute_type = input;
        self
    }
    /// <p>The type of attribute.</p>
    pub fn get_attribute_type(&self) -> &::std::option::Option<crate::types::InstanceAttributeType> {
        &self.attribute_type
    }
    /// <p>The value of the attribute.</p>
    pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.value = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The value of the attribute.</p>
    pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.value = input;
        self
    }
    /// <p>The value of the attribute.</p>
    pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
        &self.value
    }
    /// Consumes the builder and constructs a [`Attribute`](crate::types::Attribute).
    pub fn build(self) -> crate::types::Attribute {
        crate::types::Attribute {
            attribute_type: self.attribute_type,
            value: self.value,
        }
    }
}