1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An entity supported by a given <code>ConnectionType</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Entity {
/// <p>The name of the entity.</p>
pub entity_name: ::std::option::Option<::std::string::String>,
/// <p>Label used for the entity.</p>
pub label: ::std::option::Option<::std::string::String>,
/// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
pub is_parent_entity: ::std::option::Option<bool>,
/// <p>A description of the entity.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
pub category: ::std::option::Option<::std::string::String>,
/// <p>An optional map of keys which may be returned for an entity by a connector.</p>
pub custom_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Entity {
/// <p>The name of the entity.</p>
pub fn entity_name(&self) -> ::std::option::Option<&str> {
self.entity_name.as_deref()
}
/// <p>Label used for the entity.</p>
pub fn label(&self) -> ::std::option::Option<&str> {
self.label.as_deref()
}
/// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
pub fn is_parent_entity(&self) -> ::std::option::Option<bool> {
self.is_parent_entity
}
/// <p>A description of the entity.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
pub fn category(&self) -> ::std::option::Option<&str> {
self.category.as_deref()
}
/// <p>An optional map of keys which may be returned for an entity by a connector.</p>
pub fn custom_properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.custom_properties.as_ref()
}
}
impl Entity {
/// Creates a new builder-style object to manufacture [`Entity`](crate::types::Entity).
pub fn builder() -> crate::types::builders::EntityBuilder {
crate::types::builders::EntityBuilder::default()
}
}
/// A builder for [`Entity`](crate::types::Entity).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EntityBuilder {
pub(crate) entity_name: ::std::option::Option<::std::string::String>,
pub(crate) label: ::std::option::Option<::std::string::String>,
pub(crate) is_parent_entity: ::std::option::Option<bool>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) category: ::std::option::Option<::std::string::String>,
pub(crate) custom_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl EntityBuilder {
/// <p>The name of the entity.</p>
pub fn entity_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.entity_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the entity.</p>
pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.entity_name = input;
self
}
/// <p>The name of the entity.</p>
pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
&self.entity_name
}
/// <p>Label used for the entity.</p>
pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.label = ::std::option::Option::Some(input.into());
self
}
/// <p>Label used for the entity.</p>
pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.label = input;
self
}
/// <p>Label used for the entity.</p>
pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
&self.label
}
/// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
pub fn is_parent_entity(mut self, input: bool) -> Self {
self.is_parent_entity = ::std::option::Option::Some(input);
self
}
/// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
pub fn set_is_parent_entity(mut self, input: ::std::option::Option<bool>) -> Self {
self.is_parent_entity = input;
self
}
/// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
pub fn get_is_parent_entity(&self) -> &::std::option::Option<bool> {
&self.is_parent_entity
}
/// <p>A description of the entity.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the entity.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>A description of the entity.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
pub fn category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.category = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
pub fn set_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.category = input;
self
}
/// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
pub fn get_category(&self) -> &::std::option::Option<::std::string::String> {
&self.category
}
/// Adds a key-value pair to `custom_properties`.
///
/// To override the contents of this collection use [`set_custom_properties`](Self::set_custom_properties).
///
/// <p>An optional map of keys which may be returned for an entity by a connector.</p>
pub fn custom_properties(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.custom_properties.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.custom_properties = ::std::option::Option::Some(hash_map);
self
}
/// <p>An optional map of keys which may be returned for an entity by a connector.</p>
pub fn set_custom_properties(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.custom_properties = input;
self
}
/// <p>An optional map of keys which may be returned for an entity by a connector.</p>
pub fn get_custom_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.custom_properties
}
/// Consumes the builder and constructs a [`Entity`](crate::types::Entity).
pub fn build(self) -> crate::types::Entity {
crate::types::Entity {
entity_name: self.entity_name,
label: self.label,
is_parent_entity: self.is_parent_entity,
description: self.description,
category: self.category,
custom_properties: self.custom_properties,
}
}
}