aws_sdk_iot/operation/update_dimension/
_update_dimension_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateDimensionOutput {
6    /// <p>A unique identifier for the dimension.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Name (ARN)of the created dimension.</p>
9    pub arn: ::std::option::Option<::std::string::String>,
10    /// <p>The type of the dimension.</p>
11    pub r#type: ::std::option::Option<crate::types::DimensionType>,
12    /// <p>The value or list of values used to scope the dimension. For example, for topic filters, this is the pattern used to match the MQTT topic name.</p>
13    pub string_values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14    /// <p>The date and time, in milliseconds since epoch, when the dimension was initially created.</p>
15    pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
16    /// <p>The date and time, in milliseconds since epoch, when the dimension was most recently updated.</p>
17    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
18    _request_id: Option<String>,
19}
20impl UpdateDimensionOutput {
21    /// <p>A unique identifier for the dimension.</p>
22    pub fn name(&self) -> ::std::option::Option<&str> {
23        self.name.as_deref()
24    }
25    /// <p>The Amazon Resource Name (ARN)of the created dimension.</p>
26    pub fn arn(&self) -> ::std::option::Option<&str> {
27        self.arn.as_deref()
28    }
29    /// <p>The type of the dimension.</p>
30    pub fn r#type(&self) -> ::std::option::Option<&crate::types::DimensionType> {
31        self.r#type.as_ref()
32    }
33    /// <p>The value or list of values used to scope the dimension. For example, for topic filters, this is the pattern used to match the MQTT topic name.</p>
34    ///
35    /// 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()`.
36    pub fn string_values(&self) -> &[::std::string::String] {
37        self.string_values.as_deref().unwrap_or_default()
38    }
39    /// <p>The date and time, in milliseconds since epoch, when the dimension was initially created.</p>
40    pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
41        self.creation_date.as_ref()
42    }
43    /// <p>The date and time, in milliseconds since epoch, when the dimension was most recently updated.</p>
44    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
45        self.last_modified_date.as_ref()
46    }
47}
48impl ::aws_types::request_id::RequestId for UpdateDimensionOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl UpdateDimensionOutput {
54    /// Creates a new builder-style object to manufacture [`UpdateDimensionOutput`](crate::operation::update_dimension::UpdateDimensionOutput).
55    pub fn builder() -> crate::operation::update_dimension::builders::UpdateDimensionOutputBuilder {
56        crate::operation::update_dimension::builders::UpdateDimensionOutputBuilder::default()
57    }
58}
59
60/// A builder for [`UpdateDimensionOutput`](crate::operation::update_dimension::UpdateDimensionOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct UpdateDimensionOutputBuilder {
64    pub(crate) name: ::std::option::Option<::std::string::String>,
65    pub(crate) arn: ::std::option::Option<::std::string::String>,
66    pub(crate) r#type: ::std::option::Option<crate::types::DimensionType>,
67    pub(crate) string_values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
68    pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
69    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
70    _request_id: Option<String>,
71}
72impl UpdateDimensionOutputBuilder {
73    /// <p>A unique identifier for the dimension.</p>
74    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>A unique identifier for the dimension.</p>
79    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.name = input;
81        self
82    }
83    /// <p>A unique identifier for the dimension.</p>
84    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.name
86    }
87    /// <p>The Amazon Resource Name (ARN)of the created dimension.</p>
88    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.arn = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The Amazon Resource Name (ARN)of the created dimension.</p>
93    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.arn = input;
95        self
96    }
97    /// <p>The Amazon Resource Name (ARN)of the created dimension.</p>
98    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
99        &self.arn
100    }
101    /// <p>The type of the dimension.</p>
102    pub fn r#type(mut self, input: crate::types::DimensionType) -> Self {
103        self.r#type = ::std::option::Option::Some(input);
104        self
105    }
106    /// <p>The type of the dimension.</p>
107    pub fn set_type(mut self, input: ::std::option::Option<crate::types::DimensionType>) -> Self {
108        self.r#type = input;
109        self
110    }
111    /// <p>The type of the dimension.</p>
112    pub fn get_type(&self) -> &::std::option::Option<crate::types::DimensionType> {
113        &self.r#type
114    }
115    /// Appends an item to `string_values`.
116    ///
117    /// To override the contents of this collection use [`set_string_values`](Self::set_string_values).
118    ///
119    /// <p>The value or list of values used to scope the dimension. For example, for topic filters, this is the pattern used to match the MQTT topic name.</p>
120    pub fn string_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        let mut v = self.string_values.unwrap_or_default();
122        v.push(input.into());
123        self.string_values = ::std::option::Option::Some(v);
124        self
125    }
126    /// <p>The value or list of values used to scope the dimension. For example, for topic filters, this is the pattern used to match the MQTT topic name.</p>
127    pub fn set_string_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
128        self.string_values = input;
129        self
130    }
131    /// <p>The value or list of values used to scope the dimension. For example, for topic filters, this is the pattern used to match the MQTT topic name.</p>
132    pub fn get_string_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
133        &self.string_values
134    }
135    /// <p>The date and time, in milliseconds since epoch, when the dimension was initially created.</p>
136    pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
137        self.creation_date = ::std::option::Option::Some(input);
138        self
139    }
140    /// <p>The date and time, in milliseconds since epoch, when the dimension was initially created.</p>
141    pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
142        self.creation_date = input;
143        self
144    }
145    /// <p>The date and time, in milliseconds since epoch, when the dimension was initially created.</p>
146    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
147        &self.creation_date
148    }
149    /// <p>The date and time, in milliseconds since epoch, when the dimension was most recently updated.</p>
150    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
151        self.last_modified_date = ::std::option::Option::Some(input);
152        self
153    }
154    /// <p>The date and time, in milliseconds since epoch, when the dimension was most recently updated.</p>
155    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
156        self.last_modified_date = input;
157        self
158    }
159    /// <p>The date and time, in milliseconds since epoch, when the dimension was most recently updated.</p>
160    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
161        &self.last_modified_date
162    }
163    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
164        self._request_id = Some(request_id.into());
165        self
166    }
167
168    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
169        self._request_id = request_id;
170        self
171    }
172    /// Consumes the builder and constructs a [`UpdateDimensionOutput`](crate::operation::update_dimension::UpdateDimensionOutput).
173    pub fn build(self) -> crate::operation::update_dimension::UpdateDimensionOutput {
174        crate::operation::update_dimension::UpdateDimensionOutput {
175            name: self.name,
176            arn: self.arn,
177            r#type: self.r#type,
178            string_values: self.string_values,
179            creation_date: self.creation_date,
180            last_modified_date: self.last_modified_date,
181            _request_id: self._request_id,
182        }
183    }
184}