Skip to main content

aws_sdk_sagemaker/types/
_user_context.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about the user who created or modified a SageMaker resource.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UserContext {
7    /// <p>The Amazon Resource Name (ARN) of the user's profile.</p>
8    pub user_profile_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the user's profile.</p>
10    pub user_profile_name: ::std::option::Option<::std::string::String>,
11    /// <p>The domain associated with the user.</p>
12    pub domain_id: ::std::option::Option<::std::string::String>,
13    /// <p>The IAM Identity details associated with the user. These details are associated with model package groups, model packages, and project entities only.</p>
14    pub iam_identity: ::std::option::Option<crate::types::IamIdentity>,
15}
16impl UserContext {
17    /// <p>The Amazon Resource Name (ARN) of the user's profile.</p>
18    pub fn user_profile_arn(&self) -> ::std::option::Option<&str> {
19        self.user_profile_arn.as_deref()
20    }
21    /// <p>The name of the user's profile.</p>
22    pub fn user_profile_name(&self) -> ::std::option::Option<&str> {
23        self.user_profile_name.as_deref()
24    }
25    /// <p>The domain associated with the user.</p>
26    pub fn domain_id(&self) -> ::std::option::Option<&str> {
27        self.domain_id.as_deref()
28    }
29    /// <p>The IAM Identity details associated with the user. These details are associated with model package groups, model packages, and project entities only.</p>
30    pub fn iam_identity(&self) -> ::std::option::Option<&crate::types::IamIdentity> {
31        self.iam_identity.as_ref()
32    }
33}
34impl UserContext {
35    /// Creates a new builder-style object to manufacture [`UserContext`](crate::types::UserContext).
36    pub fn builder() -> crate::types::builders::UserContextBuilder {
37        crate::types::builders::UserContextBuilder::default()
38    }
39}
40
41/// A builder for [`UserContext`](crate::types::UserContext).
42#[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    /// <p>The Amazon Resource Name (ARN) of the user's profile.</p>
52    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    /// <p>The Amazon Resource Name (ARN) of the user's profile.</p>
57    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    /// <p>The Amazon Resource Name (ARN) of the user's profile.</p>
62    pub fn get_user_profile_arn(&self) -> &::std::option::Option<::std::string::String> {
63        &self.user_profile_arn
64    }
65    /// <p>The name of the user's profile.</p>
66    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    /// <p>The name of the user's profile.</p>
71    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    /// <p>The name of the user's profile.</p>
76    pub fn get_user_profile_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.user_profile_name
78    }
79    /// <p>The domain associated with the user.</p>
80    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    /// <p>The domain associated with the user.</p>
85    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.domain_id = input;
87        self
88    }
89    /// <p>The domain associated with the user.</p>
90    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.domain_id
92    }
93    /// <p>The IAM Identity details associated with the user. These details are associated with model package groups, model packages, and project entities only.</p>
94    pub fn iam_identity(mut self, input: crate::types::IamIdentity) -> Self {
95        self.iam_identity = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>The IAM Identity details associated with the user. These details are associated with model package groups, model packages, and project entities only.</p>
99    pub fn set_iam_identity(mut self, input: ::std::option::Option<crate::types::IamIdentity>) -> Self {
100        self.iam_identity = input;
101        self
102    }
103    /// <p>The IAM Identity details associated with the user. These details are associated with model package groups, model packages, and project entities only.</p>
104    pub fn get_iam_identity(&self) -> &::std::option::Option<crate::types::IamIdentity> {
105        &self.iam_identity
106    }
107    /// Consumes the builder and constructs a [`UserContext`](crate::types::UserContext).
108    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}