aws_sdk_schemas/operation/create_discoverer/
_create_discoverer_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 CreateDiscovererInput {
6    /// <p>A description for the discoverer.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The ARN of the event bus.</p>
9    pub source_arn: ::std::option::Option<::std::string::String>,
10    /// <p>Support discovery of schemas in events sent to the bus from another account. (default: true).</p>
11    pub cross_account: ::std::option::Option<bool>,
12    /// <p>Tags associated with the resource.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateDiscovererInput {
16    /// <p>A description for the discoverer.</p>
17    pub fn description(&self) -> ::std::option::Option<&str> {
18        self.description.as_deref()
19    }
20    /// <p>The ARN of the event bus.</p>
21    pub fn source_arn(&self) -> ::std::option::Option<&str> {
22        self.source_arn.as_deref()
23    }
24    /// <p>Support discovery of schemas in events sent to the bus from another account. (default: true).</p>
25    pub fn cross_account(&self) -> ::std::option::Option<bool> {
26        self.cross_account
27    }
28    /// <p>Tags associated with the resource.</p>
29    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    /// Creates a new builder-style object to manufacture [`CreateDiscovererInput`](crate::operation::create_discoverer::CreateDiscovererInput).
35    pub fn builder() -> crate::operation::create_discoverer::builders::CreateDiscovererInputBuilder {
36        crate::operation::create_discoverer::builders::CreateDiscovererInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateDiscovererInput`](crate::operation::create_discoverer::CreateDiscovererInput).
41#[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    /// <p>A description for the discoverer.</p>
51    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    /// <p>A description for the discoverer.</p>
56    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.description = input;
58        self
59    }
60    /// <p>A description for the discoverer.</p>
61    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
62        &self.description
63    }
64    /// <p>The ARN of the event bus.</p>
65    /// This field is required.
66    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    /// <p>The ARN of the event bus.</p>
71    pub fn set_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.source_arn = input;
73        self
74    }
75    /// <p>The ARN of the event bus.</p>
76    pub fn get_source_arn(&self) -> &::std::option::Option<::std::string::String> {
77        &self.source_arn
78    }
79    /// <p>Support discovery of schemas in events sent to the bus from another account. (default: true).</p>
80    pub fn cross_account(mut self, input: bool) -> Self {
81        self.cross_account = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>Support discovery of schemas in events sent to the bus from another account. (default: true).</p>
85    pub fn set_cross_account(mut self, input: ::std::option::Option<bool>) -> Self {
86        self.cross_account = input;
87        self
88    }
89    /// <p>Support discovery of schemas in events sent to the bus from another account. (default: true).</p>
90    pub fn get_cross_account(&self) -> &::std::option::Option<bool> {
91        &self.cross_account
92    }
93    /// Adds a key-value pair to `tags`.
94    ///
95    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
96    ///
97    /// <p>Tags associated with the resource.</p>
98    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    /// <p>Tags associated with the resource.</p>
105    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    /// <p>Tags associated with the resource.</p>
110    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
111        &self.tags
112    }
113    /// Consumes the builder and constructs a [`CreateDiscovererInput`](crate::operation::create_discoverer::CreateDiscovererInput).
114    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}