aws_sdk_codeguruprofiler/operation/put_permission/_put_permission_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The structure representing the <code>putPermissionRequest</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PutPermissionInput {
7 /// <p>The name of the profiling group to grant access to.</p>
8 pub profiling_group_name: ::std::option::Option<::std::string::String>,
9 /// <p>Specifies an action group that contains permissions to add to a profiling group resource. One action group is supported, <code>agentPermissions</code>, which grants permission to perform actions required by the profiling agent, <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions.</p>
10 pub action_group: ::std::option::Option<crate::types::ActionGroup>,
11 /// <p>A list ARNs for the roles and users you want to grant access to the profiling group. Wildcards are not are supported in the ARNs.</p>
12 pub principals: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13 /// <p>A universally unique identifier (UUID) for the revision of the policy you are adding to the profiling group. Do not specify this when you add permissions to a profiling group for the first time. If a policy already exists on the profiling group, you must specify the <code>revisionId</code>.</p>
14 pub revision_id: ::std::option::Option<::std::string::String>,
15}
16impl PutPermissionInput {
17 /// <p>The name of the profiling group to grant access to.</p>
18 pub fn profiling_group_name(&self) -> ::std::option::Option<&str> {
19 self.profiling_group_name.as_deref()
20 }
21 /// <p>Specifies an action group that contains permissions to add to a profiling group resource. One action group is supported, <code>agentPermissions</code>, which grants permission to perform actions required by the profiling agent, <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions.</p>
22 pub fn action_group(&self) -> ::std::option::Option<&crate::types::ActionGroup> {
23 self.action_group.as_ref()
24 }
25 /// <p>A list ARNs for the roles and users you want to grant access to the profiling group. Wildcards are not are supported in the ARNs.</p>
26 ///
27 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.principals.is_none()`.
28 pub fn principals(&self) -> &[::std::string::String] {
29 self.principals.as_deref().unwrap_or_default()
30 }
31 /// <p>A universally unique identifier (UUID) for the revision of the policy you are adding to the profiling group. Do not specify this when you add permissions to a profiling group for the first time. If a policy already exists on the profiling group, you must specify the <code>revisionId</code>.</p>
32 pub fn revision_id(&self) -> ::std::option::Option<&str> {
33 self.revision_id.as_deref()
34 }
35}
36impl PutPermissionInput {
37 /// Creates a new builder-style object to manufacture [`PutPermissionInput`](crate::operation::put_permission::PutPermissionInput).
38 pub fn builder() -> crate::operation::put_permission::builders::PutPermissionInputBuilder {
39 crate::operation::put_permission::builders::PutPermissionInputBuilder::default()
40 }
41}
42
43/// A builder for [`PutPermissionInput`](crate::operation::put_permission::PutPermissionInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct PutPermissionInputBuilder {
47 pub(crate) profiling_group_name: ::std::option::Option<::std::string::String>,
48 pub(crate) action_group: ::std::option::Option<crate::types::ActionGroup>,
49 pub(crate) principals: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
50 pub(crate) revision_id: ::std::option::Option<::std::string::String>,
51}
52impl PutPermissionInputBuilder {
53 /// <p>The name of the profiling group to grant access to.</p>
54 /// This field is required.
55 pub fn profiling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56 self.profiling_group_name = ::std::option::Option::Some(input.into());
57 self
58 }
59 /// <p>The name of the profiling group to grant access to.</p>
60 pub fn set_profiling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61 self.profiling_group_name = input;
62 self
63 }
64 /// <p>The name of the profiling group to grant access to.</p>
65 pub fn get_profiling_group_name(&self) -> &::std::option::Option<::std::string::String> {
66 &self.profiling_group_name
67 }
68 /// <p>Specifies an action group that contains permissions to add to a profiling group resource. One action group is supported, <code>agentPermissions</code>, which grants permission to perform actions required by the profiling agent, <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions.</p>
69 /// This field is required.
70 pub fn action_group(mut self, input: crate::types::ActionGroup) -> Self {
71 self.action_group = ::std::option::Option::Some(input);
72 self
73 }
74 /// <p>Specifies an action group that contains permissions to add to a profiling group resource. One action group is supported, <code>agentPermissions</code>, which grants permission to perform actions required by the profiling agent, <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions.</p>
75 pub fn set_action_group(mut self, input: ::std::option::Option<crate::types::ActionGroup>) -> Self {
76 self.action_group = input;
77 self
78 }
79 /// <p>Specifies an action group that contains permissions to add to a profiling group resource. One action group is supported, <code>agentPermissions</code>, which grants permission to perform actions required by the profiling agent, <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions.</p>
80 pub fn get_action_group(&self) -> &::std::option::Option<crate::types::ActionGroup> {
81 &self.action_group
82 }
83 /// Appends an item to `principals`.
84 ///
85 /// To override the contents of this collection use [`set_principals`](Self::set_principals).
86 ///
87 /// <p>A list ARNs for the roles and users you want to grant access to the profiling group. Wildcards are not are supported in the ARNs.</p>
88 pub fn principals(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 let mut v = self.principals.unwrap_or_default();
90 v.push(input.into());
91 self.principals = ::std::option::Option::Some(v);
92 self
93 }
94 /// <p>A list ARNs for the roles and users you want to grant access to the profiling group. Wildcards are not are supported in the ARNs.</p>
95 pub fn set_principals(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
96 self.principals = input;
97 self
98 }
99 /// <p>A list ARNs for the roles and users you want to grant access to the profiling group. Wildcards are not are supported in the ARNs.</p>
100 pub fn get_principals(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
101 &self.principals
102 }
103 /// <p>A universally unique identifier (UUID) for the revision of the policy you are adding to the profiling group. Do not specify this when you add permissions to a profiling group for the first time. If a policy already exists on the profiling group, you must specify the <code>revisionId</code>.</p>
104 pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105 self.revision_id = ::std::option::Option::Some(input.into());
106 self
107 }
108 /// <p>A universally unique identifier (UUID) for the revision of the policy you are adding to the profiling group. Do not specify this when you add permissions to a profiling group for the first time. If a policy already exists on the profiling group, you must specify the <code>revisionId</code>.</p>
109 pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.revision_id = input;
111 self
112 }
113 /// <p>A universally unique identifier (UUID) for the revision of the policy you are adding to the profiling group. Do not specify this when you add permissions to a profiling group for the first time. If a policy already exists on the profiling group, you must specify the <code>revisionId</code>.</p>
114 pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
115 &self.revision_id
116 }
117 /// Consumes the builder and constructs a [`PutPermissionInput`](crate::operation::put_permission::PutPermissionInput).
118 pub fn build(
119 self,
120 ) -> ::std::result::Result<crate::operation::put_permission::PutPermissionInput, ::aws_smithy_types::error::operation::BuildError> {
121 ::std::result::Result::Ok(crate::operation::put_permission::PutPermissionInput {
122 profiling_group_name: self.profiling_group_name,
123 action_group: self.action_group,
124 principals: self.principals,
125 revision_id: self.revision_id,
126 })
127 }
128}