aws_sdk_qconnect/operation/create_session/
_create_session_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 CreateSessionInput {
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 identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
9    pub assistant_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the session.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The description.</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>An object that can be used to specify Tag conditions.</p>
17    pub tag_filter: ::std::option::Option<crate::types::TagFilter>,
18    /// <p>The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.</p>
19    pub ai_agent_configuration: ::std::option::Option<::std::collections::HashMap<crate::types::AiAgentType, crate::types::AiAgentConfigurationData>>,
20    /// <p>The Amazon Resource Name (ARN) of the email contact in Amazon Connect. Used to retrieve email content and establish session context for AI-powered email assistance.</p>
21    pub contact_arn: ::std::option::Option<::std::string::String>,
22}
23impl CreateSessionInput {
24    /// <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>
25    pub fn client_token(&self) -> ::std::option::Option<&str> {
26        self.client_token.as_deref()
27    }
28    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
29    pub fn assistant_id(&self) -> ::std::option::Option<&str> {
30        self.assistant_id.as_deref()
31    }
32    /// <p>The name of the session.</p>
33    pub fn name(&self) -> ::std::option::Option<&str> {
34        self.name.as_deref()
35    }
36    /// <p>The description.</p>
37    pub fn description(&self) -> ::std::option::Option<&str> {
38        self.description.as_deref()
39    }
40    /// <p>The tags used to organize, track, or control access for this resource.</p>
41    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
42        self.tags.as_ref()
43    }
44    /// <p>An object that can be used to specify Tag conditions.</p>
45    pub fn tag_filter(&self) -> ::std::option::Option<&crate::types::TagFilter> {
46        self.tag_filter.as_ref()
47    }
48    /// <p>The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.</p>
49    pub fn ai_agent_configuration(
50        &self,
51    ) -> ::std::option::Option<&::std::collections::HashMap<crate::types::AiAgentType, crate::types::AiAgentConfigurationData>> {
52        self.ai_agent_configuration.as_ref()
53    }
54    /// <p>The Amazon Resource Name (ARN) of the email contact in Amazon Connect. Used to retrieve email content and establish session context for AI-powered email assistance.</p>
55    pub fn contact_arn(&self) -> ::std::option::Option<&str> {
56        self.contact_arn.as_deref()
57    }
58}
59impl CreateSessionInput {
60    /// Creates a new builder-style object to manufacture [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
61    pub fn builder() -> crate::operation::create_session::builders::CreateSessionInputBuilder {
62        crate::operation::create_session::builders::CreateSessionInputBuilder::default()
63    }
64}
65
66/// A builder for [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct CreateSessionInputBuilder {
70    pub(crate) client_token: ::std::option::Option<::std::string::String>,
71    pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
72    pub(crate) name: ::std::option::Option<::std::string::String>,
73    pub(crate) description: ::std::option::Option<::std::string::String>,
74    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
75    pub(crate) tag_filter: ::std::option::Option<crate::types::TagFilter>,
76    pub(crate) ai_agent_configuration:
77        ::std::option::Option<::std::collections::HashMap<crate::types::AiAgentType, crate::types::AiAgentConfigurationData>>,
78    pub(crate) contact_arn: ::std::option::Option<::std::string::String>,
79}
80impl CreateSessionInputBuilder {
81    /// <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>
82    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.client_token = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <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>
87    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.client_token = input;
89        self
90    }
91    /// <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>
92    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
93        &self.client_token
94    }
95    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
96    /// This field is required.
97    pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.assistant_id = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
102    pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.assistant_id = input;
104        self
105    }
106    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
107    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
108        &self.assistant_id
109    }
110    /// <p>The name of the session.</p>
111    /// This field is required.
112    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.name = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The name of the session.</p>
117    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.name = input;
119        self
120    }
121    /// <p>The name of the session.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        &self.name
124    }
125    /// <p>The description.</p>
126    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.description = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <p>The description.</p>
131    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.description = input;
133        self
134    }
135    /// <p>The description.</p>
136    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137        &self.description
138    }
139    /// Adds a key-value pair to `tags`.
140    ///
141    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
142    ///
143    /// <p>The tags used to organize, track, or control access for this resource.</p>
144    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
145        let mut hash_map = self.tags.unwrap_or_default();
146        hash_map.insert(k.into(), v.into());
147        self.tags = ::std::option::Option::Some(hash_map);
148        self
149    }
150    /// <p>The tags used to organize, track, or control access for this resource.</p>
151    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
152        self.tags = input;
153        self
154    }
155    /// <p>The tags used to organize, track, or control access for this resource.</p>
156    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
157        &self.tags
158    }
159    /// <p>An object that can be used to specify Tag conditions.</p>
160    pub fn tag_filter(mut self, input: crate::types::TagFilter) -> Self {
161        self.tag_filter = ::std::option::Option::Some(input);
162        self
163    }
164    /// <p>An object that can be used to specify Tag conditions.</p>
165    pub fn set_tag_filter(mut self, input: ::std::option::Option<crate::types::TagFilter>) -> Self {
166        self.tag_filter = input;
167        self
168    }
169    /// <p>An object that can be used to specify Tag conditions.</p>
170    pub fn get_tag_filter(&self) -> &::std::option::Option<crate::types::TagFilter> {
171        &self.tag_filter
172    }
173    /// Adds a key-value pair to `ai_agent_configuration`.
174    ///
175    /// To override the contents of this collection use [`set_ai_agent_configuration`](Self::set_ai_agent_configuration).
176    ///
177    /// <p>The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.</p>
178    pub fn ai_agent_configuration(mut self, k: crate::types::AiAgentType, v: crate::types::AiAgentConfigurationData) -> Self {
179        let mut hash_map = self.ai_agent_configuration.unwrap_or_default();
180        hash_map.insert(k, v);
181        self.ai_agent_configuration = ::std::option::Option::Some(hash_map);
182        self
183    }
184    /// <p>The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.</p>
185    pub fn set_ai_agent_configuration(
186        mut self,
187        input: ::std::option::Option<::std::collections::HashMap<crate::types::AiAgentType, crate::types::AiAgentConfigurationData>>,
188    ) -> Self {
189        self.ai_agent_configuration = input;
190        self
191    }
192    /// <p>The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.</p>
193    pub fn get_ai_agent_configuration(
194        &self,
195    ) -> &::std::option::Option<::std::collections::HashMap<crate::types::AiAgentType, crate::types::AiAgentConfigurationData>> {
196        &self.ai_agent_configuration
197    }
198    /// <p>The Amazon Resource Name (ARN) of the email contact in Amazon Connect. Used to retrieve email content and establish session context for AI-powered email assistance.</p>
199    pub fn contact_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.contact_arn = ::std::option::Option::Some(input.into());
201        self
202    }
203    /// <p>The Amazon Resource Name (ARN) of the email contact in Amazon Connect. Used to retrieve email content and establish session context for AI-powered email assistance.</p>
204    pub fn set_contact_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.contact_arn = input;
206        self
207    }
208    /// <p>The Amazon Resource Name (ARN) of the email contact in Amazon Connect. Used to retrieve email content and establish session context for AI-powered email assistance.</p>
209    pub fn get_contact_arn(&self) -> &::std::option::Option<::std::string::String> {
210        &self.contact_arn
211    }
212    /// Consumes the builder and constructs a [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
213    pub fn build(
214        self,
215    ) -> ::std::result::Result<crate::operation::create_session::CreateSessionInput, ::aws_smithy_types::error::operation::BuildError> {
216        ::std::result::Result::Ok(crate::operation::create_session::CreateSessionInput {
217            client_token: self.client_token,
218            assistant_id: self.assistant_id,
219            name: self.name,
220            description: self.description,
221            tags: self.tags,
222            tag_filter: self.tag_filter,
223            ai_agent_configuration: self.ai_agent_configuration,
224            contact_arn: self.contact_arn,
225        })
226    }
227}