aws_sdk_sagemaker/types/
_user_context.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UserContext {
7 pub user_profile_arn: ::std::option::Option<::std::string::String>,
9 pub user_profile_name: ::std::option::Option<::std::string::String>,
11 pub domain_id: ::std::option::Option<::std::string::String>,
13 pub iam_identity: ::std::option::Option<crate::types::IamIdentity>,
15}
16impl UserContext {
17 pub fn user_profile_arn(&self) -> ::std::option::Option<&str> {
19 self.user_profile_arn.as_deref()
20 }
21 pub fn user_profile_name(&self) -> ::std::option::Option<&str> {
23 self.user_profile_name.as_deref()
24 }
25 pub fn domain_id(&self) -> ::std::option::Option<&str> {
27 self.domain_id.as_deref()
28 }
29 pub fn iam_identity(&self) -> ::std::option::Option<&crate::types::IamIdentity> {
31 self.iam_identity.as_ref()
32 }
33}
34impl UserContext {
35 pub fn builder() -> crate::types::builders::UserContextBuilder {
37 crate::types::builders::UserContextBuilder::default()
38 }
39}
40
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct UserContextBuilder {
45 pub(crate) user_profile_arn: ::std::option::Option<::std::string::String>,
46 pub(crate) user_profile_name: ::std::option::Option<::std::string::String>,
47 pub(crate) domain_id: ::std::option::Option<::std::string::String>,
48 pub(crate) iam_identity: ::std::option::Option<crate::types::IamIdentity>,
49}
50impl UserContextBuilder {
51 pub fn user_profile_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.user_profile_arn = ::std::option::Option::Some(input.into());
54 self
55 }
56 pub fn set_user_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.user_profile_arn = input;
59 self
60 }
61 pub fn get_user_profile_arn(&self) -> &::std::option::Option<::std::string::String> {
63 &self.user_profile_arn
64 }
65 pub fn user_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.user_profile_name = ::std::option::Option::Some(input.into());
68 self
69 }
70 pub fn set_user_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.user_profile_name = input;
73 self
74 }
75 pub fn get_user_profile_name(&self) -> &::std::option::Option<::std::string::String> {
77 &self.user_profile_name
78 }
79 pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.domain_id = ::std::option::Option::Some(input.into());
82 self
83 }
84 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.domain_id = input;
87 self
88 }
89 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
91 &self.domain_id
92 }
93 pub fn iam_identity(mut self, input: crate::types::IamIdentity) -> Self {
95 self.iam_identity = ::std::option::Option::Some(input);
96 self
97 }
98 pub fn set_iam_identity(mut self, input: ::std::option::Option<crate::types::IamIdentity>) -> Self {
100 self.iam_identity = input;
101 self
102 }
103 pub fn get_iam_identity(&self) -> &::std::option::Option<crate::types::IamIdentity> {
105 &self.iam_identity
106 }
107 pub fn build(self) -> crate::types::UserContext {
109 crate::types::UserContext {
110 user_profile_arn: self.user_profile_arn,
111 user_profile_name: self.user_profile_name,
112 domain_id: self.domain_id,
113 iam_identity: self.iam_identity,
114 }
115 }
116}