Skip to main content

aws_sdk_rum/types/
_user_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A structure that contains information about the user session that this batch of events was collected from.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UserDetails {
7    /// <p>The ID of the user for this user session. This ID is generated by RUM and does not include any personally identifiable information about the user.</p>
8    pub user_id: ::std::option::Option<::std::string::String>,
9    /// <p>The session ID that the performance events are from.</p>
10    pub session_id: ::std::option::Option<::std::string::String>,
11}
12impl UserDetails {
13    /// <p>The ID of the user for this user session. This ID is generated by RUM and does not include any personally identifiable information about the user.</p>
14    pub fn user_id(&self) -> ::std::option::Option<&str> {
15        self.user_id.as_deref()
16    }
17    /// <p>The session ID that the performance events are from.</p>
18    pub fn session_id(&self) -> ::std::option::Option<&str> {
19        self.session_id.as_deref()
20    }
21}
22impl UserDetails {
23    /// Creates a new builder-style object to manufacture [`UserDetails`](crate::types::UserDetails).
24    pub fn builder() -> crate::types::builders::UserDetailsBuilder {
25        crate::types::builders::UserDetailsBuilder::default()
26    }
27}
28
29/// A builder for [`UserDetails`](crate::types::UserDetails).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct UserDetailsBuilder {
33    pub(crate) user_id: ::std::option::Option<::std::string::String>,
34    pub(crate) session_id: ::std::option::Option<::std::string::String>,
35}
36impl UserDetailsBuilder {
37    /// <p>The ID of the user for this user session. This ID is generated by RUM and does not include any personally identifiable information about the user.</p>
38    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.user_id = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The ID of the user for this user session. This ID is generated by RUM and does not include any personally identifiable information about the user.</p>
43    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.user_id = input;
45        self
46    }
47    /// <p>The ID of the user for this user session. This ID is generated by RUM and does not include any personally identifiable information about the user.</p>
48    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
49        &self.user_id
50    }
51    /// <p>The session ID that the performance events are from.</p>
52    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.session_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The session ID that the performance events are from.</p>
57    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.session_id = input;
59        self
60    }
61    /// <p>The session ID that the performance events are from.</p>
62    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.session_id
64    }
65    /// Consumes the builder and constructs a [`UserDetails`](crate::types::UserDetails).
66    pub fn build(self) -> crate::types::UserDetails {
67        crate::types::UserDetails {
68            user_id: self.user_id,
69            session_id: self.session_id,
70        }
71    }
72}