Skip to main content

aws_sdk_elementalinference/operation/get_feed/
_get_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 GetFeedOutput {
6    /// <p>The ARN of the feed.</p>
7    pub arn: ::std::string::String,
8    /// <p>The name of the feed being queried.</p>
9    pub name: ::std::string::String,
10    /// <p>The ID of the feed being queried.</p>
11    pub id: ::std::string::String,
12    /// <p>The dataEndpoints of the feed being queried.</p>
13    pub data_endpoints: ::std::vec::Vec<::std::string::String>,
14    /// <p>An array of the outputs in the feed being queried.</p>
15    pub outputs: ::std::vec::Vec<crate::types::GetOutput>,
16    /// <p>The status of the feed being queried.</p>
17    pub status: crate::types::FeedStatus,
18    /// <p>Information about the resource, if any, associated with the feed being queried.</p>
19    pub association: ::std::option::Option<crate::types::FeedAssociation>,
20    /// <p>A list of the tags, if any, for the feed being queried.</p>
21    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22    _request_id: Option<String>,
23}
24impl GetFeedOutput {
25    /// <p>The ARN of the feed.</p>
26    pub fn arn(&self) -> &str {
27        use std::ops::Deref;
28        self.arn.deref()
29    }
30    /// <p>The name of the feed being queried.</p>
31    pub fn name(&self) -> &str {
32        use std::ops::Deref;
33        self.name.deref()
34    }
35    /// <p>The ID of the feed being queried.</p>
36    pub fn id(&self) -> &str {
37        use std::ops::Deref;
38        self.id.deref()
39    }
40    /// <p>The dataEndpoints of the feed being queried.</p>
41    pub fn data_endpoints(&self) -> &[::std::string::String] {
42        use std::ops::Deref;
43        self.data_endpoints.deref()
44    }
45    /// <p>An array of the outputs in the feed being queried.</p>
46    pub fn outputs(&self) -> &[crate::types::GetOutput] {
47        use std::ops::Deref;
48        self.outputs.deref()
49    }
50    /// <p>The status of the feed being queried.</p>
51    pub fn status(&self) -> &crate::types::FeedStatus {
52        &self.status
53    }
54    /// <p>Information about the resource, if any, associated with the feed being queried.</p>
55    pub fn association(&self) -> ::std::option::Option<&crate::types::FeedAssociation> {
56        self.association.as_ref()
57    }
58    /// <p>A list of the tags, if any, for the feed being queried.</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 GetFeedOutput {
64    fn request_id(&self) -> Option<&str> {
65        self._request_id.as_deref()
66    }
67}
68impl GetFeedOutput {
69    /// Creates a new builder-style object to manufacture [`GetFeedOutput`](crate::operation::get_feed::GetFeedOutput).
70    pub fn builder() -> crate::operation::get_feed::builders::GetFeedOutputBuilder {
71        crate::operation::get_feed::builders::GetFeedOutputBuilder::default()
72    }
73}
74
75/// A builder for [`GetFeedOutput`](crate::operation::get_feed::GetFeedOutput).
76#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
77#[non_exhaustive]
78pub struct GetFeedOutputBuilder {
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 GetFeedOutputBuilder {
90    /// <p>The ARN of 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>The ARN of 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>The ARN of the feed.</p>
102    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
103        &self.arn
104    }
105    /// <p>The name of the feed being queried.</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 of the feed being queried.</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 of the feed being queried.</p>
117    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
118        &self.name
119    }
120    /// <p>The ID of the feed being queried.</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>The ID of the feed being queried.</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>The ID of the feed being queried.</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>The dataEndpoints of the feed being queried.</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>The dataEndpoints of the feed being queried.</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>The dataEndpoints of the feed being queried.</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>An array of the outputs in the feed being queried.</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>An array of the outputs in the feed being queried.</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>An array of the outputs in the feed being queried.</p>
172    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GetOutput>> {
173        &self.outputs
174    }
175    /// <p>The status of the feed being queried.</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 status of the feed being queried.</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 status of the feed being queried.</p>
187    pub fn get_status(&self) -> &::std::option::Option<crate::types::FeedStatus> {
188        &self.status
189    }
190    /// <p>Information about the resource, if any, associated with the feed being queried.</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>Information about the resource, if any, associated with the feed being queried.</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>Information about the resource, if any, associated with the feed being queried.</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>A list of the tags, if any, for the feed being queried.</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>A list of the tags, if any, for the feed being queried.</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>A list of the tags, if any, for the feed being queried.</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 [`GetFeedOutput`](crate::operation::get_feed::GetFeedOutput).
234    /// This method will fail if any of the following fields are not set:
235    /// - [`arn`](crate::operation::get_feed::builders::GetFeedOutputBuilder::arn)
236    /// - [`name`](crate::operation::get_feed::builders::GetFeedOutputBuilder::name)
237    /// - [`id`](crate::operation::get_feed::builders::GetFeedOutputBuilder::id)
238    /// - [`data_endpoints`](crate::operation::get_feed::builders::GetFeedOutputBuilder::data_endpoints)
239    /// - [`outputs`](crate::operation::get_feed::builders::GetFeedOutputBuilder::outputs)
240    /// - [`status`](crate::operation::get_feed::builders::GetFeedOutputBuilder::status)
241    pub fn build(self) -> ::std::result::Result<crate::operation::get_feed::GetFeedOutput, ::aws_smithy_types::error::operation::BuildError> {
242        ::std::result::Result::Ok(crate::operation::get_feed::GetFeedOutput {
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 GetFeedOutput",
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 GetFeedOutput",
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 GetFeedOutput",
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 GetFeedOutput",
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 GetFeedOutput",
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 GetFeedOutput",
277                )
278            })?,
279            association: self.association,
280            tags: self.tags,
281            _request_id: self._request_id,
282        })
283    }
284}