public static function endpointSuffix()

in src/Filter/ApiFilter.php [98:122]


    public static function endpointSuffix($endpointSuffix)
    {
        if (!is_string($endpointSuffix)) {
            throw new ClientException(
                'Endpoint Suffix must be a string',
                SDK::INVALID_ARGUMENT
            );
        }

        if ($endpointSuffix === '') {
            throw new ClientException(
                'Endpoint Suffix cannot be empty',
                SDK::INVALID_ARGUMENT
            );
        }

        if (!preg_match("/^[a-zA-Z0-9_-]+$/", $endpointSuffix)) {
            throw new ClientException(
                'Invalid Endpoint Suffix',
                SDK::INVALID_ARGUMENT
            );
        }

        return $endpointSuffix;
    }