aws_sdk_elementalinference/operation/create_feed/
_create_feed_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateFeedInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>,
10 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl CreateFeedInput {
14 pub fn name(&self) -> ::std::option::Option<&str> {
16 self.name.as_deref()
17 }
18 pub fn outputs(&self) -> &[crate::types::CreateOutput] {
22 self.outputs.as_deref().unwrap_or_default()
23 }
24 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
26 self.tags.as_ref()
27 }
28}
29impl CreateFeedInput {
30 pub fn builder() -> crate::operation::create_feed::builders::CreateFeedInputBuilder {
32 crate::operation::create_feed::builders::CreateFeedInputBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateFeedInputBuilder {
40 pub(crate) name: ::std::option::Option<::std::string::String>,
41 pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>,
42 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
43}
44impl CreateFeedInputBuilder {
45 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.name = input;
54 self
55 }
56 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
58 &self.name
59 }
60 pub fn outputs(mut self, input: crate::types::CreateOutput) -> Self {
66 let mut v = self.outputs.unwrap_or_default();
67 v.push(input);
68 self.outputs = ::std::option::Option::Some(v);
69 self
70 }
71 pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>>) -> Self {
73 self.outputs = input;
74 self
75 }
76 pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateOutput>> {
78 &self.outputs
79 }
80 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
86 let mut hash_map = self.tags.unwrap_or_default();
87 hash_map.insert(k.into(), v.into());
88 self.tags = ::std::option::Option::Some(hash_map);
89 self
90 }
91 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
93 self.tags = input;
94 self
95 }
96 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
98 &self.tags
99 }
100 pub fn build(self) -> ::std::result::Result<crate::operation::create_feed::CreateFeedInput, ::aws_smithy_types::error::operation::BuildError> {
102 ::std::result::Result::Ok(crate::operation::create_feed::CreateFeedInput {
103 name: self.name,
104 outputs: self.outputs,
105 tags: self.tags,
106 })
107 }
108}