aws_sdk_schemas/operation/create_discoverer/
_create_discoverer_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateDiscovererInput {
6 pub description: ::std::option::Option<::std::string::String>,
8 pub source_arn: ::std::option::Option<::std::string::String>,
10 pub cross_account: ::std::option::Option<bool>,
12 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateDiscovererInput {
16 pub fn description(&self) -> ::std::option::Option<&str> {
18 self.description.as_deref()
19 }
20 pub fn source_arn(&self) -> ::std::option::Option<&str> {
22 self.source_arn.as_deref()
23 }
24 pub fn cross_account(&self) -> ::std::option::Option<bool> {
26 self.cross_account
27 }
28 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
30 self.tags.as_ref()
31 }
32}
33impl CreateDiscovererInput {
34 pub fn builder() -> crate::operation::create_discoverer::builders::CreateDiscovererInputBuilder {
36 crate::operation::create_discoverer::builders::CreateDiscovererInputBuilder::default()
37 }
38}
39
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateDiscovererInputBuilder {
44 pub(crate) description: ::std::option::Option<::std::string::String>,
45 pub(crate) source_arn: ::std::option::Option<::std::string::String>,
46 pub(crate) cross_account: ::std::option::Option<bool>,
47 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl CreateDiscovererInputBuilder {
50 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52 self.description = ::std::option::Option::Some(input.into());
53 self
54 }
55 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57 self.description = input;
58 self
59 }
60 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
62 &self.description
63 }
64 pub fn source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.source_arn = ::std::option::Option::Some(input.into());
68 self
69 }
70 pub fn set_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.source_arn = input;
73 self
74 }
75 pub fn get_source_arn(&self) -> &::std::option::Option<::std::string::String> {
77 &self.source_arn
78 }
79 pub fn cross_account(mut self, input: bool) -> Self {
81 self.cross_account = ::std::option::Option::Some(input);
82 self
83 }
84 pub fn set_cross_account(mut self, input: ::std::option::Option<bool>) -> Self {
86 self.cross_account = input;
87 self
88 }
89 pub fn get_cross_account(&self) -> &::std::option::Option<bool> {
91 &self.cross_account
92 }
93 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
99 let mut hash_map = self.tags.unwrap_or_default();
100 hash_map.insert(k.into(), v.into());
101 self.tags = ::std::option::Option::Some(hash_map);
102 self
103 }
104 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
106 self.tags = input;
107 self
108 }
109 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
111 &self.tags
112 }
113 pub fn build(
115 self,
116 ) -> ::std::result::Result<crate::operation::create_discoverer::CreateDiscovererInput, ::aws_smithy_types::error::operation::BuildError> {
117 ::std::result::Result::Ok(crate::operation::create_discoverer::CreateDiscovererInput {
118 description: self.description,
119 source_arn: self.source_arn,
120 cross_account: self.cross_account,
121 tags: self.tags,
122 })
123 }
124}