Skip to main content

aws_sdk_elementalinference/operation/create_feed/
_create_feed_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 CreateFeedOutput {
6    /// <p>A unique ARN that Elemental Inference assigns to the feed.</p>
7    pub arn: ::std::string::String,
8    /// <p>The name that you specified in the request.</p>
9    pub name: ::std::string::String,
10    /// <p>A unique ID that Elemental Inference assigns to the feed.</p>
11    pub id: ::std::string::String,
12    /// <p>An array of endpoints for the feed. Typically, there is only one endpoint. The feed receives source media at this endpoint (when the calling application calls PutMedia) and returns the resulting metadata to this endpoint (when the calling application calls GetMetadata).</p>
13    pub data_endpoints: ::std::vec::Vec<::std::string::String>,
14    /// <p>Repeats the outputs that you specified in the request.</p>
15    pub outputs: ::std::vec::Vec<crate::types::GetOutput>,
16    /// <p>The current status of the feed. After creation of the feed has succeeded, the status will be AVAILABLE.</p>
17    pub status: crate::types::FeedStatus,
18    /// <p>The association for this feed. When you create the feed, this property is empty. You must associate a resource with the feed using AssociateFeed or UpdateFeed.</p>
19    pub association: ::std::option::Option<crate::types::FeedAssociation>,
20    /// <p>Any tags that you included when you created the feed.</p>
21    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22    _request_id: Option<String>,
23}
24impl CreateFeedOutput {
25    /// <p>A unique ARN that Elemental Inference assigns to the feed.</p>
26    pub fn arn(&self) -> &str {
27        use std::ops::Deref;
28        self.arn.deref()
29    }
30    /// <p>The name that you specified in the request.</p>
31    pub fn name(&self) -> &str {
32        use std::ops::Deref;
33        self.name.deref()
34    }
35    /// <p>A unique ID that Elemental Inference assigns to the feed.</p>
36    pub fn id(&self) -> &str {
37        use std::ops::Deref;
38        self.id.deref()
39    }
40    /// <p>An array of endpoints for the feed. Typically, there is only one endpoint. The feed receives source media at this endpoint (when the calling application calls PutMedia) and returns the resulting metadata to this endpoint (when the calling application calls GetMetadata).</p>
41    pub fn data_endpoints(&self) -> &[::std::string::String] {
42        use std::ops::Deref;
43        self.data_endpoints.deref()
44    }
45    /// <p>Repeats the outputs that you specified in the request.</p>
46    pub fn outputs(&self) -> &[crate::types::GetOutput] {
47        use std::ops::Deref;
48        self.outputs.deref()
49    }
50    /// <p>The current status of the feed. After creation of the feed has succeeded, the status will be AVAILABLE.</p>
51    pub fn status(&self) -> &crate::types::FeedStatus {
52        &self.status
53    }
54    /// <p>The association for this feed. When you create the feed, this property is empty. You must associate a resource with the feed using AssociateFeed or UpdateFeed.</p>
55    pub fn association(&self) -> ::std::option::Option<&crate::types::FeedAssociation> {
56        self.association.as_ref()
57    }
58    /// <p>Any tags that you included when you created the feed.</p>
59    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
60        self.tags.as_ref()
61    }
62}
63impl ::aws_types::request_id::RequestId for CreateFeedOutput {
64    fn request_id(&self) -> Option<&str> {
65        self._request_id.as_deref()
66    }
67}
68impl CreateFeedOutput {
69    /// Creates a new builder-style object to manufacture [`CreateFeedOutput`](crate::operation::create_feed::CreateFeedOutput).
70    pub fn builder() -> crate::operation::create_feed::builders::CreateFeedOutputBuilder {
71        crate::operation::create_feed::builders::CreateFeedOutputBuilder::default()
72    }
73}
74
75/// A builder for [`CreateFeedOutput`](crate::operation::create_feed::CreateFeedOutput).
76#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
77#[non_exhaustive]
78pub struct CreateFeedOutputBuilder {
79    pub(crate) arn: ::std::option::Option<::std::string::String>,
80    pub(crate) name: ::std::option::Option<::std::string::String>,
81    pub(crate) id: ::std::option::Option<::std::string::String>,
82    pub(crate) data_endpoints: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
83    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::GetOutput>>,
84    pub(crate) status: ::std::option::Option<crate::types::FeedStatus>,
85    pub(crate) association: ::std::option::Option<crate::types::FeedAssociation>,
86    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
87    _request_id: Option<String>,
88}
89impl CreateFeedOutputBuilder {
90    /// <p>A unique ARN that Elemental Inference assigns to the feed.</p>
91    /// This field is required.
92    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.arn = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>A unique ARN that Elemental Inference assigns to the feed.</p>
97    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.arn = input;
99        self
100    }
101    /// <p>A unique ARN that Elemental Inference assigns to the feed.</p>
102    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
103        &self.arn
104    }
105    /// <p>The name that you specified in the request.</p>
106    /// This field is required.
107    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.name = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>The name that you specified in the request.</p>
112    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.name = input;
114        self
115    }
116    /// <p>The name that you specified in the request.</p>
117    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
118        &self.name
119    }
120    /// <p>A unique ID that Elemental Inference assigns to the feed.</p>
121    /// This field is required.
122    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.id = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>A unique ID that Elemental Inference assigns to the feed.</p>
127    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.id = input;
129        self
130    }
131    /// <p>A unique ID that Elemental Inference assigns to the feed.</p>
132    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
133        &self.id
134    }
135    /// Appends an item to `data_endpoints`.
136    ///
137    /// To override the contents of this collection use [`set_data_endpoints`](Self::set_data_endpoints).
138    ///
139    /// <p>An array of endpoints for the feed. Typically, there is only one endpoint. The feed receives source media at this endpoint (when the calling application calls PutMedia) and returns the resulting metadata to this endpoint (when the calling application calls GetMetadata).</p>
140    pub fn data_endpoints(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        let mut v = self.data_endpoints.unwrap_or_default();
142        v.push(input.into());
143        self.data_endpoints = ::std::option::Option::Some(v);
144        self
145    }
146    /// <p>An array of endpoints for the feed. Typically, there is only one endpoint. The feed receives source media at this endpoint (when the calling application calls PutMedia) and returns the resulting metadata to this endpoint (when the calling application calls GetMetadata).</p>
147    pub fn set_data_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
148        self.data_endpoints = input;
149        self
150    }
151    /// <p>An array of endpoints for the feed. Typically, there is only one endpoint. The feed receives source media at this endpoint (when the calling application calls PutMedia) and returns the resulting metadata to this endpoint (when the calling application calls GetMetadata).</p>
152    pub fn get_data_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
153        &self.data_endpoints
154    }
155    /// Appends an item to `outputs`.
156    ///
157    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
158    ///
159    /// <p>Repeats the outputs that you specified in the request.</p>
160    pub fn outputs(mut self, input: crate::types::GetOutput) -> Self {
161        let mut v = self.outputs.unwrap_or_default();
162        v.push(input);
163        self.outputs = ::std::option::Option::Some(v);
164        self
165    }
166    /// <p>Repeats the outputs that you specified in the request.</p>
167    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GetOutput>>) -> Self {
168        self.outputs = input;
169        self
170    }
171    /// <p>Repeats the outputs that you specified in the request.</p>
172    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GetOutput>> {
173        &self.outputs
174    }
175    /// <p>The current status of the feed. After creation of the feed has succeeded, the status will be AVAILABLE.</p>
176    /// This field is required.
177    pub fn status(mut self, input: crate::types::FeedStatus) -> Self {
178        self.status = ::std::option::Option::Some(input);
179        self
180    }
181    /// <p>The current status of the feed. After creation of the feed has succeeded, the status will be AVAILABLE.</p>
182    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FeedStatus>) -> Self {
183        self.status = input;
184        self
185    }
186    /// <p>The current status of the feed. After creation of the feed has succeeded, the status will be AVAILABLE.</p>
187    pub fn get_status(&self) -> &::std::option::Option<crate::types::FeedStatus> {
188        &self.status
189    }
190    /// <p>The association for this feed. When you create the feed, this property is empty. You must associate a resource with the feed using AssociateFeed or UpdateFeed.</p>
191    pub fn association(mut self, input: crate::types::FeedAssociation) -> Self {
192        self.association = ::std::option::Option::Some(input);
193        self
194    }
195    /// <p>The association for this feed. When you create the feed, this property is empty. You must associate a resource with the feed using AssociateFeed or UpdateFeed.</p>
196    pub fn set_association(mut self, input: ::std::option::Option<crate::types::FeedAssociation>) -> Self {
197        self.association = input;
198        self
199    }
200    /// <p>The association for this feed. When you create the feed, this property is empty. You must associate a resource with the feed using AssociateFeed or UpdateFeed.</p>
201    pub fn get_association(&self) -> &::std::option::Option<crate::types::FeedAssociation> {
202        &self.association
203    }
204    /// Adds a key-value pair to `tags`.
205    ///
206    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
207    ///
208    /// <p>Any tags that you included when you created the feed.</p>
209    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
210        let mut hash_map = self.tags.unwrap_or_default();
211        hash_map.insert(k.into(), v.into());
212        self.tags = ::std::option::Option::Some(hash_map);
213        self
214    }
215    /// <p>Any tags that you included when you created the feed.</p>
216    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
217        self.tags = input;
218        self
219    }
220    /// <p>Any tags that you included when you created the feed.</p>
221    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
222        &self.tags
223    }
224    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
225        self._request_id = Some(request_id.into());
226        self
227    }
228
229    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
230        self._request_id = request_id;
231        self
232    }
233    /// Consumes the builder and constructs a [`CreateFeedOutput`](crate::operation::create_feed::CreateFeedOutput).
234    /// This method will fail if any of the following fields are not set:
235    /// - [`arn`](crate::operation::create_feed::builders::CreateFeedOutputBuilder::arn)
236    /// - [`name`](crate::operation::create_feed::builders::CreateFeedOutputBuilder::name)
237    /// - [`id`](crate::operation::create_feed::builders::CreateFeedOutputBuilder::id)
238    /// - [`data_endpoints`](crate::operation::create_feed::builders::CreateFeedOutputBuilder::data_endpoints)
239    /// - [`outputs`](crate::operation::create_feed::builders::CreateFeedOutputBuilder::outputs)
240    /// - [`status`](crate::operation::create_feed::builders::CreateFeedOutputBuilder::status)
241    pub fn build(self) -> ::std::result::Result<crate::operation::create_feed::CreateFeedOutput, ::aws_smithy_types::error::operation::BuildError> {
242        ::std::result::Result::Ok(crate::operation::create_feed::CreateFeedOutput {
243            arn: self.arn.ok_or_else(|| {
244                ::aws_smithy_types::error::operation::BuildError::missing_field(
245                    "arn",
246                    "arn was not specified but it is required when building CreateFeedOutput",
247                )
248            })?,
249            name: self.name.ok_or_else(|| {
250                ::aws_smithy_types::error::operation::BuildError::missing_field(
251                    "name",
252                    "name was not specified but it is required when building CreateFeedOutput",
253                )
254            })?,
255            id: self.id.ok_or_else(|| {
256                ::aws_smithy_types::error::operation::BuildError::missing_field(
257                    "id",
258                    "id was not specified but it is required when building CreateFeedOutput",
259                )
260            })?,
261            data_endpoints: self.data_endpoints.ok_or_else(|| {
262                ::aws_smithy_types::error::operation::BuildError::missing_field(
263                    "data_endpoints",
264                    "data_endpoints was not specified but it is required when building CreateFeedOutput",
265                )
266            })?,
267            outputs: self.outputs.ok_or_else(|| {
268                ::aws_smithy_types::error::operation::BuildError::missing_field(
269                    "outputs",
270                    "outputs was not specified but it is required when building CreateFeedOutput",
271                )
272            })?,
273            status: self.status.ok_or_else(|| {
274                ::aws_smithy_types::error::operation::BuildError::missing_field(
275                    "status",
276                    "status was not specified but it is required when building CreateFeedOutput",
277                )
278            })?,
279            association: self.association,
280            tags: self.tags,
281            _request_id: self._request_id,
282        })
283    }
284}