aws-sdk-connect 1.153.0

AWS SDK for Amazon Connect Service
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 UpdatePredefinedAttributeInput {
    /// <p>The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the predefined attribute.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The values of the predefined attribute.</p>
    pub values: ::std::option::Option<crate::types::PredefinedAttributeValues>,
    /// <p>Values that enable you to categorize your predefined attributes. You can use them in custom UI elements across the Amazon Connect admin website.</p>
    pub purposes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Custom metadata that is associated to predefined attributes to control behavior in upstream services, such as controlling how a predefined attribute should be displayed in the Amazon Connect admin website.</p>
    pub attribute_configuration: ::std::option::Option<crate::types::InputPredefinedAttributeConfiguration>,
}
impl UpdatePredefinedAttributeInput {
    /// <p>The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>The name of the predefined attribute.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The values of the predefined attribute.</p>
    pub fn values(&self) -> ::std::option::Option<&crate::types::PredefinedAttributeValues> {
        self.values.as_ref()
    }
    /// <p>Values that enable you to categorize your predefined attributes. You can use them in custom UI elements across the Amazon Connect admin website.</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 `.purposes.is_none()`.
    pub fn purposes(&self) -> &[::std::string::String] {
        self.purposes.as_deref().unwrap_or_default()
    }
    /// <p>Custom metadata that is associated to predefined attributes to control behavior in upstream services, such as controlling how a predefined attribute should be displayed in the Amazon Connect admin website.</p>
    pub fn attribute_configuration(&self) -> ::std::option::Option<&crate::types::InputPredefinedAttributeConfiguration> {
        self.attribute_configuration.as_ref()
    }
}
impl UpdatePredefinedAttributeInput {
    /// Creates a new builder-style object to manufacture [`UpdatePredefinedAttributeInput`](crate::operation::update_predefined_attribute::UpdatePredefinedAttributeInput).
    pub fn builder() -> crate::operation::update_predefined_attribute::builders::UpdatePredefinedAttributeInputBuilder {
        crate::operation::update_predefined_attribute::builders::UpdatePredefinedAttributeInputBuilder::default()
    }
}

/// A builder for [`UpdatePredefinedAttributeInput`](crate::operation::update_predefined_attribute::UpdatePredefinedAttributeInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdatePredefinedAttributeInputBuilder {
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) values: ::std::option::Option<crate::types::PredefinedAttributeValues>,
    pub(crate) purposes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) attribute_configuration: ::std::option::Option<crate::types::InputPredefinedAttributeConfiguration>,
}
impl UpdatePredefinedAttributeInputBuilder {
    /// <p>The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
    /// This field is required.
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// <p>The name of the predefined attribute.</p>
    /// This field is required.
    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 predefined attribute.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the predefined attribute.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The values of the predefined attribute.</p>
    pub fn values(mut self, input: crate::types::PredefinedAttributeValues) -> Self {
        self.values = ::std::option::Option::Some(input);
        self
    }
    /// <p>The values of the predefined attribute.</p>
    pub fn set_values(mut self, input: ::std::option::Option<crate::types::PredefinedAttributeValues>) -> Self {
        self.values = input;
        self
    }
    /// <p>The values of the predefined attribute.</p>
    pub fn get_values(&self) -> &::std::option::Option<crate::types::PredefinedAttributeValues> {
        &self.values
    }
    /// Appends an item to `purposes`.
    ///
    /// To override the contents of this collection use [`set_purposes`](Self::set_purposes).
    ///
    /// <p>Values that enable you to categorize your predefined attributes. You can use them in custom UI elements across the Amazon Connect admin website.</p>
    pub fn purposes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.purposes.unwrap_or_default();
        v.push(input.into());
        self.purposes = ::std::option::Option::Some(v);
        self
    }
    /// <p>Values that enable you to categorize your predefined attributes. You can use them in custom UI elements across the Amazon Connect admin website.</p>
    pub fn set_purposes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.purposes = input;
        self
    }
    /// <p>Values that enable you to categorize your predefined attributes. You can use them in custom UI elements across the Amazon Connect admin website.</p>
    pub fn get_purposes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.purposes
    }
    /// <p>Custom metadata that is associated to predefined attributes to control behavior in upstream services, such as controlling how a predefined attribute should be displayed in the Amazon Connect admin website.</p>
    pub fn attribute_configuration(mut self, input: crate::types::InputPredefinedAttributeConfiguration) -> Self {
        self.attribute_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Custom metadata that is associated to predefined attributes to control behavior in upstream services, such as controlling how a predefined attribute should be displayed in the Amazon Connect admin website.</p>
    pub fn set_attribute_configuration(mut self, input: ::std::option::Option<crate::types::InputPredefinedAttributeConfiguration>) -> Self {
        self.attribute_configuration = input;
        self
    }
    /// <p>Custom metadata that is associated to predefined attributes to control behavior in upstream services, such as controlling how a predefined attribute should be displayed in the Amazon Connect admin website.</p>
    pub fn get_attribute_configuration(&self) -> &::std::option::Option<crate::types::InputPredefinedAttributeConfiguration> {
        &self.attribute_configuration
    }
    /// Consumes the builder and constructs a [`UpdatePredefinedAttributeInput`](crate::operation::update_predefined_attribute::UpdatePredefinedAttributeInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_predefined_attribute::UpdatePredefinedAttributeInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_predefined_attribute::UpdatePredefinedAttributeInput {
            instance_id: self.instance_id,
            name: self.name,
            values: self.values,
            purposes: self.purposes,
            attribute_configuration: self.attribute_configuration,
        })
    }
}