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".
  • Constructor Details

    • SdkServiceIdValidator

      public SdkServiceIdValidator()
  • Method Details

    • validate

      public 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(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(String serviceId)
      Validates a service ID value.
      Parameters:
      serviceId - Service ID to validate.
      Throws:
      IllegalArgumentException - if the service ID is invalid.