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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains information about actions and resources that define permissions to check against a policy.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Access {
/// <p>A list of actions for the access permissions. Any strings that can be used as an action in an IAM policy can be used in the list of actions to check.</p>
pub actions: ::std::vec::Vec<::std::string::String>,
/// <p>A list of resources for the access permissions. Any strings that can be used as an Amazon Resource Name (ARN) in an IAM policy can be used in the list of resources to check. You can only use a wildcard in the portion of the ARN that specifies the resource ID.</p>
pub resources: ::std::vec::Vec<::std::string::String>,
}
impl Access {
/// <p>A list of actions for the access permissions. Any strings that can be used as an action in an IAM policy can be used in the list of actions to check.</p>
pub fn actions(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.actions.deref()
}
/// <p>A list of resources for the access permissions. Any strings that can be used as an Amazon Resource Name (ARN) in an IAM policy can be used in the list of resources to check. You can only use a wildcard in the portion of the ARN that specifies the resource ID.</p>
pub fn resources(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.resources.deref()
}
}
impl Access {
/// Creates a new builder-style object to manufacture [`Access`](crate::types::Access).
pub fn builder() -> crate::types::builders::AccessBuilder {
crate::types::builders::AccessBuilder::default()
}
}
/// A builder for [`Access`](crate::types::Access).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AccessBuilder {
pub(crate) actions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) resources: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl AccessBuilder {
/// Appends an item to `actions`.
///
/// To override the contents of this collection use [`set_actions`](Self::set_actions).
///
/// <p>A list of actions for the access permissions. Any strings that can be used as an action in an IAM policy can be used in the list of actions to check.</p>
pub fn actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.actions.unwrap_or_default();
v.push(input.into());
self.actions = ::std::option::Option::Some(v);
self
}
/// <p>A list of actions for the access permissions. Any strings that can be used as an action in an IAM policy can be used in the list of actions to check.</p>
pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.actions = input;
self
}
/// <p>A list of actions for the access permissions. Any strings that can be used as an action in an IAM policy can be used in the list of actions to check.</p>
pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.actions
}
/// Appends an item to `resources`.
///
/// To override the contents of this collection use [`set_resources`](Self::set_resources).
///
/// <p>A list of resources for the access permissions. Any strings that can be used as an Amazon Resource Name (ARN) in an IAM policy can be used in the list of resources to check. You can only use a wildcard in the portion of the ARN that specifies the resource ID.</p>
pub fn resources(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.resources.unwrap_or_default();
v.push(input.into());
self.resources = ::std::option::Option::Some(v);
self
}
/// <p>A list of resources for the access permissions. Any strings that can be used as an Amazon Resource Name (ARN) in an IAM policy can be used in the list of resources to check. You can only use a wildcard in the portion of the ARN that specifies the resource ID.</p>
pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.resources = input;
self
}
/// <p>A list of resources for the access permissions. Any strings that can be used as an Amazon Resource Name (ARN) in an IAM policy can be used in the list of resources to check. You can only use a wildcard in the portion of the ARN that specifies the resource ID.</p>
pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.resources
}
/// Consumes the builder and constructs a [`Access`](crate::types::Access).
pub fn build(self) -> crate::types::Access {
crate::types::Access {
actions: self.actions.unwrap_or_default(),
resources: self.resources.unwrap_or_default(),
}
}
}