aws_sdk_iot/operation/update_stream/
_update_stream_input.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 UpdateStreamInput {
6    /// <p>The stream ID.</p>
7    pub stream_id: ::std::option::Option<::std::string::String>,
8    /// <p>The description of the stream.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The files associated with the stream.</p>
11    pub files: ::std::option::Option<::std::vec::Vec<crate::types::StreamFile>>,
12    /// <p>An IAM role that allows the IoT service principal assumes to access your S3 files.</p>
13    pub role_arn: ::std::option::Option<::std::string::String>,
14}
15impl UpdateStreamInput {
16    /// <p>The stream ID.</p>
17    pub fn stream_id(&self) -> ::std::option::Option<&str> {
18        self.stream_id.as_deref()
19    }
20    /// <p>The description of the stream.</p>
21    pub fn description(&self) -> ::std::option::Option<&str> {
22        self.description.as_deref()
23    }
24    /// <p>The files associated with the stream.</p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.files.is_none()`.
27    pub fn files(&self) -> &[crate::types::StreamFile] {
28        self.files.as_deref().unwrap_or_default()
29    }
30    /// <p>An IAM role that allows the IoT service principal assumes to access your S3 files.</p>
31    pub fn role_arn(&self) -> ::std::option::Option<&str> {
32        self.role_arn.as_deref()
33    }
34}
35impl UpdateStreamInput {
36    /// Creates a new builder-style object to manufacture [`UpdateStreamInput`](crate::operation::update_stream::UpdateStreamInput).
37    pub fn builder() -> crate::operation::update_stream::builders::UpdateStreamInputBuilder {
38        crate::operation::update_stream::builders::UpdateStreamInputBuilder::default()
39    }
40}
41
42/// A builder for [`UpdateStreamInput`](crate::operation::update_stream::UpdateStreamInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateStreamInputBuilder {
46    pub(crate) stream_id: ::std::option::Option<::std::string::String>,
47    pub(crate) description: ::std::option::Option<::std::string::String>,
48    pub(crate) files: ::std::option::Option<::std::vec::Vec<crate::types::StreamFile>>,
49    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
50}
51impl UpdateStreamInputBuilder {
52    /// <p>The stream ID.</p>
53    /// This field is required.
54    pub fn stream_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.stream_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The stream ID.</p>
59    pub fn set_stream_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.stream_id = input;
61        self
62    }
63    /// <p>The stream ID.</p>
64    pub fn get_stream_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.stream_id
66    }
67    /// <p>The description of the stream.</p>
68    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.description = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The description of the stream.</p>
73    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.description = input;
75        self
76    }
77    /// <p>The description of the stream.</p>
78    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
79        &self.description
80    }
81    /// Appends an item to `files`.
82    ///
83    /// To override the contents of this collection use [`set_files`](Self::set_files).
84    ///
85    /// <p>The files associated with the stream.</p>
86    pub fn files(mut self, input: crate::types::StreamFile) -> Self {
87        let mut v = self.files.unwrap_or_default();
88        v.push(input);
89        self.files = ::std::option::Option::Some(v);
90        self
91    }
92    /// <p>The files associated with the stream.</p>
93    pub fn set_files(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StreamFile>>) -> Self {
94        self.files = input;
95        self
96    }
97    /// <p>The files associated with the stream.</p>
98    pub fn get_files(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StreamFile>> {
99        &self.files
100    }
101    /// <p>An IAM role that allows the IoT service principal assumes to access your S3 files.</p>
102    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.role_arn = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>An IAM role that allows the IoT service principal assumes to access your S3 files.</p>
107    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.role_arn = input;
109        self
110    }
111    /// <p>An IAM role that allows the IoT service principal assumes to access your S3 files.</p>
112    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
113        &self.role_arn
114    }
115    /// Consumes the builder and constructs a [`UpdateStreamInput`](crate::operation::update_stream::UpdateStreamInput).
116    pub fn build(
117        self,
118    ) -> ::std::result::Result<crate::operation::update_stream::UpdateStreamInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::update_stream::UpdateStreamInput {
120            stream_id: self.stream_id,
121            description: self.description,
122            files: self.files,
123            role_arn: self.role_arn,
124        })
125    }
126}