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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object containing the name of the Kubernetes service account inside the cluster to associate the IAM credentials with.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Subject {
/// <p>The name of the Kubernetes namespace inside the cluster to create the association in. The service account and the pods that use the service account must be in this namespace.</p>
pub namespace: ::std::string::String,
/// <p>The name of the Kubernetes service account inside the cluster to associate the IAM credentials with.</p>
pub service_account: ::std::string::String,
}
impl Subject {
/// <p>The name of the Kubernetes namespace inside the cluster to create the association in. The service account and the pods that use the service account must be in this namespace.</p>
pub fn namespace(&self) -> &str {
use std::ops::Deref;
self.namespace.deref()
}
/// <p>The name of the Kubernetes service account inside the cluster to associate the IAM credentials with.</p>
pub fn service_account(&self) -> &str {
use std::ops::Deref;
self.service_account.deref()
}
}
impl Subject {
/// Creates a new builder-style object to manufacture [`Subject`](crate::types::Subject).
pub fn builder() -> crate::types::builders::SubjectBuilder {
crate::types::builders::SubjectBuilder::default()
}
}
/// A builder for [`Subject`](crate::types::Subject).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubjectBuilder {
pub(crate) namespace: ::std::option::Option<::std::string::String>,
pub(crate) service_account: ::std::option::Option<::std::string::String>,
}
impl SubjectBuilder {
/// <p>The name of the Kubernetes namespace inside the cluster to create the association in. The service account and the pods that use the service account must be in this namespace.</p>
/// This field is required.
pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.namespace = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the Kubernetes namespace inside the cluster to create the association in. The service account and the pods that use the service account must be in this namespace.</p>
pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.namespace = input;
self
}
/// <p>The name of the Kubernetes namespace inside the cluster to create the association in. The service account and the pods that use the service account must be in this namespace.</p>
pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
&self.namespace
}
/// <p>The name of the Kubernetes service account inside the cluster to associate the IAM credentials with.</p>
/// This field is required.
pub fn service_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_account = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the Kubernetes service account inside the cluster to associate the IAM credentials with.</p>
pub fn set_service_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_account = input;
self
}
/// <p>The name of the Kubernetes service account inside the cluster to associate the IAM credentials with.</p>
pub fn get_service_account(&self) -> &::std::option::Option<::std::string::String> {
&self.service_account
}
/// Consumes the builder and constructs a [`Subject`](crate::types::Subject).
/// This method will fail if any of the following fields are not set:
/// - [`namespace`](crate::types::builders::SubjectBuilder::namespace)
/// - [`service_account`](crate::types::builders::SubjectBuilder::service_account)
pub fn build(self) -> ::std::result::Result<crate::types::Subject, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Subject {
namespace: self.namespace.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"namespace",
"namespace was not specified but it is required when building Subject",
)
})?,
service_account: self.service_account.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"service_account",
"service_account was not specified but it is required when building Subject",
)
})?,
})
}
}