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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// 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 AssociateAccessPolicyInput {
/// <p>The name of your cluster.</p>
pub cluster_name: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the IAM user or role for the <code>AccessEntry</code> that you're associating the access policy to.</p>
pub principal_arn: ::std::option::Option<::std::string::String>,
/// <p>The ARN of the <code>AccessPolicy</code> that you're associating. For a list of ARNs, use <code>ListAccessPolicies</code>.</p>
pub policy_arn: ::std::option::Option<::std::string::String>,
/// <p>The scope for the <code>AccessPolicy</code>. You can scope access policies to an entire cluster or to specific Kubernetes namespaces.</p>
pub access_scope: ::std::option::Option<crate::types::AccessScope>,
}
impl AssociateAccessPolicyInput {
/// <p>The name of your cluster.</p>
pub fn cluster_name(&self) -> ::std::option::Option<&str> {
self.cluster_name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the IAM user or role for the <code>AccessEntry</code> that you're associating the access policy to.</p>
pub fn principal_arn(&self) -> ::std::option::Option<&str> {
self.principal_arn.as_deref()
}
/// <p>The ARN of the <code>AccessPolicy</code> that you're associating. For a list of ARNs, use <code>ListAccessPolicies</code>.</p>
pub fn policy_arn(&self) -> ::std::option::Option<&str> {
self.policy_arn.as_deref()
}
/// <p>The scope for the <code>AccessPolicy</code>. You can scope access policies to an entire cluster or to specific Kubernetes namespaces.</p>
pub fn access_scope(&self) -> ::std::option::Option<&crate::types::AccessScope> {
self.access_scope.as_ref()
}
}
impl AssociateAccessPolicyInput {
/// Creates a new builder-style object to manufacture [`AssociateAccessPolicyInput`](crate::operation::associate_access_policy::AssociateAccessPolicyInput).
pub fn builder() -> crate::operation::associate_access_policy::builders::AssociateAccessPolicyInputBuilder {
crate::operation::associate_access_policy::builders::AssociateAccessPolicyInputBuilder::default()
}
}
/// A builder for [`AssociateAccessPolicyInput`](crate::operation::associate_access_policy::AssociateAccessPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AssociateAccessPolicyInputBuilder {
pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
pub(crate) principal_arn: ::std::option::Option<::std::string::String>,
pub(crate) policy_arn: ::std::option::Option<::std::string::String>,
pub(crate) access_scope: ::std::option::Option<crate::types::AccessScope>,
}
impl AssociateAccessPolicyInputBuilder {
/// <p>The name of your cluster.</p>
/// This field is required.
pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cluster_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of your cluster.</p>
pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cluster_name = input;
self
}
/// <p>The name of your cluster.</p>
pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
&self.cluster_name
}
/// <p>The Amazon Resource Name (ARN) of the IAM user or role for the <code>AccessEntry</code> that you're associating the access policy to.</p>
/// This field is required.
pub fn principal_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.principal_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM user or role for the <code>AccessEntry</code> that you're associating the access policy to.</p>
pub fn set_principal_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.principal_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM user or role for the <code>AccessEntry</code> that you're associating the access policy to.</p>
pub fn get_principal_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.principal_arn
}
/// <p>The ARN of the <code>AccessPolicy</code> that you're associating. For a list of ARNs, use <code>ListAccessPolicies</code>.</p>
/// This field is required.
pub fn policy_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the <code>AccessPolicy</code> that you're associating. For a list of ARNs, use <code>ListAccessPolicies</code>.</p>
pub fn set_policy_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_arn = input;
self
}
/// <p>The ARN of the <code>AccessPolicy</code> that you're associating. For a list of ARNs, use <code>ListAccessPolicies</code>.</p>
pub fn get_policy_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_arn
}
/// <p>The scope for the <code>AccessPolicy</code>. You can scope access policies to an entire cluster or to specific Kubernetes namespaces.</p>
/// This field is required.
pub fn access_scope(mut self, input: crate::types::AccessScope) -> Self {
self.access_scope = ::std::option::Option::Some(input);
self
}
/// <p>The scope for the <code>AccessPolicy</code>. You can scope access policies to an entire cluster or to specific Kubernetes namespaces.</p>
pub fn set_access_scope(mut self, input: ::std::option::Option<crate::types::AccessScope>) -> Self {
self.access_scope = input;
self
}
/// <p>The scope for the <code>AccessPolicy</code>. You can scope access policies to an entire cluster or to specific Kubernetes namespaces.</p>
pub fn get_access_scope(&self) -> &::std::option::Option<crate::types::AccessScope> {
&self.access_scope
}
/// Consumes the builder and constructs a [`AssociateAccessPolicyInput`](crate::operation::associate_access_policy::AssociateAccessPolicyInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::associate_access_policy::AssociateAccessPolicyInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::associate_access_policy::AssociateAccessPolicyInput {
cluster_name: self.cluster_name,
principal_arn: self.principal_arn,
policy_arn: self.policy_arn,
access_scope: self.access_scope,
})
}
}