Class Check

java.lang.Object
software.amazon.awssdk.services.iamtoolbox.model.Check
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<Check.Builder,Check>

@Generated("software.amazon.awssdk:codegen") public final class Check extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Check.Builder,Check>

Represents one authorization requirement considered during an evaluation and its result.

See Also:
  • Method Details

    • checkType

      public final CheckType checkType()

      The type of requirement that the check evaluates. Valid values:

      • SERVICE_CONTROL_POLICY - The service control policies (SCPs) attached to one organization target, such as a root, organizational unit, or account, that apply to the principal.

      • RESOURCE_CONTROL_POLICY - The resource control policies (RCPs) attached to one organization target that apply to the resource.

      • VPC_ENDPOINT - The VPC endpoint policy for the endpoint through which the request passes.

      • RESOURCE - The resource owner's resource-based policies, when the owner must allow the request separately, such as a cross-account request or a request to an AWS KMS key.

      • PRINCIPAL - The principal's identity-based policies attached to the IAM user or role.

      • PERMISSIONS_BOUNDARY - The permissions boundary on the IAM user or role.

      • SESSION - The role session that made the request, decided by its session policies.

      If the service returns an enum value that is not available in the current SDK version, checkType will return CheckType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from checkTypeAsString().

      Returns:
      The type of requirement that the check evaluates. Valid values:

      • SERVICE_CONTROL_POLICY - The service control policies (SCPs) attached to one organization target, such as a root, organizational unit, or account, that apply to the principal.

      • RESOURCE_CONTROL_POLICY - The resource control policies (RCPs) attached to one organization target that apply to the resource.

      • VPC_ENDPOINT - The VPC endpoint policy for the endpoint through which the request passes.

      • RESOURCE - The resource owner's resource-based policies, when the owner must allow the request separately, such as a cross-account request or a request to an AWS KMS key.

      • PRINCIPAL - The principal's identity-based policies attached to the IAM user or role.

      • PERMISSIONS_BOUNDARY - The permissions boundary on the IAM user or role.

      • SESSION - The role session that made the request, decided by its session policies.

      See Also:
    • checkTypeAsString

      public final String checkTypeAsString()

      The type of requirement that the check evaluates. Valid values:

      • SERVICE_CONTROL_POLICY - The service control policies (SCPs) attached to one organization target, such as a root, organizational unit, or account, that apply to the principal.

      • RESOURCE_CONTROL_POLICY - The resource control policies (RCPs) attached to one organization target that apply to the resource.

      • VPC_ENDPOINT - The VPC endpoint policy for the endpoint through which the request passes.

      • RESOURCE - The resource owner's resource-based policies, when the owner must allow the request separately, such as a cross-account request or a request to an AWS KMS key.

      • PRINCIPAL - The principal's identity-based policies attached to the IAM user or role.

      • PERMISSIONS_BOUNDARY - The permissions boundary on the IAM user or role.

      • SESSION - The role session that made the request, decided by its session policies.

      If the service returns an enum value that is not available in the current SDK version, checkType will return CheckType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from checkTypeAsString().

      Returns:
      The type of requirement that the check evaluates. Valid values:

      • SERVICE_CONTROL_POLICY - The service control policies (SCPs) attached to one organization target, such as a root, organizational unit, or account, that apply to the principal.

      • RESOURCE_CONTROL_POLICY - The resource control policies (RCPs) attached to one organization target that apply to the resource.

      • VPC_ENDPOINT - The VPC endpoint policy for the endpoint through which the request passes.

      • RESOURCE - The resource owner's resource-based policies, when the owner must allow the request separately, such as a cross-account request or a request to an AWS KMS key.

      • PRINCIPAL - The principal's identity-based policies attached to the IAM user or role.

      • PERMISSIONS_BOUNDARY - The permissions boundary on the IAM user or role.

      • SESSION - The role session that made the request, decided by its session policies.

      See Also:
    • evaluatedEffect

      public final CheckEffect evaluatedEffect()

      The result of evaluating this requirement. Valid values:

      • ALLOW - A statement that applies to this check allows the request.

      • EXPLICIT_DENY - A deny statement that applies to this check matches.

      • IMPLICIT_DENY - The check required an allow and nothing that applies to it allows the request.

      • NO_IMPACT - No statement in this check matched, and no allow was needed because another path allowed the request.

      If the service returns an enum value that is not available in the current SDK version, evaluatedEffect will return CheckEffect.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from evaluatedEffectAsString().

      Returns:
      The result of evaluating this requirement. Valid values:

      • ALLOW - A statement that applies to this check allows the request.

      • EXPLICIT_DENY - A deny statement that applies to this check matches.

      • IMPLICIT_DENY - The check required an allow and nothing that applies to it allows the request.

      • NO_IMPACT - No statement in this check matched, and no allow was needed because another path allowed the request.

      See Also:
    • evaluatedEffectAsString

      public final String evaluatedEffectAsString()

      The result of evaluating this requirement. Valid values:

      • ALLOW - A statement that applies to this check allows the request.

      • EXPLICIT_DENY - A deny statement that applies to this check matches.

      • IMPLICIT_DENY - The check required an allow and nothing that applies to it allows the request.

      • NO_IMPACT - No statement in this check matched, and no allow was needed because another path allowed the request.

      If the service returns an enum value that is not available in the current SDK version, evaluatedEffect will return CheckEffect.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from evaluatedEffectAsString().

      Returns:
      The result of evaluating this requirement. Valid values:

      • ALLOW - A statement that applies to this check allows the request.

      • EXPLICIT_DENY - A deny statement that applies to this check matches.

      • IMPLICIT_DENY - The check required an allow and nothing that applies to it allows the request.

      • NO_IMPACT - No statement in this check matched, and no allow was needed because another path allowed the request.

      See Also:
    • targetArn

      public final String targetArn()

      The ARN that distinguishes this check from other checks of the same type. This value is absent when the check type alone identifies the check. For SCP and RCP checks, this is the AWS Organizations ARN of the root, organizational unit, or account that the evaluated policies are attached to.

      Returns:
      The ARN that distinguishes this check from other checks of the same type. This value is absent when the check type alone identifies the check. For SCP and RCP checks, this is the AWS Organizations ARN of the root, organizational unit, or account that the evaluated policies are attached to.
    • relevantPolicyTypes

      public final List<PolicyType> relevantPolicyTypes()

      The policy types used to satisfy this check, plus the type of every policy with a statement that matched in it. matchedPolicies lists matching policies in the top-level policies list.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasRelevantPolicyTypes() method.

      Returns:
      The policy types used to satisfy this check, plus the type of every policy with a statement that matched in it. matchedPolicies lists matching policies in the top-level policies list.
    • hasRelevantPolicyTypes

      public final boolean hasRelevantPolicyTypes()
      For responses, this returns true if the service returned a value for the RelevantPolicyTypes property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • relevantPolicyTypesAsStrings

      public final List<String> relevantPolicyTypesAsStrings()

      The policy types used to satisfy this check, plus the type of every policy with a statement that matched in it. matchedPolicies lists matching policies in the top-level policies list.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasRelevantPolicyTypes() method.

      Returns:
      The policy types used to satisfy this check, plus the type of every policy with a statement that matched in it. matchedPolicies lists matching policies in the top-level policies list.
    • hasMatchedPolicies

      public final boolean hasMatchedPolicies()
      For responses, this returns true if the service returned a value for the MatchedPolicies property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • matchedPolicies

      public final List<MatchedPolicy> matchedPolicies()

      Policies in this list have statements that matched for this check. Each URI corresponds to an entry in the top-level policies list. Only policies in the top-level list are included. The check effect can reflect a matched policy omitted from this list, so this list can be empty even when the effect is ALLOW.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasMatchedPolicies() method.

      Returns:
      Policies in this list have statements that matched for this check. Each URI corresponds to an entry in the top-level policies list. Only policies in the top-level list are included. The check effect can reflect a matched policy omitted from this list, so this list can be empty even when the effect is ALLOW.
    • toBuilder

      public Check.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<Check.Builder,Check>
      Returns:
      a builder for type T
    • builder

      public static Check.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Check.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.