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 ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. You can specify the existing role (to leave it unchanged) or a new role. You specify one access role for each feed.</p>
9    pub access_role_arn: ::std::option::Option<::std::string::String>,
10    /// <p>The ID of the feed to update.</p>
11    pub id: ::std::option::Option<::std::string::String>,
12    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
13    pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::UpdateOutput>>,
14}
15impl UpdateFeedInput {
16    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. You can specify the existing role (to leave it unchanged) or a new role. You specify one access role for each feed.</p>
21    pub fn access_role_arn(&self) -> ::std::option::Option<&str> {
22        self.access_role_arn.as_deref()
23    }
24    /// <p>The ID of the feed to update.</p>
25    pub fn id(&self) -> ::std::option::Option<&str> {
26        self.id.as_deref()
27    }
28    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
29    ///
30    /// 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()`.
31    pub fn outputs(&self) -> &[crate::types::UpdateOutput] {
32        self.outputs.as_deref().unwrap_or_default()
33    }
34}
35impl UpdateFeedInput {
36    /// Creates a new builder-style object to manufacture [`UpdateFeedInput`](crate::operation::update_feed::UpdateFeedInput).
37    pub fn builder() -> crate::operation::update_feed::builders::UpdateFeedInputBuilder {
38        crate::operation::update_feed::builders::UpdateFeedInputBuilder::default()
39    }
40}
41
42/// A builder for [`UpdateFeedInput`](crate::operation::update_feed::UpdateFeedInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateFeedInputBuilder {
46    pub(crate) name: ::std::option::Option<::std::string::String>,
47    pub(crate) access_role_arn: ::std::option::Option<::std::string::String>,
48    pub(crate) id: ::std::option::Option<::std::string::String>,
49    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::UpdateOutput>>,
50}
51impl UpdateFeedInputBuilder {
52    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
53    /// This field is required.
54    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.name = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
59    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.name = input;
61        self
62    }
63    /// <p>Required. You can specify the existing name (to leave it unchanged) or a new name.</p>
64    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
65        &self.name
66    }
67    /// <p>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. You can specify the existing role (to leave it unchanged) or a new role. You specify one access role for each feed.</p>
68    pub fn access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.access_role_arn = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. You can specify the existing role (to leave it unchanged) or a new role. You specify one access role for each feed.</p>
73    pub fn set_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.access_role_arn = input;
75        self
76    }
77    /// <p>The ARN of an IAM role that Elemental Inference assumes to access resources in your account on your behalf. You can specify the existing role (to leave it unchanged) or a new role. You specify one access role for each feed.</p>
78    pub fn get_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
79        &self.access_role_arn
80    }
81    /// <p>The ID of the feed to update.</p>
82    /// This field is required.
83    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.id = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The ID of the feed to update.</p>
88    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.id = input;
90        self
91    }
92    /// <p>The ID of the feed to update.</p>
93    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
94        &self.id
95    }
96    /// Appends an item to `outputs`.
97    ///
98    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
99    ///
100    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
101    pub fn outputs(mut self, input: crate::types::UpdateOutput) -> Self {
102        let mut v = self.outputs.unwrap_or_default();
103        v.push(input);
104        self.outputs = ::std::option::Option::Some(v);
105        self
106    }
107    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
108    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UpdateOutput>>) -> Self {
109        self.outputs = input;
110        self
111    }
112    /// <p>Required. You can specify the existing array of outputs (to leave outputs unchanged) or you can specify a new array.</p>
113    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UpdateOutput>> {
114        &self.outputs
115    }
116    /// Consumes the builder and constructs a [`UpdateFeedInput`](crate::operation::update_feed::UpdateFeedInput).
117    pub fn build(self) -> ::std::result::Result<crate::operation::update_feed::UpdateFeedInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::update_feed::UpdateFeedInput {
119            name: self.name,
120            access_role_arn: self.access_role_arn,
121            id: self.id,
122            outputs: self.outputs,
123        })
124    }
125}