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