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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
// 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 ValidatePolicyInput {
/// <p>The locale to use for localizing the findings.</p>
pub locale: ::std::option::Option<crate::types::Locale>,
/// <p>The maximum number of results to return in the response.</p>
pub max_results: ::std::option::Option<i32>,
/// <p>A token used for pagination of results returned.</p>
pub next_token: ::std::option::Option<::std::string::String>,
/// <p>The JSON policy document to use as the content for the policy.</p>
pub policy_document: ::std::option::Option<::std::string::String>,
/// <p>The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups.</p>
/// <p>Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy.</p>
/// <p>Service control policies (SCPs) are a type of organization policy attached to an Amazon Web Services organization, organizational unit (OU), or an account.</p>
pub policy_type: ::std::option::Option<crate::types::PolicyType>,
/// <p>The type of resource to attach to your resource policy. Specify a value for the policy validation resource type only if the policy type is <code>RESOURCE_POLICY</code>. For example, to validate a resource policy to attach to an Amazon S3 bucket, you can choose <code>AWS::S3::Bucket</code> for the policy validation resource type.</p>
/// <p>For resource types not supported as valid values, IAM Access Analyzer runs policy checks that apply to all resource policies. For example, to validate a resource policy to attach to a KMS key, do not specify a value for the policy validation resource type and IAM Access Analyzer will run policy checks that apply to all resource policies.</p>
pub validate_policy_resource_type: ::std::option::Option<crate::types::ValidatePolicyResourceType>,
}
impl ValidatePolicyInput {
/// <p>The locale to use for localizing the findings.</p>
pub fn locale(&self) -> ::std::option::Option<&crate::types::Locale> {
self.locale.as_ref()
}
/// <p>The maximum number of results to return in the response.</p>
pub fn max_results(&self) -> ::std::option::Option<i32> {
self.max_results
}
/// <p>A token used for pagination of results returned.</p>
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
/// <p>The JSON policy document to use as the content for the policy.</p>
pub fn policy_document(&self) -> ::std::option::Option<&str> {
self.policy_document.as_deref()
}
/// <p>The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups.</p>
/// <p>Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy.</p>
/// <p>Service control policies (SCPs) are a type of organization policy attached to an Amazon Web Services organization, organizational unit (OU), or an account.</p>
pub fn policy_type(&self) -> ::std::option::Option<&crate::types::PolicyType> {
self.policy_type.as_ref()
}
/// <p>The type of resource to attach to your resource policy. Specify a value for the policy validation resource type only if the policy type is <code>RESOURCE_POLICY</code>. For example, to validate a resource policy to attach to an Amazon S3 bucket, you can choose <code>AWS::S3::Bucket</code> for the policy validation resource type.</p>
/// <p>For resource types not supported as valid values, IAM Access Analyzer runs policy checks that apply to all resource policies. For example, to validate a resource policy to attach to a KMS key, do not specify a value for the policy validation resource type and IAM Access Analyzer will run policy checks that apply to all resource policies.</p>
pub fn validate_policy_resource_type(&self) -> ::std::option::Option<&crate::types::ValidatePolicyResourceType> {
self.validate_policy_resource_type.as_ref()
}
}
impl ValidatePolicyInput {
/// Creates a new builder-style object to manufacture [`ValidatePolicyInput`](crate::operation::validate_policy::ValidatePolicyInput).
pub fn builder() -> crate::operation::validate_policy::builders::ValidatePolicyInputBuilder {
crate::operation::validate_policy::builders::ValidatePolicyInputBuilder::default()
}
}
/// A builder for [`ValidatePolicyInput`](crate::operation::validate_policy::ValidatePolicyInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ValidatePolicyInputBuilder {
pub(crate) locale: ::std::option::Option<crate::types::Locale>,
pub(crate) max_results: ::std::option::Option<i32>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
pub(crate) policy_document: ::std::option::Option<::std::string::String>,
pub(crate) policy_type: ::std::option::Option<crate::types::PolicyType>,
pub(crate) validate_policy_resource_type: ::std::option::Option<crate::types::ValidatePolicyResourceType>,
}
impl ValidatePolicyInputBuilder {
/// <p>The locale to use for localizing the findings.</p>
pub fn locale(mut self, input: crate::types::Locale) -> Self {
self.locale = ::std::option::Option::Some(input);
self
}
/// <p>The locale to use for localizing the findings.</p>
pub fn set_locale(mut self, input: ::std::option::Option<crate::types::Locale>) -> Self {
self.locale = input;
self
}
/// <p>The locale to use for localizing the findings.</p>
pub fn get_locale(&self) -> &::std::option::Option<crate::types::Locale> {
&self.locale
}
/// <p>The maximum number of results to return in the response.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = ::std::option::Option::Some(input);
self
}
/// <p>The maximum number of results to return in the response.</p>
pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
/// <p>The maximum number of results to return in the response.</p>
pub fn get_max_results(&self) -> &::std::option::Option<i32> {
&self.max_results
}
/// <p>A token used for pagination of results returned.</p>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A token used for pagination of results returned.</p>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
/// <p>A token used for pagination of results returned.</p>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
/// <p>The JSON policy document to use as the content for the policy.</p>
/// This field is required.
pub fn policy_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_document = ::std::option::Option::Some(input.into());
self
}
/// <p>The JSON policy document to use as the content for the policy.</p>
pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_document = input;
self
}
/// <p>The JSON policy document to use as the content for the policy.</p>
pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_document
}
/// <p>The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups.</p>
/// <p>Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy.</p>
/// <p>Service control policies (SCPs) are a type of organization policy attached to an Amazon Web Services organization, organizational unit (OU), or an account.</p>
/// This field is required.
pub fn policy_type(mut self, input: crate::types::PolicyType) -> Self {
self.policy_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups.</p>
/// <p>Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy.</p>
/// <p>Service control policies (SCPs) are a type of organization policy attached to an Amazon Web Services organization, organizational unit (OU), or an account.</p>
pub fn set_policy_type(mut self, input: ::std::option::Option<crate::types::PolicyType>) -> Self {
self.policy_type = input;
self
}
/// <p>The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups.</p>
/// <p>Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy.</p>
/// <p>Service control policies (SCPs) are a type of organization policy attached to an Amazon Web Services organization, organizational unit (OU), or an account.</p>
pub fn get_policy_type(&self) -> &::std::option::Option<crate::types::PolicyType> {
&self.policy_type
}
/// <p>The type of resource to attach to your resource policy. Specify a value for the policy validation resource type only if the policy type is <code>RESOURCE_POLICY</code>. For example, to validate a resource policy to attach to an Amazon S3 bucket, you can choose <code>AWS::S3::Bucket</code> for the policy validation resource type.</p>
/// <p>For resource types not supported as valid values, IAM Access Analyzer runs policy checks that apply to all resource policies. For example, to validate a resource policy to attach to a KMS key, do not specify a value for the policy validation resource type and IAM Access Analyzer will run policy checks that apply to all resource policies.</p>
pub fn validate_policy_resource_type(mut self, input: crate::types::ValidatePolicyResourceType) -> Self {
self.validate_policy_resource_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of resource to attach to your resource policy. Specify a value for the policy validation resource type only if the policy type is <code>RESOURCE_POLICY</code>. For example, to validate a resource policy to attach to an Amazon S3 bucket, you can choose <code>AWS::S3::Bucket</code> for the policy validation resource type.</p>
/// <p>For resource types not supported as valid values, IAM Access Analyzer runs policy checks that apply to all resource policies. For example, to validate a resource policy to attach to a KMS key, do not specify a value for the policy validation resource type and IAM Access Analyzer will run policy checks that apply to all resource policies.</p>
pub fn set_validate_policy_resource_type(mut self, input: ::std::option::Option<crate::types::ValidatePolicyResourceType>) -> Self {
self.validate_policy_resource_type = input;
self
}
/// <p>The type of resource to attach to your resource policy. Specify a value for the policy validation resource type only if the policy type is <code>RESOURCE_POLICY</code>. For example, to validate a resource policy to attach to an Amazon S3 bucket, you can choose <code>AWS::S3::Bucket</code> for the policy validation resource type.</p>
/// <p>For resource types not supported as valid values, IAM Access Analyzer runs policy checks that apply to all resource policies. For example, to validate a resource policy to attach to a KMS key, do not specify a value for the policy validation resource type and IAM Access Analyzer will run policy checks that apply to all resource policies.</p>
pub fn get_validate_policy_resource_type(&self) -> &::std::option::Option<crate::types::ValidatePolicyResourceType> {
&self.validate_policy_resource_type
}
/// Consumes the builder and constructs a [`ValidatePolicyInput`](crate::operation::validate_policy::ValidatePolicyInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::validate_policy::ValidatePolicyInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::validate_policy::ValidatePolicyInput {
locale: self.locale,
max_results: self.max_results,
next_token: self.next_token,
policy_document: self.policy_document,
policy_type: self.policy_type,
validate_policy_resource_type: self.validate_policy_resource_type,
})
}
}