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