# Path: sevenbridges/errors.py
# class ReadOnlyPropertyError(SbgError):
#     def __init__(self, message):
#         super().__init__(
#             code=-1, status=-1, message=message
#         )
# 
# class ValidationError(SbgError):
#     def __init__(self, message):
#         super().__init__(
#             code=-1, status=-1, message=message
#         )


from uuid import UUID
from datetime import datetime
from sevenbridges.errors import ReadOnlyPropertyError, ValidationError
                f'{value} is not a valid value for {type(self).__name__}'
            )
        return value


class FloatField(Field):
    def __init__(self, read_only, name=None):
        super().__init__(name=name, read_only=read_only)

    def validate(self, value):
        try:
            return float(value)
        except ValueError:
            raise ValidationError(
                f'{value} is not a valid value for {type(self).__name__}'
            )


class StringField(Field):
    def __init__(self, read_only, name=None, max_length=None):
        super().__init__(name=name, read_only=read_only)
        self.max_length = max_length

    def validate(self, value):
        value = super().validate(value)
        if value and not isinstance(value, str):
            raise ValidationError(
                f'{value} is not a valid value for {type(self).__name__}'
            )
        if self.max_length is not None and len(value) > self.max_length:

# Path: sevenbridges/errors.py
# class ReadOnlyPropertyError(SbgError):
#     def __init__(self, message):
#         super().__init__(
#             code=-1, status=-1, message=message
#         )
# 
# class ValidationError(SbgError):
#     def __init__(self, message):
#         super().__init__(
#             code=-1, status=-1, message=message
#         )


# Path: sevenbridges/meta/fields.py
from uuid import UUID
from datetime import datetime
from sevenbridges.errors import ReadOnlyPropertyError, ValidationError

                f'{value} is not a valid value for {type(self).__name__}'
            )
        return value


class FloatField(Field):
    def __init__(self, read_only, name=None):
        super().__init__(name=name, read_only=read_only)

    def validate(self, value):
        try:
            return float(value)
        except ValueError:
            raise ValidationError(
                f'{value} is not a valid value for {type(self).__name__}'
            )


class StringField(Field):
    def __init__(self, read_only, name=None, max_length=None):
        super().__init__(name=name, read_only=read_only)
        self.max_length = max_length

    def validate(self, value):
        value = super().validate(value)
        if value and not isinstance(value, str):
            raise ValidationError(
                f'{value} is not a valid value for {type(self).__name__}'
            )
        if self.max_length is not None and len(value) > self.max_length:

            raise ValidationError(f'{self.name}: max length exceeded.')