aws_sdk_chimesdkmessaging/types/
_message_attribute_value.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A list of message attribute values.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct MessageAttributeValue {
7    /// <p>The strings in a message attribute value.</p>
8    pub string_values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9}
10impl MessageAttributeValue {
11    /// <p>The strings in a message attribute value.</p>
12    ///
13    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.string_values.is_none()`.
14    pub fn string_values(&self) -> &[::std::string::String] {
15        self.string_values.as_deref().unwrap_or_default()
16    }
17}
18impl MessageAttributeValue {
19    /// Creates a new builder-style object to manufacture [`MessageAttributeValue`](crate::types::MessageAttributeValue).
20    pub fn builder() -> crate::types::builders::MessageAttributeValueBuilder {
21        crate::types::builders::MessageAttributeValueBuilder::default()
22    }
23}
24
25/// A builder for [`MessageAttributeValue`](crate::types::MessageAttributeValue).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct MessageAttributeValueBuilder {
29    pub(crate) string_values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
30}
31impl MessageAttributeValueBuilder {
32    /// Appends an item to `string_values`.
33    ///
34    /// To override the contents of this collection use [`set_string_values`](Self::set_string_values).
35    ///
36    /// <p>The strings in a message attribute value.</p>
37    pub fn string_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
38        let mut v = self.string_values.unwrap_or_default();
39        v.push(input.into());
40        self.string_values = ::std::option::Option::Some(v);
41        self
42    }
43    /// <p>The strings in a message attribute value.</p>
44    pub fn set_string_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
45        self.string_values = input;
46        self
47    }
48    /// <p>The strings in a message attribute value.</p>
49    pub fn get_string_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
50        &self.string_values
51    }
52    /// Consumes the builder and constructs a [`MessageAttributeValue`](crate::types::MessageAttributeValue).
53    pub fn build(self) -> crate::types::MessageAttributeValue {
54        crate::types::MessageAttributeValue {
55            string_values: self.string_values,
56        }
57    }
58}