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