Add regex support

This commit is contained in:
Scott Williams
2016-05-06 22:52:44 +01:00
parent 1fef0ef691
commit fed22a1f72
22 changed files with 192 additions and 24 deletions

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Animal(object):
@@ -66,6 +67,7 @@ class Animal(object):
:param class_name: The class_name of this Animal.
:type: str
"""
self._class_name = class_name
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class ApiResponse(object):
@@ -72,6 +73,7 @@ class ApiResponse(object):
:param code: The code of this ApiResponse.
:type: int
"""
self._code = code
@property
@@ -94,6 +96,7 @@ class ApiResponse(object):
:param type: The type of this ApiResponse.
:type: str
"""
self._type = type
@property
@@ -116,6 +119,7 @@ class ApiResponse(object):
:param message: The message of this ApiResponse.
:type: str
"""
self._message = message
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Cat(object):
@@ -69,6 +70,7 @@ class Cat(object):
:param class_name: The class_name of this Cat.
:type: str
"""
self._class_name = class_name
@property
@@ -91,6 +93,7 @@ class Cat(object):
:param declawed: The declawed of this Cat.
:type: bool
"""
self._declawed = declawed
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Category(object):
@@ -69,6 +70,7 @@ class Category(object):
:param id: The id of this Category.
:type: int
"""
self._id = id
@property
@@ -91,6 +93,7 @@ class Category(object):
:param name: The name of this Category.
:type: str
"""
self._name = name
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Dog(object):
@@ -69,6 +70,7 @@ class Dog(object):
:param class_name: The class_name of this Dog.
:type: str
"""
self._class_name = class_name
@property
@@ -91,6 +93,7 @@ class Dog(object):
:param breed: The breed of this Dog.
:type: str
"""
self._breed = breed
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class FormatTest(object):
@@ -102,6 +103,14 @@ class FormatTest(object):
:param integer: The integer of this FormatTest.
:type: int
"""
if not integer:
raise ValueError("Invalid value for `integer`, must not be `None`")
if integer > 100.0:
raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100.0`")
if integer < 10.0:
raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10.0`")
self._integer = integer
@property
@@ -124,6 +133,14 @@ class FormatTest(object):
:param int32: The int32 of this FormatTest.
:type: int
"""
if not int32:
raise ValueError("Invalid value for `int32`, must not be `None`")
if int32 > 200.0:
raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200.0`")
if int32 < 20.0:
raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20.0`")
self._int32 = int32
@property
@@ -146,6 +163,7 @@ class FormatTest(object):
:param int64: The int64 of this FormatTest.
:type: int
"""
self._int64 = int64
@property
@@ -168,6 +186,14 @@ class FormatTest(object):
:param number: The number of this FormatTest.
:type: float
"""
if not number:
raise ValueError("Invalid value for `number`, must not be `None`")
if number > 543.2:
raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`")
if number < 32.1:
raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`")
self._number = number
@property
@@ -190,6 +216,14 @@ class FormatTest(object):
:param float: The float of this FormatTest.
:type: float
"""
if not float:
raise ValueError("Invalid value for `float`, must not be `None`")
if float > 987.6:
raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`")
if float < 54.3:
raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`")
self._float = float
@property
@@ -212,6 +246,14 @@ class FormatTest(object):
:param double: The double of this FormatTest.
:type: float
"""
if not double:
raise ValueError("Invalid value for `double`, must not be `None`")
if double > 123.4:
raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`")
if double < 67.8:
raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`")
self._double = double
@property
@@ -234,6 +276,12 @@ class FormatTest(object):
:param string: The string of this FormatTest.
:type: str
"""
if not string:
raise ValueError("Invalid value for `string`, must not be `None`")
if not re.match('/[a-z]/i', string):
raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`")
self._string = string
@property
@@ -256,6 +304,7 @@ class FormatTest(object):
:param byte: The byte of this FormatTest.
:type: str
"""
self._byte = byte
@property
@@ -278,6 +327,7 @@ class FormatTest(object):
:param binary: The binary of this FormatTest.
:type: str
"""
self._binary = binary
@property
@@ -300,6 +350,7 @@ class FormatTest(object):
:param date: The date of this FormatTest.
:type: date
"""
self._date = date
@property
@@ -322,6 +373,7 @@ class FormatTest(object):
:param date_time: The date_time of this FormatTest.
:type: datetime
"""
self._date_time = date_time
@property
@@ -344,6 +396,7 @@ class FormatTest(object):
:param uuid: The uuid of this FormatTest.
:type: str
"""
self._uuid = uuid
@property
@@ -366,6 +419,14 @@ class FormatTest(object):
:param password: The password of this FormatTest.
:type: str
"""
if not password:
raise ValueError("Invalid value for `password`, must not be `None`")
if len(password) > 64:
raise ValueError("Invalid value for `password`, length must be less than `64`")
if len(password) < 10:
raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`")
self._password = password
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Model200Response(object):
@@ -66,6 +67,7 @@ class Model200Response(object):
:param name: The name of this Model200Response.
:type: int
"""
self._name = name
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class ModelReturn(object):
@@ -66,6 +67,7 @@ class ModelReturn(object):
:param _return: The _return of this ModelReturn.
:type: int
"""
self.__return = _return
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Name(object):
@@ -72,6 +73,7 @@ class Name(object):
:param name: The name of this Name.
:type: int
"""
self._name = name
@property
@@ -94,6 +96,7 @@ class Name(object):
:param snake_case: The snake_case of this Name.
:type: int
"""
self._snake_case = snake_case
@property
@@ -116,6 +119,7 @@ class Name(object):
:param _property: The _property of this Name.
:type: str
"""
self.__property = _property
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Order(object):
@@ -81,6 +82,7 @@ class Order(object):
:param id: The id of this Order.
:type: int
"""
self._id = id
@property
@@ -103,6 +105,7 @@ class Order(object):
:param pet_id: The pet_id of this Order.
:type: int
"""
self._pet_id = pet_id
@property
@@ -125,6 +128,7 @@ class Order(object):
:param quantity: The quantity of this Order.
:type: int
"""
self._quantity = quantity
@property
@@ -147,6 +151,7 @@ class Order(object):
:param ship_date: The ship_date of this Order.
:type: datetime
"""
self._ship_date = ship_date
@property
@@ -175,6 +180,7 @@ class Order(object):
"Invalid value for `status`, must be one of {0}"
.format(allowed_values)
)
self._status = status
@property
@@ -197,6 +203,7 @@ class Order(object):
:param complete: The complete of this Order.
:type: bool
"""
self._complete = complete
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Pet(object):
@@ -81,6 +82,7 @@ class Pet(object):
:param id: The id of this Pet.
:type: int
"""
self._id = id
@property
@@ -103,6 +105,7 @@ class Pet(object):
:param category: The category of this Pet.
:type: Category
"""
self._category = category
@property
@@ -125,6 +128,7 @@ class Pet(object):
:param name: The name of this Pet.
:type: str
"""
self._name = name
@property
@@ -147,6 +151,7 @@ class Pet(object):
:param photo_urls: The photo_urls of this Pet.
:type: list[str]
"""
self._photo_urls = photo_urls
@property
@@ -169,6 +174,7 @@ class Pet(object):
:param tags: The tags of this Pet.
:type: list[Tag]
"""
self._tags = tags
@property
@@ -197,6 +203,7 @@ class Pet(object):
"Invalid value for `status`, must be one of {0}"
.format(allowed_values)
)
self._status = status
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class SpecialModelName(object):
@@ -66,6 +67,7 @@ class SpecialModelName(object):
:param special_property_name: The special_property_name of this SpecialModelName.
:type: int
"""
self._special_property_name = special_property_name
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class Tag(object):
@@ -69,6 +70,7 @@ class Tag(object):
:param id: The id of this Tag.
:type: int
"""
self._id = id
@property
@@ -91,6 +93,7 @@ class Tag(object):
:param name: The name of this Tag.
:type: str
"""
self._name = name
def to_dict(self):

View File

@@ -20,6 +20,7 @@ Copyright 2016 SmartBear Software
from pprint import pformat
from six import iteritems
import re
class User(object):
@@ -87,6 +88,7 @@ class User(object):
:param id: The id of this User.
:type: int
"""
self._id = id
@property
@@ -109,6 +111,7 @@ class User(object):
:param username: The username of this User.
:type: str
"""
self._username = username
@property
@@ -131,6 +134,7 @@ class User(object):
:param first_name: The first_name of this User.
:type: str
"""
self._first_name = first_name
@property
@@ -153,6 +157,7 @@ class User(object):
:param last_name: The last_name of this User.
:type: str
"""
self._last_name = last_name
@property
@@ -175,6 +180,7 @@ class User(object):
:param email: The email of this User.
:type: str
"""
self._email = email
@property
@@ -197,6 +203,7 @@ class User(object):
:param password: The password of this User.
:type: str
"""
self._password = password
@property
@@ -219,6 +226,7 @@ class User(object):
:param phone: The phone of this User.
:type: str
"""
self._phone = phone
@property
@@ -241,6 +249,7 @@ class User(object):
:param user_status: The user_status of this User.
:type: int
"""
self._user_status = user_status
def to_dict(self):