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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateSessionInput {
/// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
pub session_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
pub session_identifier: ::std::option::Option<::std::string::String>,
}
impl UpdateSessionInput {
/// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
pub fn session_metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.session_metadata.as_ref()
}
/// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
pub fn session_identifier(&self) -> ::std::option::Option<&str> {
self.session_identifier.as_deref()
}
}
impl UpdateSessionInput {
/// Creates a new builder-style object to manufacture [`UpdateSessionInput`](crate::operation::update_session::UpdateSessionInput).
pub fn builder() -> crate::operation::update_session::builders::UpdateSessionInputBuilder {
crate::operation::update_session::builders::UpdateSessionInputBuilder::default()
}
}
/// A builder for [`UpdateSessionInput`](crate::operation::update_session::UpdateSessionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSessionInputBuilder {
pub(crate) session_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) session_identifier: ::std::option::Option<::std::string::String>,
}
impl UpdateSessionInputBuilder {
/// Adds a key-value pair to `session_metadata`.
///
/// To override the contents of this collection use [`set_session_metadata`](Self::set_session_metadata).
///
/// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
pub fn session_metadata(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.session_metadata.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.session_metadata = ::std::option::Option::Some(hash_map);
self
}
/// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
pub fn set_session_metadata(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.session_metadata = input;
self
}
/// <p>A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.</p>
pub fn get_session_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.session_metadata
}
/// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
/// This field is required.
pub fn session_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_identifier = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
pub fn set_session_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_identifier = input;
self
}
/// <p>The unique identifier of the session to modify. You can specify either the session's <code>sessionId</code> or its Amazon Resource Name (ARN).</p>
pub fn get_session_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.session_identifier
}
/// Consumes the builder and constructs a [`UpdateSessionInput`](crate::operation::update_session::UpdateSessionInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::update_session::UpdateSessionInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::update_session::UpdateSessionInput {
session_metadata: self.session_metadata,
session_identifier: self.session_identifier,
})
}
}