Class SdkServiceIdValidator
java.lang.Object
software.amazon.smithy.model.validation.AbstractValidator
software.amazon.smithy.aws.traits.SdkServiceIdValidator
- All Implemented Interfaces:
Validator
Validates that SDK service IDs are correct and do not match any
prohibited patterns.
- Must match the following regex: ^[a-zA-Z][a-zA-Z0-9]*( [a-zA-Z0-9]+)*$
- Must not contain "Amazon", "AWS", or "Aws"
- Must not case-insensitively end with "Service", "Client", or "API".
-
Field Summary
Fields inherited from interface software.amazon.smithy.model.validation.Validator
MODEL_DEPRECATION, MODEL_ERROR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isPreviouslyReleasedInvalidServiceId
(String serviceId) Checks if the given value is a previously released but invalid service ID.Validates a model and returns a list of validation events.static void
validateServiceId
(String serviceId) Validates a service ID value.Methods inherited from class software.amazon.smithy.model.validation.AbstractValidator
createEvent, createEvent, createEvent, createEvent, danger, danger, danger, danger, danger, danger, danger, danger, error, error, error, error, error, error, error, error, getName, note, note, note, note, note, note, note, note, warning, warning, warning, warning, warning, warning, warning, warning
-
Constructor Details
-
SdkServiceIdValidator
public SdkServiceIdValidator()
-
-
Method Details
-
validate
Description copied from interface:Validator
Validates a model and returns a list of validation events.- Parameters:
model
- Model to validate.- Returns:
- List of validation events.
-
isPreviouslyReleasedInvalidServiceId
Checks if the given value is a previously released but invalid service ID.- Parameters:
serviceId
- Service ID value to check.- Returns:
- Returns true if the service ID is approved but invalid.
-
validateServiceId
Validates a service ID value.- Parameters:
serviceId
- Service ID to validate.- Throws:
IllegalArgumentException
- if the service ID is invalid.
-