aws_sdk_qconnect/operation/create_assistant/_create_assistant_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 CreateAssistantInput {
6 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
7 pub client_token: ::std::option::Option<::std::string::String>,
8 /// <p>The name of the assistant.</p>
9 pub name: ::std::option::Option<::std::string::String>,
10 /// <p>The type of assistant.</p>
11 pub r#type: ::std::option::Option<crate::types::AssistantType>,
12 /// <p>The description of the assistant.</p>
13 pub description: ::std::option::Option<::std::string::String>,
14 /// <p>The tags used to organize, track, or control access for this resource.</p>
15 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16 /// <p>The configuration information for the customer managed key used for encryption.</p>
17 /// <p>The customer managed key must have a policy that allows <code>kms:CreateGrant</code>, <code> kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect. To use Amazon Q in Connect with chat, the key policy must also allow <code>kms:Decrypt</code>, <code>kms:GenerateDataKey*</code>, and <code>kms:DescribeKey</code> permissions to the <code>connect.amazonaws.com</code> service principal.</p>
18 /// <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>
19 pub server_side_encryption_configuration: ::std::option::Option<crate::types::ServerSideEncryptionConfiguration>,
20}
21impl CreateAssistantInput {
22 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
23 pub fn client_token(&self) -> ::std::option::Option<&str> {
24 self.client_token.as_deref()
25 }
26 /// <p>The name of the assistant.</p>
27 pub fn name(&self) -> ::std::option::Option<&str> {
28 self.name.as_deref()
29 }
30 /// <p>The type of assistant.</p>
31 pub fn r#type(&self) -> ::std::option::Option<&crate::types::AssistantType> {
32 self.r#type.as_ref()
33 }
34 /// <p>The description of the assistant.</p>
35 pub fn description(&self) -> ::std::option::Option<&str> {
36 self.description.as_deref()
37 }
38 /// <p>The tags used to organize, track, or control access for this resource.</p>
39 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
40 self.tags.as_ref()
41 }
42 /// <p>The configuration information for the customer managed key used for encryption.</p>
43 /// <p>The customer managed key must have a policy that allows <code>kms:CreateGrant</code>, <code> kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect. To use Amazon Q in Connect with chat, the key policy must also allow <code>kms:Decrypt</code>, <code>kms:GenerateDataKey*</code>, and <code>kms:DescribeKey</code> permissions to the <code>connect.amazonaws.com</code> service principal.</p>
44 /// <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>
45 pub fn server_side_encryption_configuration(&self) -> ::std::option::Option<&crate::types::ServerSideEncryptionConfiguration> {
46 self.server_side_encryption_configuration.as_ref()
47 }
48}
49impl CreateAssistantInput {
50 /// Creates a new builder-style object to manufacture [`CreateAssistantInput`](crate::operation::create_assistant::CreateAssistantInput).
51 pub fn builder() -> crate::operation::create_assistant::builders::CreateAssistantInputBuilder {
52 crate::operation::create_assistant::builders::CreateAssistantInputBuilder::default()
53 }
54}
55
56/// A builder for [`CreateAssistantInput`](crate::operation::create_assistant::CreateAssistantInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct CreateAssistantInputBuilder {
60 pub(crate) client_token: ::std::option::Option<::std::string::String>,
61 pub(crate) name: ::std::option::Option<::std::string::String>,
62 pub(crate) r#type: ::std::option::Option<crate::types::AssistantType>,
63 pub(crate) description: ::std::option::Option<::std::string::String>,
64 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
65 pub(crate) server_side_encryption_configuration: ::std::option::Option<crate::types::ServerSideEncryptionConfiguration>,
66}
67impl CreateAssistantInputBuilder {
68 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
69 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.client_token = ::std::option::Option::Some(input.into());
71 self
72 }
73 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
74 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.client_token = input;
76 self
77 }
78 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
79 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
80 &self.client_token
81 }
82 /// <p>The name of the assistant.</p>
83 /// This field is required.
84 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85 self.name = ::std::option::Option::Some(input.into());
86 self
87 }
88 /// <p>The name of the assistant.</p>
89 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.name = input;
91 self
92 }
93 /// <p>The name of the assistant.</p>
94 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
95 &self.name
96 }
97 /// <p>The type of assistant.</p>
98 /// This field is required.
99 pub fn r#type(mut self, input: crate::types::AssistantType) -> Self {
100 self.r#type = ::std::option::Option::Some(input);
101 self
102 }
103 /// <p>The type of assistant.</p>
104 pub fn set_type(mut self, input: ::std::option::Option<crate::types::AssistantType>) -> Self {
105 self.r#type = input;
106 self
107 }
108 /// <p>The type of assistant.</p>
109 pub fn get_type(&self) -> &::std::option::Option<crate::types::AssistantType> {
110 &self.r#type
111 }
112 /// <p>The description of the assistant.</p>
113 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.description = ::std::option::Option::Some(input.into());
115 self
116 }
117 /// <p>The description of the assistant.</p>
118 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.description = input;
120 self
121 }
122 /// <p>The description of the assistant.</p>
123 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
124 &self.description
125 }
126 /// Adds a key-value pair to `tags`.
127 ///
128 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
129 ///
130 /// <p>The tags used to organize, track, or control access for this resource.</p>
131 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
132 let mut hash_map = self.tags.unwrap_or_default();
133 hash_map.insert(k.into(), v.into());
134 self.tags = ::std::option::Option::Some(hash_map);
135 self
136 }
137 /// <p>The tags used to organize, track, or control access for this resource.</p>
138 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
139 self.tags = input;
140 self
141 }
142 /// <p>The tags used to organize, track, or control access for this resource.</p>
143 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
144 &self.tags
145 }
146 /// <p>The configuration information for the customer managed key used for encryption.</p>
147 /// <p>The customer managed key must have a policy that allows <code>kms:CreateGrant</code>, <code> kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect. To use Amazon Q in Connect with chat, the key policy must also allow <code>kms:Decrypt</code>, <code>kms:GenerateDataKey*</code>, and <code>kms:DescribeKey</code> permissions to the <code>connect.amazonaws.com</code> service principal.</p>
148 /// <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>
149 pub fn server_side_encryption_configuration(mut self, input: crate::types::ServerSideEncryptionConfiguration) -> Self {
150 self.server_side_encryption_configuration = ::std::option::Option::Some(input);
151 self
152 }
153 /// <p>The configuration information for the customer managed key used for encryption.</p>
154 /// <p>The customer managed key must have a policy that allows <code>kms:CreateGrant</code>, <code> kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect. To use Amazon Q in Connect with chat, the key policy must also allow <code>kms:Decrypt</code>, <code>kms:GenerateDataKey*</code>, and <code>kms:DescribeKey</code> permissions to the <code>connect.amazonaws.com</code> service principal.</p>
155 /// <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>
156 pub fn set_server_side_encryption_configuration(mut self, input: ::std::option::Option<crate::types::ServerSideEncryptionConfiguration>) -> Self {
157 self.server_side_encryption_configuration = input;
158 self
159 }
160 /// <p>The configuration information for the customer managed key used for encryption.</p>
161 /// <p>The customer managed key must have a policy that allows <code>kms:CreateGrant</code>, <code> kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect. To use Amazon Q in Connect with chat, the key policy must also allow <code>kms:Decrypt</code>, <code>kms:GenerateDataKey*</code>, and <code>kms:DescribeKey</code> permissions to the <code>connect.amazonaws.com</code> service principal.</p>
162 /// <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>
163 pub fn get_server_side_encryption_configuration(&self) -> &::std::option::Option<crate::types::ServerSideEncryptionConfiguration> {
164 &self.server_side_encryption_configuration
165 }
166 /// Consumes the builder and constructs a [`CreateAssistantInput`](crate::operation::create_assistant::CreateAssistantInput).
167 pub fn build(
168 self,
169 ) -> ::std::result::Result<crate::operation::create_assistant::CreateAssistantInput, ::aws_smithy_types::error::operation::BuildError> {
170 ::std::result::Result::Ok(crate::operation::create_assistant::CreateAssistantInput {
171 client_token: self.client_token,
172 name: self.name,
173 r#type: self.r#type,
174 description: self.description,
175 tags: self.tags,
176 server_side_encryption_configuration: self.server_side_encryption_configuration,
177 })
178 }
179}