aws_sdk_wisdom/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="https://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 Wisdom 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}
17impl CreateSessionInput {
18    /// <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="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
19    pub fn client_token(&self) -> ::std::option::Option<&str> {
20        self.client_token.as_deref()
21    }
22    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
23    pub fn assistant_id(&self) -> ::std::option::Option<&str> {
24        self.assistant_id.as_deref()
25    }
26    /// <p>The name of the session.</p>
27    pub fn name(&self) -> ::std::option::Option<&str> {
28        self.name.as_deref()
29    }
30    /// <p>The description.</p>
31    pub fn description(&self) -> ::std::option::Option<&str> {
32        self.description.as_deref()
33    }
34    /// <p>The tags used to organize, track, or control access for this resource.</p>
35    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
36        self.tags.as_ref()
37    }
38}
39impl CreateSessionInput {
40    /// Creates a new builder-style object to manufacture [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
41    pub fn builder() -> crate::operation::create_session::builders::CreateSessionInputBuilder {
42        crate::operation::create_session::builders::CreateSessionInputBuilder::default()
43    }
44}
45
46/// A builder for [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateSessionInputBuilder {
50    pub(crate) client_token: ::std::option::Option<::std::string::String>,
51    pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
52    pub(crate) name: ::std::option::Option<::std::string::String>,
53    pub(crate) description: ::std::option::Option<::std::string::String>,
54    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
55}
56impl CreateSessionInputBuilder {
57    /// <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="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
58    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.client_token = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <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="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
63    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.client_token = input;
65        self
66    }
67    /// <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="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
68    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
69        &self.client_token
70    }
71    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
72    /// This field is required.
73    pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.assistant_id = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
78    pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.assistant_id = input;
80        self
81    }
82    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
83    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
84        &self.assistant_id
85    }
86    /// <p>The name of the session.</p>
87    /// This field is required.
88    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.name = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The name of the session.</p>
93    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.name = input;
95        self
96    }
97    /// <p>The name of the session.</p>
98    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
99        &self.name
100    }
101    /// <p>The description.</p>
102    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.description = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The description.</p>
107    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.description = input;
109        self
110    }
111    /// <p>The description.</p>
112    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
113        &self.description
114    }
115    /// Adds a key-value pair to `tags`.
116    ///
117    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
118    ///
119    /// <p>The tags used to organize, track, or control access for this resource.</p>
120    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
121        let mut hash_map = self.tags.unwrap_or_default();
122        hash_map.insert(k.into(), v.into());
123        self.tags = ::std::option::Option::Some(hash_map);
124        self
125    }
126    /// <p>The tags used to organize, track, or control access for this resource.</p>
127    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
128        self.tags = input;
129        self
130    }
131    /// <p>The tags used to organize, track, or control access for this resource.</p>
132    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
133        &self.tags
134    }
135    /// Consumes the builder and constructs a [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
136    pub fn build(
137        self,
138    ) -> ::std::result::Result<crate::operation::create_session::CreateSessionInput, ::aws_smithy_types::error::operation::BuildError> {
139        ::std::result::Result::Ok(crate::operation::create_session::CreateSessionInput {
140            client_token: self.client_token,
141            assistant_id: self.assistant_id,
142            name: self.name,
143            description: self.description,
144            tags: self.tags,
145        })
146    }
147}