Class SdkServiceIdValidator
- java.lang.Object
-
- software.amazon.smithy.model.validation.AbstractValidator
-
- software.amazon.smithy.aws.traits.SdkServiceIdValidator
-
- All Implemented Interfaces:
Validator
public final class SdkServiceIdValidator extends AbstractValidator
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_ERROR
-
-
Constructor Summary
Constructors Constructor Description SdkServiceIdValidator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isPreviouslyReleasedInvalidServiceId(java.lang.String serviceId)
Checks if the given value is a previously released but invalid service ID.java.util.List<ValidationEvent>
validate(Model model)
Validates a model and returns a list of validation events.static void
validateServiceId(java.lang.String serviceId)
Validates a service ID value.
-
-
-
Method Detail
-
validate
public java.util.List<ValidationEvent> validate(Model model)
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
public static boolean isPreviouslyReleasedInvalidServiceId(java.lang.String serviceId)
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
public static void validateServiceId(java.lang.String serviceId)
Validates a service ID value.- Parameters:
serviceId
- Service ID to validate.- Throws:
java.lang.IllegalArgumentException
- if the service ID is invalid.
-
-