aws_sdk_iot/operation/create_stream/
_create_stream_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateStreamInput {
6 pub stream_id: ::std::option::Option<::std::string::String>,
8 pub description: ::std::option::Option<::std::string::String>,
10 pub files: ::std::option::Option<::std::vec::Vec<crate::types::StreamFile>>,
12 pub role_arn: ::std::option::Option<::std::string::String>,
14 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateStreamInput {
18 pub fn stream_id(&self) -> ::std::option::Option<&str> {
20 self.stream_id.as_deref()
21 }
22 pub fn description(&self) -> ::std::option::Option<&str> {
24 self.description.as_deref()
25 }
26 pub fn files(&self) -> &[crate::types::StreamFile] {
30 self.files.as_deref().unwrap_or_default()
31 }
32 pub fn role_arn(&self) -> ::std::option::Option<&str> {
34 self.role_arn.as_deref()
35 }
36 pub fn tags(&self) -> &[crate::types::Tag] {
40 self.tags.as_deref().unwrap_or_default()
41 }
42}
43impl CreateStreamInput {
44 pub fn builder() -> crate::operation::create_stream::builders::CreateStreamInputBuilder {
46 crate::operation::create_stream::builders::CreateStreamInputBuilder::default()
47 }
48}
49
50#[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 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 pub fn set_stream_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69 self.stream_id = input;
70 self
71 }
72 pub fn get_stream_id(&self) -> &::std::option::Option<::std::string::String> {
74 &self.stream_id
75 }
76 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83 self.description = input;
84 self
85 }
86 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
88 &self.description
89 }
90 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 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 pub fn get_files(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StreamFile>> {
108 &self.files
109 }
110 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 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.role_arn = input;
119 self
120 }
121 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
123 &self.role_arn
124 }
125 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
143 &self.tags
144 }
145 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}