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 123 124
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The structure representing the <code>putPermissionRequest</code>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutPermissionInput {
/// <p>The name of the profiling group to grant access to.</p>
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
/// <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>
#[doc(hidden)]
pub action_group: std::option::Option<crate::types::ActionGroup>,
/// <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>
#[doc(hidden)]
pub principals: std::option::Option<std::vec::Vec<std::string::String>>,
/// <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>
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl PutPermissionInput {
/// <p>The name of the profiling group to grant access to.</p>
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
/// <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>
pub fn action_group(&self) -> std::option::Option<&crate::types::ActionGroup> {
self.action_group.as_ref()
}
/// <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>
pub fn principals(&self) -> std::option::Option<&[std::string::String]> {
self.principals.as_deref()
}
/// <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>
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
impl PutPermissionInput {
/// Creates a new builder-style object to manufacture [`PutPermissionInput`](crate::operation::put_permission::PutPermissionInput).
pub fn builder() -> crate::operation::put_permission::builders::PutPermissionInputBuilder {
crate::operation::put_permission::builders::PutPermissionInputBuilder::default()
}
}
/// A builder for [`PutPermissionInput`](crate::operation::put_permission::PutPermissionInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct PutPermissionInputBuilder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) action_group: std::option::Option<crate::types::ActionGroup>,
pub(crate) principals: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl PutPermissionInputBuilder {
/// <p>The name of the profiling group to grant access to.</p>
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
/// <p>The name of the profiling group to grant access to.</p>
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
/// <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>
pub fn action_group(mut self, input: crate::types::ActionGroup) -> Self {
self.action_group = Some(input);
self
}
/// <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>
pub fn set_action_group(
mut self,
input: std::option::Option<crate::types::ActionGroup>,
) -> Self {
self.action_group = input;
self
}
/// Appends an item to `principals`.
///
/// To override the contents of this collection use [`set_principals`](Self::set_principals).
///
/// <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>
pub fn principals(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.principals.unwrap_or_default();
v.push(input.into());
self.principals = Some(v);
self
}
/// <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>
pub fn set_principals(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.principals = input;
self
}
/// <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>
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
/// <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>
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
/// Consumes the builder and constructs a [`PutPermissionInput`](crate::operation::put_permission::PutPermissionInput).
pub fn build(
self,
) -> Result<
crate::operation::put_permission::PutPermissionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::operation::put_permission::PutPermissionInput {
profiling_group_name: self.profiling_group_name,
action_group: self.action_group,
principals: self.principals,
revision_id: self.revision_id,
})
}
}