Skip to main content

aws_sdk_elementalinference/operation/update_feed/
_update_feed_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 UpdateFeedInput {
6    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the feed to update.</p>
9    pub id: ::std::option::Option<::std::string::String>,
10    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
11    pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::UpdateOutput>>,
12}
13impl UpdateFeedInput {
14    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
15    pub fn name(&self) -> ::std::option::Option<&str> {
16        self.name.as_deref()
17    }
18    /// <p>The ID of the feed to update.</p>
19    pub fn id(&self) -> ::std::option::Option<&str> {
20        self.id.as_deref()
21    }
22    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
23    ///
24    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.outputs.is_none()`.
25    pub fn outputs(&self) -> &[crate::types::UpdateOutput] {
26        self.outputs.as_deref().unwrap_or_default()
27    }
28}
29impl UpdateFeedInput {
30    /// Creates a new builder-style object to manufacture [`UpdateFeedInput`](crate::operation::update_feed::UpdateFeedInput).
31    pub fn builder() -> crate::operation::update_feed::builders::UpdateFeedInputBuilder {
32        crate::operation::update_feed::builders::UpdateFeedInputBuilder::default()
33    }
34}
35
36/// A builder for [`UpdateFeedInput`](crate::operation::update_feed::UpdateFeedInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct UpdateFeedInputBuilder {
40    pub(crate) name: ::std::option::Option<::std::string::String>,
41    pub(crate) id: ::std::option::Option<::std::string::String>,
42    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::UpdateOutput>>,
43}
44impl UpdateFeedInputBuilder {
45    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
46    /// This field is required.
47    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.name = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
52    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.name = input;
54        self
55    }
56    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
57    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
58        &self.name
59    }
60    /// <p>The ID of the feed to update.</p>
61    /// This field is required.
62    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.id = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The ID of the feed to update.</p>
67    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.id = input;
69        self
70    }
71    /// <p>The ID of the feed to update.</p>
72    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.id
74    }
75    /// Appends an item to `outputs`.
76    ///
77    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
78    ///
79    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
80    pub fn outputs(mut self, input: crate::types::UpdateOutput) -> Self {
81        let mut v = self.outputs.unwrap_or_default();
82        v.push(input);
83        self.outputs = ::std::option::Option::Some(v);
84        self
85    }
86    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
87    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UpdateOutput>>) -> Self {
88        self.outputs = input;
89        self
90    }
91    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
92    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UpdateOutput>> {
93        &self.outputs
94    }
95    /// Consumes the builder and constructs a [`UpdateFeedInput`](crate::operation::update_feed::UpdateFeedInput).
96    pub fn build(self) -> ::std::result::Result<crate::operation::update_feed::UpdateFeedInput, ::aws_smithy_types::error::operation::BuildError> {
97        ::std::result::Result::Ok(crate::operation::update_feed::UpdateFeedInput {
98            name: self.name,
99            id: self.id,
100            outputs: self.outputs,
101        })
102    }
103}