Class ValidationException
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<ValidationException.Builder,ValidationException>
The input fails to satisfy the constraints specified by the service.
A caller branches on Reason, and where the rejection is attributable to particular fields it reads
FieldList rather than parsing Message, which is prose and may change.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ValidationException.Builderbuilder()Every field that failed, not just the first.booleanFor responses, this returns true if the service returned a value for the FieldList property.reason()The single coarse reason the request was rejected, for a caller that does not care which field.The single coarse reason the request was rejected, for a caller that does not care which field.static Class<? extends ValidationException.Builder> Create aAwsServiceException.Builderinitialized with the properties of thisAwsServiceException.Methods inherited from class software.amazon.awssdk.awscore.exception.AwsServiceException
awsErrorDetails, getMessage, isClockSkewException, isThrottlingExceptionMethods inherited from class software.amazon.awssdk.core.exception.SdkServiceException
extendedRequestId, isRetryableException, requestId, statusCodeMethods inherited from class software.amazon.awssdk.core.exception.SdkException
create, numAttempts, rawMessage, retryableMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFieldsMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
toBuilder
Description copied from class:AwsServiceExceptionCreate aAwsServiceException.Builderinitialized with the properties of thisAwsServiceException.- Specified by:
toBuilderin interfaceToCopyableBuilder<ValidationException.Builder,ValidationException> - Overrides:
toBuilderin classPartnerCentralMarketingException- Returns:
- A new builder initialized with this config's properties.
-
builder
-
serializableBuilderClass
-
reason
The single coarse reason the request was rejected, for a caller that does not care which field.
If the service returns an enum value that is not available in the current SDK version,
reasonwill returnValidationExceptionReason.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromreasonAsString().- Returns:
- The single coarse reason the request was rejected, for a caller that does not care which field.
- See Also:
-
reasonAsString
The single coarse reason the request was rejected, for a caller that does not care which field.
If the service returns an enum value that is not available in the current SDK version,
reasonwill returnValidationExceptionReason.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromreasonAsString().- Returns:
- The single coarse reason the request was rejected, for a caller that does not care which field.
- See Also:
-
hasFieldList
public boolean hasFieldList()For responses, this returns true if the service returned a value for the FieldList property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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. -
fieldList
Every field that failed, not just the first.
⚠️ **Every field, deliberately.** The convention comment carried by most internal models — *"if more than one field caused the error, pick one and elaborate in the message"* — is the reading this service does NOT take: a partner editing a form would then discover their errors one request at a time. The whole request is validated and the full set reported, so one round of fixes is one call.
Each entry names a member of the request just sent, and only that: the value to change and send again. A template field value is `Name` `FieldValues` with the template field in `FieldId`, one entry per failing field.
When it is present. Only when the refusal points at something the partner fixes in a form, and then every such refusal carries it: - `UpdateCampaignAsset`: `FieldValues` (including a file the content scan declined, which is why a partner handles image failures and text failures the same way, through this list), `Layout`, `SendMode` and `ScheduledSendAt`; - `CreateCampaign` and `UpdateCampaign`: campaign settings and files; - `GetCampaignTemplate`: `Identifier`.
Every other `ValidationException` carries `Message` only — tags, ARNs, social connections, exports, and `CAMPAIGN_INCOMPLETE`, whose missing settings are not members of the request it refuses.
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
hasFieldList()method.- Returns:
- Every field that failed, not just the first.
⚠️ **Every field, deliberately.** The convention comment carried by most internal models — *"if more than one field caused the error, pick one and elaborate in the message"* — is the reading this service does NOT take: a partner editing a form would then discover their errors one request at a time. The whole request is validated and the full set reported, so one round of fixes is one call.
Each entry names a member of the request just sent, and only that: the value to change and send again. A template field value is `Name` `FieldValues` with the template field in `FieldId`, one entry per failing field.
When it is present. Only when the refusal points at something the partner fixes in a form, and then every such refusal carries it: - `UpdateCampaignAsset`: `FieldValues` (including a file the content scan declined, which is why a partner handles image failures and text failures the same way, through this list), `Layout`, `SendMode` and `ScheduledSendAt`; - `CreateCampaign` and `UpdateCampaign`: campaign settings and files; - `GetCampaignTemplate`: `Identifier`.
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-