Skip to main content

aws_sdk_ssoadmin/types/
_application_assignment_for_principal.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A structure that describes an application to which a principal is assigned.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ApplicationAssignmentForPrincipal {
7    /// <p>The ARN of the application to which the specified principal is assigned.</p>
8    pub application_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The unique identifier of the principal assigned to the application.</p>
10    pub principal_id: ::std::option::Option<::std::string::String>,
11    /// <p>The type of the principal assigned to the application.</p>
12    pub principal_type: ::std::option::Option<crate::types::PrincipalType>,
13}
14impl ApplicationAssignmentForPrincipal {
15    /// <p>The ARN of the application to which the specified principal is assigned.</p>
16    pub fn application_arn(&self) -> ::std::option::Option<&str> {
17        self.application_arn.as_deref()
18    }
19    /// <p>The unique identifier of the principal assigned to the application.</p>
20    pub fn principal_id(&self) -> ::std::option::Option<&str> {
21        self.principal_id.as_deref()
22    }
23    /// <p>The type of the principal assigned to the application.</p>
24    pub fn principal_type(&self) -> ::std::option::Option<&crate::types::PrincipalType> {
25        self.principal_type.as_ref()
26    }
27}
28impl ApplicationAssignmentForPrincipal {
29    /// Creates a new builder-style object to manufacture [`ApplicationAssignmentForPrincipal`](crate::types::ApplicationAssignmentForPrincipal).
30    pub fn builder() -> crate::types::builders::ApplicationAssignmentForPrincipalBuilder {
31        crate::types::builders::ApplicationAssignmentForPrincipalBuilder::default()
32    }
33}
34
35/// A builder for [`ApplicationAssignmentForPrincipal`](crate::types::ApplicationAssignmentForPrincipal).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct ApplicationAssignmentForPrincipalBuilder {
39    pub(crate) application_arn: ::std::option::Option<::std::string::String>,
40    pub(crate) principal_id: ::std::option::Option<::std::string::String>,
41    pub(crate) principal_type: ::std::option::Option<crate::types::PrincipalType>,
42}
43impl ApplicationAssignmentForPrincipalBuilder {
44    /// <p>The ARN of the application to which the specified principal is assigned.</p>
45    pub fn application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.application_arn = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The ARN of the application to which the specified principal is assigned.</p>
50    pub fn set_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.application_arn = input;
52        self
53    }
54    /// <p>The ARN of the application to which the specified principal is assigned.</p>
55    pub fn get_application_arn(&self) -> &::std::option::Option<::std::string::String> {
56        &self.application_arn
57    }
58    /// <p>The unique identifier of the principal assigned to the application.</p>
59    pub fn principal_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.principal_id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The unique identifier of the principal assigned to the application.</p>
64    pub fn set_principal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.principal_id = input;
66        self
67    }
68    /// <p>The unique identifier of the principal assigned to the application.</p>
69    pub fn get_principal_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.principal_id
71    }
72    /// <p>The type of the principal assigned to the application.</p>
73    pub fn principal_type(mut self, input: crate::types::PrincipalType) -> Self {
74        self.principal_type = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>The type of the principal assigned to the application.</p>
78    pub fn set_principal_type(mut self, input: ::std::option::Option<crate::types::PrincipalType>) -> Self {
79        self.principal_type = input;
80        self
81    }
82    /// <p>The type of the principal assigned to the application.</p>
83    pub fn get_principal_type(&self) -> &::std::option::Option<crate::types::PrincipalType> {
84        &self.principal_type
85    }
86    /// Consumes the builder and constructs a [`ApplicationAssignmentForPrincipal`](crate::types::ApplicationAssignmentForPrincipal).
87    pub fn build(self) -> crate::types::ApplicationAssignmentForPrincipal {
88        crate::types::ApplicationAssignmentForPrincipal {
89            application_arn: self.application_arn,
90            principal_id: self.principal_id,
91            principal_type: self.principal_type,
92        }
93    }
94}