Class AccessDeniedException

All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<AccessDeniedException.Builder,AccessDeniedException>

@Generated("software.amazon.awssdk:codegen") public final class AccessDeniedException extends PaymentsException implements ToCopyableBuilder<AccessDeniedException.Builder,AccessDeniedException>

The request is denied because you don't have sufficient access to perform this operation. Verify that you have the required permissions and try again. This error is also returned, instead of ResourceNotFoundException, when you aren't authorized for the resource, so the response doesn't reveal whether the resource exists.

See Also:
  • Method Details

    • toBuilder

      public AccessDeniedException.Builder toBuilder()
      Description copied from class: AwsServiceException
      Create a AwsServiceException.Builder initialized with the properties of this AwsServiceException.
      Specified by:
      toBuilder in interface ToCopyableBuilder<AccessDeniedException.Builder,AccessDeniedException>
      Overrides:
      toBuilder in class PaymentsException
      Returns:
      A new builder initialized with this config's properties.
    • builder

      public static AccessDeniedException.Builder builder()
    • serializableBuilderClass

      public static Class<? extends AccessDeniedException.Builder> serializableBuilderClass()
    • reason

      public AccessDeniedExceptionReason reason()

      The reason that access was denied. The following values are valid:

      • NOT_AUTHORIZED – Your IAM policies don't allow this action.

      • INVALID_ACCOUNT_STATE – Your Amazon Web Services account isn't in a state that allows this action, for example because registration isn't complete or the account is suspended.

      • OTHER – Access was denied for another reason.

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

      Returns:
      The reason that access was denied. The following values are valid:

      • NOT_AUTHORIZED – Your IAM policies don't allow this action.

      • INVALID_ACCOUNT_STATE – Your Amazon Web Services account isn't in a state that allows this action, for example because registration isn't complete or the account is suspended.

      • OTHER – Access was denied for another reason.

      See Also:
    • reasonAsString

      public String reasonAsString()

      The reason that access was denied. The following values are valid:

      • NOT_AUTHORIZED – Your IAM policies don't allow this action.

      • INVALID_ACCOUNT_STATE – Your Amazon Web Services account isn't in a state that allows this action, for example because registration isn't complete or the account is suspended.

      • OTHER – Access was denied for another reason.

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

      Returns:
      The reason that access was denied. The following values are valid:

      • NOT_AUTHORIZED – Your IAM policies don't allow this action.

      • INVALID_ACCOUNT_STATE – Your Amazon Web Services account isn't in a state that allows this action, for example because registration isn't complete or the account is suspended.

      • OTHER – Access was denied for another reason.

      See Also:
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Overrides:
      sdkFields in class SdkServiceException
      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.