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 --- .../models/container_entity.py | 401 +++++++++++---------- 1 file changed, 201 insertions(+), 200 deletions(-) (limited to 'python_openapi_client/fatcat_openapi_client/models/container_entity.py') diff --git a/python_openapi_client/fatcat_openapi_client/models/container_entity.py b/python_openapi_client/fatcat_openapi_client/models/container_entity.py index d44fd744..470f2ee0 100644 --- a/python_openapi_client/fatcat_openapi_client/models/container_entity.py +++ b/python_openapi_client/fatcat_openapi_client/models/container_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,203 +18,222 @@ import six class ContainerEntity(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 = { - 'wikidata_qid': 'str', - 'issnl': 'str', - 'publisher': 'str', - 'container_type': 'str', - 'name': 'str', - '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)', + 'name': 'str', + 'container_type': 'str', + 'publisher': 'str', + 'issnl': 'str', + 'wikidata_qid': 'str' } attribute_map = { - 'wikidata_qid': 'wikidata_qid', - 'issnl': 'issnl', - 'publisher': 'publisher', - 'container_type': 'container_type', - 'name': 'name', - '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', + 'name': 'name', + 'container_type': 'container_type', + 'publisher': 'publisher', + 'issnl': 'issnl', + 'wikidata_qid': 'wikidata_qid' } - def __init__(self, wikidata_qid=None, issnl=None, publisher=None, container_type=None, name=None, edit_extra=None, extra=None, redirect=None, revision=None, ident=None, state=None): # noqa: E501 - """ContainerEntity - a model defined in Swagger""" # noqa: E501 + def __init__(self, state=None, ident=None, revision=None, redirect=None, extra=None, edit_extra=None, name=None, container_type=None, publisher=None, issnl=None, wikidata_qid=None): # noqa: E501 + """ContainerEntity - a model defined in OpenAPI""" # noqa: E501 - self._wikidata_qid = None - self._issnl = None - self._publisher = None - self._container_type = None - self._name = None - 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._name = None + self._container_type = None + self._publisher = None + self._issnl = None + self._wikidata_qid = None self.discriminator = None - if wikidata_qid is not None: - self.wikidata_qid = wikidata_qid - if issnl is not None: - self.issnl = issnl - if publisher is not None: - self.publisher = publisher - if container_type is not None: - self.container_type = container_type - if name is not None: - self.name = name - 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 + if name is not None: + self.name = name + if container_type is not None: + self.container_type = container_type + if publisher is not None: + self.publisher = publisher + if issnl is not None: + self.issnl = issnl + if wikidata_qid is not None: + self.wikidata_qid = wikidata_qid @property - def wikidata_qid(self): - """Gets the wikidata_qid of this ContainerEntity. # noqa: E501 + def state(self): + """Gets the state of this ContainerEntity. # noqa: E501 - :return: The wikidata_qid of this ContainerEntity. # noqa: E501 + :return: The state of this ContainerEntity. # noqa: E501 :rtype: str """ - return self._wikidata_qid + return self._state - @wikidata_qid.setter - def wikidata_qid(self, wikidata_qid): - """Sets the wikidata_qid of this ContainerEntity. + @state.setter + def state(self, state): + """Sets the state of this ContainerEntity. - :param wikidata_qid: The wikidata_qid of this ContainerEntity. # noqa: E501 + :param state: The state of this ContainerEntity. # 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._wikidata_qid = wikidata_qid + self._state = state @property - def issnl(self): - """Gets the issnl of this ContainerEntity. # noqa: E501 + def ident(self): + """Gets the ident of this ContainerEntity. # noqa: E501 - Linking ISSN number (ISSN-L). Should be valid and registered with issn.org # noqa: E501 + base32-encoded unique identifier # noqa: E501 - :return: The issnl of this ContainerEntity. # noqa: E501 + :return: The ident of this ContainerEntity. # noqa: E501 :rtype: str """ - return self._issnl + return self._ident - @issnl.setter - def issnl(self, issnl): - """Sets the issnl of this ContainerEntity. + @ident.setter + def ident(self, ident): + """Sets the ident of this ContainerEntity. - Linking ISSN number (ISSN-L). Should be valid and registered with issn.org # noqa: E501 + base32-encoded unique identifier # noqa: E501 - :param issnl: The issnl of this ContainerEntity. # noqa: E501 + :param ident: The ident of this ContainerEntity. # noqa: E501 :type: str """ - if issnl is not None and len(issnl) > 9: - raise ValueError("Invalid value for `issnl`, length must be less than or equal to `9`") # noqa: E501 - if issnl is not None and len(issnl) < 9: - raise ValueError("Invalid value for `issnl`, length must be greater than or equal to `9`") # noqa: E501 - if issnl is not None and not re.search('\\d{4}-\\d{3}[0-9X]', issnl): # noqa: E501 - raise ValueError("Invalid value for `issnl`, must be a follow pattern or equal to `/\\d{4}-\\d{3}[0-9X]/`") # 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._issnl = issnl + self._ident = ident @property - def publisher(self): - """Gets the publisher of this ContainerEntity. # noqa: E501 + def revision(self): + """Gets the revision of this ContainerEntity. # noqa: E501 - Name of the organization or entity responsible for publication. Not the complete imprint/brand. # noqa: E501 + UUID (lower-case, dash-separated, hex-encoded 128-bit) # noqa: E501 - :return: The publisher of this ContainerEntity. # noqa: E501 + :return: The revision of this ContainerEntity. # noqa: E501 :rtype: str """ - return self._publisher + return self._revision - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this ContainerEntity. + @revision.setter + def revision(self, revision): + """Sets the revision of this ContainerEntity. - Name of the organization or entity responsible for publication. Not the complete imprint/brand. # noqa: E501 + UUID (lower-case, dash-separated, hex-encoded 128-bit) # noqa: E501 - :param publisher: The publisher of this ContainerEntity. # noqa: E501 + :param revision: The revision of this ContainerEntity. # noqa: E501 :type: str """ + if revision is not None and len(revision) > 36: + 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(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._publisher = publisher + self._revision = revision @property - def container_type(self): - """Gets the container_type of this ContainerEntity. # noqa: E501 + def redirect(self): + """Gets the redirect of this ContainerEntity. # noqa: E501 - Type of container, eg 'journal' or 'proceedings'. See Guide for list of valid types. # noqa: E501 + base32-encoded unique identifier # noqa: E501 - :return: The container_type of this ContainerEntity. # noqa: E501 + :return: The redirect of this ContainerEntity. # noqa: E501 :rtype: str """ - return self._container_type + return self._redirect - @container_type.setter - def container_type(self, container_type): - """Sets the container_type of this ContainerEntity. + @redirect.setter + def redirect(self, redirect): + """Sets the redirect of this ContainerEntity. - Type of container, eg 'journal' or 'proceedings'. See Guide for list of valid types. # noqa: E501 + base32-encoded unique identifier # noqa: E501 - :param container_type: The container_type of this ContainerEntity. # noqa: E501 + :param redirect: The redirect of this ContainerEntity. # 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(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._container_type = container_type + self._redirect = redirect @property - def name(self): - """Gets the name of this ContainerEntity. # noqa: E501 + def extra(self): + """Gets the extra of this ContainerEntity. # noqa: E501 - Name of the container (eg, Journal title). Required for entity creation. # 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 name of this ContainerEntity. # noqa: E501 - :rtype: str + :return: The extra of this ContainerEntity. # noqa: E501 + :rtype: dict(str, object) """ - return self._name + return self._extra - @name.setter - def name(self, name): - """Sets the name of this ContainerEntity. + @extra.setter + def extra(self, extra): + """Sets the extra of this ContainerEntity. - Name of the container (eg, Journal title). Required for entity creation. # noqa: E501 + Free-form JSON metadata that will be stored with the other entity metadata. See guide for (unenforced) schema conventions. # noqa: E501 - :param name: The name of this ContainerEntity. # noqa: E501 - :type: str + :param extra: The extra of this ContainerEntity. # noqa: E501 + :type: dict(str, object) """ - self._name = name + self._extra = extra @property def edit_extra(self): @@ -223,7 +242,7 @@ class ContainerEntity(object): Free-form JSON metadata that will be stored with specific entity edits (eg, creation/update/delete). # noqa: E501 :return: The edit_extra of this ContainerEntity. # noqa: E501 - :rtype: object + :rtype: dict(str, object) """ return self._edit_extra @@ -234,153 +253,135 @@ class ContainerEntity(object): 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 ContainerEntity. # noqa: E501 - :type: object + :type: dict(str, object) """ self._edit_extra = edit_extra @property - def extra(self): - """Gets the extra of this ContainerEntity. # noqa: E501 + def name(self): + """Gets the name of this ContainerEntity. # noqa: E501 - Free-form JSON metadata that will be stored with the other entity metadata. See guide for (unenforced) schema conventions. # noqa: E501 + Name of the container (eg, Journal title). Required for entity creation. # noqa: E501 - :return: The extra of this ContainerEntity. # noqa: E501 - :rtype: object + :return: The name of this ContainerEntity. # noqa: E501 + :rtype: str """ - return self._extra + return self._name - @extra.setter - def extra(self, extra): - """Sets the extra of this ContainerEntity. + @name.setter + def name(self, name): + """Sets the name of this ContainerEntity. - Free-form JSON metadata that will be stored with the other entity metadata. See guide for (unenforced) schema conventions. # noqa: E501 + Name of the container (eg, Journal title). Required for entity creation. # noqa: E501 - :param extra: The extra of this ContainerEntity. # noqa: E501 - :type: object + :param name: The name of this ContainerEntity. # noqa: E501 + :type: str """ - self._extra = extra + self._name = name @property - def redirect(self): - """Gets the redirect of this ContainerEntity. # noqa: E501 + def container_type(self): + """Gets the container_type of this ContainerEntity. # noqa: E501 - base32-encoded unique identifier # noqa: E501 + Type of container, eg 'journal' or 'proceedings'. See Guide for list of valid types. # noqa: E501 - :return: The redirect of this ContainerEntity. # noqa: E501 + :return: The container_type of this ContainerEntity. # noqa: E501 :rtype: str """ - return self._redirect + return self._container_type - @redirect.setter - def redirect(self, redirect): - """Sets the redirect of this ContainerEntity. + @container_type.setter + def container_type(self, container_type): + """Sets the container_type of this ContainerEntity. - base32-encoded unique identifier # noqa: E501 + Type of container, eg 'journal' or 'proceedings'. See Guide for list of valid types. # noqa: E501 - :param redirect: The redirect of this ContainerEntity. # noqa: E501 + :param container_type: The container_type of this ContainerEntity. # 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 - self._redirect = redirect + self._container_type = container_type @property - def revision(self): - """Gets the revision of this ContainerEntity. # noqa: E501 + def publisher(self): + """Gets the publisher of this ContainerEntity. # noqa: E501 - UUID (lower-case, dash-separated, hex-encoded 128-bit) # noqa: E501 + Name of the organization or entity responsible for publication. Not the complete imprint/brand. # noqa: E501 - :return: The revision of this ContainerEntity. # noqa: E501 + :return: The publisher of this ContainerEntity. # noqa: E501 :rtype: str """ - return self._revision + return self._publisher - @revision.setter - def revision(self, revision): - """Sets the revision of this ContainerEntity. + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this ContainerEntity. - UUID (lower-case, dash-separated, hex-encoded 128-bit) # noqa: E501 + Name of the organization or entity responsible for publication. Not the complete imprint/brand. # noqa: E501 - :param revision: The revision of this ContainerEntity. # noqa: E501 + :param publisher: The publisher of this ContainerEntity. # noqa: E501 :type: str """ - if revision is not None and len(revision) > 36: - 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 - self._revision = revision + self._publisher = publisher @property - def ident(self): - """Gets the ident of this ContainerEntity. # noqa: E501 + def issnl(self): + """Gets the issnl of this ContainerEntity. # noqa: E501 - base32-encoded unique identifier # noqa: E501 + Linking ISSN number (ISSN-L). Should be valid and registered with issn.org # noqa: E501 - :return: The ident of this ContainerEntity. # noqa: E501 + :return: The issnl of this ContainerEntity. # noqa: E501 :rtype: str """ - return self._ident + return self._issnl - @ident.setter - def ident(self, ident): - """Sets the ident of this ContainerEntity. + @issnl.setter + def issnl(self, issnl): + """Sets the issnl of this ContainerEntity. - base32-encoded unique identifier # noqa: E501 + Linking ISSN number (ISSN-L). Should be valid and registered with issn.org # noqa: E501 - :param ident: The ident of this ContainerEntity. # noqa: E501 + :param issnl: The issnl of this ContainerEntity. # 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 issnl is not None and len(issnl) > 9: + raise ValueError("Invalid value for `issnl`, length must be less than or equal to `9`") # noqa: E501 + if issnl is not None and len(issnl) < 9: + raise ValueError("Invalid value for `issnl`, length must be greater than or equal to `9`") # noqa: E501 + if issnl is not None and not re.search(r'\d{4}-\d{3}[0-9X]', issnl): # noqa: E501 + raise ValueError(r"Invalid value for `issnl`, must be a follow pattern or equal to `/\d{4}-\d{3}[0-9X]/`") # noqa: E501 - self._ident = ident + self._issnl = issnl @property - def state(self): - """Gets the state of this ContainerEntity. # noqa: E501 + def wikidata_qid(self): + """Gets the wikidata_qid of this ContainerEntity. # noqa: E501 - :return: The state of this ContainerEntity. # noqa: E501 + :return: The wikidata_qid of this ContainerEntity. # noqa: E501 :rtype: str """ - return self._state + return self._wikidata_qid - @state.setter - def state(self, state): - """Sets the state of this ContainerEntity. + @wikidata_qid.setter + def wikidata_qid(self, wikidata_qid): + """Sets the wikidata_qid of this ContainerEntity. - :param state: The state of this ContainerEntity. # noqa: E501 + :param wikidata_qid: The wikidata_qid of this ContainerEntity. # 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._state = state + self._wikidata_qid = wikidata_qid 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