# Path: python_anticaptcha/exceptions.py
# class InvalidWidthException(AnticaptchaException):
#     def __init__(self, width):
#         self.width = width
#         msg = "Invalid width (%s). Can be one of these: 100, 50, 33, 25." % (
#             self.width,
#         )
#         super(InvalidWidthException, self).__init__("AC-1", 1, msg)
# 
# class MissingNameException(AnticaptchaException):
#     def __init__(self, cls):
#         self.cls = cls
#         msg = 'Missing name data in {0}. Provide {0}.__init__(name="X") or {0}.serialize(name="X")'.format(
#             str(self.cls)
#         )
#         super(MissingNameException, self).__init__("AC-2", 2, msg)


import six
from python_anticaptcha.exceptions import InvalidWidthException, MissingNameException
        data["contentType"] = self.contentType

        if self.width:
            if self.width not in [100, 50, 33, 25]:
                raise InvalidWidthException(self.width)
            data["inputOptions"] = {}
            data["width"] = self.width

        data.update({"content": {"url": self.linkUrl, "text": self.linkText}})

        return data


class TextInput(NameBaseField):
    def __init__(self, placeHolder=None, label=None, labelHint=None, width=None):
        self.label = label
        self.labelHint = labelHint

        self.placeHolder = placeHolder

        self.width = width

    def serialize(self, name=None):
        data = super(TextInput, self).serialize(name)
        data["inputType"] = "text"

        data["inputOptions"] = {}

        if self.width:
            if self.width not in [100, 50, 33, 25]:

# Path: python_anticaptcha/exceptions.py
# class InvalidWidthException(AnticaptchaException):
#     def __init__(self, width):
#         self.width = width
#         msg = "Invalid width (%s). Can be one of these: 100, 50, 33, 25." % (
#             self.width,
#         )
#         super(InvalidWidthException, self).__init__("AC-1", 1, msg)
# 
# class MissingNameException(AnticaptchaException):
#     def __init__(self, cls):
#         self.cls = cls
#         msg = 'Missing name data in {0}. Provide {0}.__init__(name="X") or {0}.serialize(name="X")'.format(
#             str(self.cls)
#         )
#         super(MissingNameException, self).__init__("AC-2", 2, msg)


# Path: python_anticaptcha/fields.py
import six
from python_anticaptcha.exceptions import InvalidWidthException, MissingNameException

        data["contentType"] = self.contentType

        if self.width:
            if self.width not in [100, 50, 33, 25]:
                raise InvalidWidthException(self.width)
            data["inputOptions"] = {}
            data["width"] = self.width

        data.update({"content": {"url": self.linkUrl, "text": self.linkText}})

        return data


class TextInput(NameBaseField):
    def __init__(self, placeHolder=None, label=None, labelHint=None, width=None):
        self.label = label
        self.labelHint = labelHint

        self.placeHolder = placeHolder

        self.width = width

    def serialize(self, name=None):
        data = super(TextInput, self).serialize(name)
        data["inputType"] = "text"

        data["inputOptions"] = {}

        if self.width:
            if self.width not in [100, 50, 33, 25]:

                raise InvalidWidthException(self.width)