From 02daeaf2652383985bc4d31170d8180f58ce1b18 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 18 Sep 2019 23:37:17 -0700 Subject: python codegen with new openapi-generator tool --- .../fatcat_openapi_client/models/work_entity.py | 237 +++++++++++---------- 1 file changed, 119 insertions(+), 118 deletions(-) (limited to 'python_openapi_client/fatcat_openapi_client/models/work_entity.py') diff --git a/python_openapi_client/fatcat_openapi_client/models/work_entity.py b/python_openapi_client/fatcat_openapi_client/models/work_entity.py index 4ddcf7a5..25f81e96 100644 --- a/python_openapi_client/fatcat_openapi_client/models/work_entity.py +++ b/python_openapi_client/fatcat_openapi_client/models/work_entity.py @@ -5,9 +5,9 @@ Fatcat is a scalable, versioned, API-oriented catalog of bibliographic entities and file metadata. # noqa: E501 - OpenAPI spec version: 0.3.1 + The version of the OpenAPI document: 0.3.1 Contact: webservices@archive.org - Generated by: https://github.com/swagger-api/swagger-codegen.git + Generated by: https://openapi-generator.tech """ @@ -18,134 +18,116 @@ import six class WorkEntity(object): - """NOTE: This class is auto generated by the swagger code generator program. + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech Do not edit the class manually. """ """ Attributes: - swagger_types (dict): The key is attribute name + openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ - swagger_types = { - 'edit_extra': 'object', - 'extra': 'object', - 'redirect': 'str', - 'revision': 'str', + openapi_types = { + 'state': 'str', 'ident': 'str', - 'state': 'str' + 'revision': 'str', + 'redirect': 'str', + 'extra': 'dict(str, object)', + 'edit_extra': 'dict(str, object)' } attribute_map = { - 'edit_extra': 'edit_extra', - 'extra': 'extra', - 'redirect': 'redirect', - 'revision': 'revision', + 'state': 'state', 'ident': 'ident', - 'state': 'state' + 'revision': 'revision', + 'redirect': 'redirect', + 'extra': 'extra', + 'edit_extra': 'edit_extra' } - def __init__(self, edit_extra=None, extra=None, redirect=None, revision=None, ident=None, state=None): # noqa: E501 - """WorkEntity - a model defined in Swagger""" # noqa: E501 + def __init__(self, state=None, ident=None, revision=None, redirect=None, extra=None, edit_extra=None): # noqa: E501 + """WorkEntity - a model defined in OpenAPI""" # noqa: E501 - self._edit_extra = None - self._extra = None - self._redirect = None - self._revision = None - self._ident = None self._state = None + self._ident = None + self._revision = None + self._redirect = None + self._extra = None + self._edit_extra = None self.discriminator = None - if edit_extra is not None: - self.edit_extra = edit_extra - if extra is not None: - self.extra = extra - if redirect is not None: - self.redirect = redirect - if revision is not None: - self.revision = revision - if ident is not None: - self.ident = ident if state is not None: self.state = state + if ident is not None: + self.ident = ident + if revision is not None: + self.revision = revision + if redirect is not None: + self.redirect = redirect + if extra is not None: + self.extra = extra + if edit_extra is not None: + self.edit_extra = edit_extra @property - def edit_extra(self): - """Gets the edit_extra of this WorkEntity. # noqa: E501 - - Free-form JSON metadata that will be stored with specific entity edits (eg, creation/update/delete). # noqa: E501 - - :return: The edit_extra of this WorkEntity. # noqa: E501 - :rtype: object - """ - return self._edit_extra - - @edit_extra.setter - def edit_extra(self, edit_extra): - """Sets the edit_extra of this WorkEntity. - - Free-form JSON metadata that will be stored with specific entity edits (eg, creation/update/delete). # noqa: E501 - - :param edit_extra: The edit_extra of this WorkEntity. # noqa: E501 - :type: object - """ - - self._edit_extra = edit_extra - - @property - def extra(self): - """Gets the extra of this WorkEntity. # noqa: E501 + def state(self): + """Gets the state of this WorkEntity. # noqa: E501 - Free-form JSON metadata that will be stored with the other entity metadata. See guide for (unenforced) schema conventions. # noqa: E501 - :return: The extra of this WorkEntity. # noqa: E501 - :rtype: object + :return: The state of this WorkEntity. # noqa: E501 + :rtype: str """ - return self._extra + return self._state - @extra.setter - def extra(self, extra): - """Sets the extra of this WorkEntity. + @state.setter + def state(self, state): + """Sets the state of this WorkEntity. - Free-form JSON metadata that will be stored with the other entity metadata. See guide for (unenforced) schema conventions. # noqa: E501 - :param extra: The extra of this WorkEntity. # noqa: E501 - :type: object + :param state: The state of this WorkEntity. # noqa: E501 + :type: str """ + allowed_values = ["wip", "active", "redirect", "deleted"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) - self._extra = extra + self._state = state @property - def redirect(self): - """Gets the redirect of this WorkEntity. # noqa: E501 + def ident(self): + """Gets the ident of this WorkEntity. # noqa: E501 base32-encoded unique identifier # noqa: E501 - :return: The redirect of this WorkEntity. # noqa: E501 + :return: The ident of this WorkEntity. # noqa: E501 :rtype: str """ - return self._redirect + return self._ident - @redirect.setter - def redirect(self, redirect): - """Sets the redirect of this WorkEntity. + @ident.setter + def ident(self, ident): + """Sets the ident of this WorkEntity. base32-encoded unique identifier # noqa: E501 - :param redirect: The redirect of this WorkEntity. # noqa: E501 + :param ident: The ident of this WorkEntity. # noqa: E501 :type: str """ - if redirect is not None and len(redirect) > 26: - raise ValueError("Invalid value for `redirect`, length must be less than or equal to `26`") # noqa: E501 - if redirect is not None and len(redirect) < 26: - raise ValueError("Invalid value for `redirect`, length must be greater than or equal to `26`") # noqa: E501 - if redirect is not None and not re.search('[a-zA-Z2-7]{26}', redirect): # noqa: E501 - raise ValueError("Invalid value for `redirect`, must be a follow pattern or equal to `/[a-zA-Z2-7]{26}/`") # noqa: E501 + if ident is not None and len(ident) > 26: + raise ValueError("Invalid value for `ident`, length must be less than or equal to `26`") # noqa: E501 + if ident is not None and len(ident) < 26: + raise ValueError("Invalid value for `ident`, length must be greater than or equal to `26`") # noqa: E501 + if ident is not None and not re.search(r'[a-zA-Z2-7]{26}', ident): # noqa: E501 + raise ValueError(r"Invalid value for `ident`, must be a follow pattern or equal to `/[a-zA-Z2-7]{26}/`") # noqa: E501 - self._redirect = redirect + self._ident = ident @property def revision(self): @@ -171,72 +153,91 @@ class WorkEntity(object): raise ValueError("Invalid value for `revision`, length must be less than or equal to `36`") # noqa: E501 if revision is not None and len(revision) < 36: raise ValueError("Invalid value for `revision`, length must be greater than or equal to `36`") # noqa: E501 - if revision is not None and not re.search('[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', revision): # noqa: E501 - raise ValueError("Invalid value for `revision`, must be a follow pattern or equal to `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`") # noqa: E501 + if revision is not None and not re.search(r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', revision): # noqa: E501 + raise ValueError(r"Invalid value for `revision`, must be a follow pattern or equal to `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`") # noqa: E501 self._revision = revision @property - def ident(self): - """Gets the ident of this WorkEntity. # noqa: E501 + def redirect(self): + """Gets the redirect of this WorkEntity. # noqa: E501 base32-encoded unique identifier # noqa: E501 - :return: The ident of this WorkEntity. # noqa: E501 + :return: The redirect of this WorkEntity. # noqa: E501 :rtype: str """ - return self._ident + return self._redirect - @ident.setter - def ident(self, ident): - """Sets the ident of this WorkEntity. + @redirect.setter + def redirect(self, redirect): + """Sets the redirect of this WorkEntity. base32-encoded unique identifier # noqa: E501 - :param ident: The ident of this WorkEntity. # noqa: E501 + :param redirect: The redirect of this WorkEntity. # noqa: E501 :type: str """ - if ident is not None and len(ident) > 26: - raise ValueError("Invalid value for `ident`, length must be less than or equal to `26`") # noqa: E501 - if ident is not None and len(ident) < 26: - raise ValueError("Invalid value for `ident`, length must be greater than or equal to `26`") # noqa: E501 - if ident is not None and not re.search('[a-zA-Z2-7]{26}', ident): # noqa: E501 - raise ValueError("Invalid value for `ident`, must be a follow pattern or equal to `/[a-zA-Z2-7]{26}/`") # noqa: E501 + if redirect is not None and len(redirect) > 26: + raise ValueError("Invalid value for `redirect`, length must be less than or equal to `26`") # noqa: E501 + if redirect is not None and len(redirect) < 26: + raise ValueError("Invalid value for `redirect`, length must be greater than or equal to `26`") # noqa: E501 + if redirect is not None and not re.search(r'[a-zA-Z2-7]{26}', redirect): # noqa: E501 + raise ValueError(r"Invalid value for `redirect`, must be a follow pattern or equal to `/[a-zA-Z2-7]{26}/`") # noqa: E501 - self._ident = ident + self._redirect = redirect @property - def state(self): - """Gets the state of this WorkEntity. # noqa: E501 + def extra(self): + """Gets the extra of this WorkEntity. # noqa: E501 + Free-form JSON metadata that will be stored with the other entity metadata. See guide for (unenforced) schema conventions. # noqa: E501 - :return: The state of this WorkEntity. # noqa: E501 - :rtype: str + :return: The extra of this WorkEntity. # noqa: E501 + :rtype: dict(str, object) """ - return self._state + return self._extra - @state.setter - def state(self, state): - """Sets the state of this WorkEntity. + @extra.setter + def extra(self, extra): + """Sets the extra of this WorkEntity. + Free-form JSON metadata that will be stored with the other entity metadata. See guide for (unenforced) schema conventions. # noqa: E501 - :param state: The state of this WorkEntity. # noqa: E501 - :type: str + :param extra: The extra of this WorkEntity. # noqa: E501 + :type: dict(str, object) """ - allowed_values = ["wip", "active", "redirect", "deleted"] # noqa: E501 - if state not in allowed_values: - raise ValueError( - "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 - .format(state, allowed_values) - ) - self._state = state + self._extra = extra + + @property + def edit_extra(self): + """Gets the edit_extra of this WorkEntity. # noqa: E501 + + Free-form JSON metadata that will be stored with specific entity edits (eg, creation/update/delete). # noqa: E501 + + :return: The edit_extra of this WorkEntity. # noqa: E501 + :rtype: dict(str, object) + """ + return self._edit_extra + + @edit_extra.setter + def edit_extra(self, edit_extra): + """Sets the edit_extra of this WorkEntity. + + Free-form JSON metadata that will be stored with specific entity edits (eg, creation/update/delete). # noqa: E501 + + :param edit_extra: The edit_extra of this WorkEntity. # noqa: E501 + :type: dict(str, object) + """ + + self._edit_extra = edit_extra def to_dict(self): """Returns the model properties as a dict""" result = {} - for attr, _ in six.iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( -- cgit v1.2.3