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/creator_entity.py | 335 +++++++++++---------- 1 file changed, 168 insertions(+), 167 deletions(-) (limited to 'python_openapi_client/fatcat_openapi_client/models/creator_entity.py') diff --git a/python_openapi_client/fatcat_openapi_client/models/creator_entity.py b/python_openapi_client/fatcat_openapi_client/models/creator_entity.py index 56c19e99..41d00b6e 100644 --- a/python_openapi_client/fatcat_openapi_client/models/creator_entity.py +++ b/python_openapi_client/fatcat_openapi_client/models/creator_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,72 +18,63 @@ import six class CreatorEntity(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', - 'orcid': 'str', - 'surname': 'str', - 'given_name': 'str', - 'display_name': 'str', + openapi_types = { 'state': 'str', 'ident': 'str', 'revision': 'str', 'redirect': 'str', - 'extra': 'object', - 'edit_extra': 'object' + 'extra': 'dict(str, object)', + 'edit_extra': 'dict(str, object)', + 'display_name': 'str', + 'given_name': 'str', + 'surname': 'str', + 'orcid': 'str', + 'wikidata_qid': 'str' } attribute_map = { - 'wikidata_qid': 'wikidata_qid', - 'orcid': 'orcid', - 'surname': 'surname', - 'given_name': 'given_name', - 'display_name': 'display_name', 'state': 'state', 'ident': 'ident', 'revision': 'revision', 'redirect': 'redirect', 'extra': 'extra', - 'edit_extra': 'edit_extra' + 'edit_extra': 'edit_extra', + 'display_name': 'display_name', + 'given_name': 'given_name', + 'surname': 'surname', + 'orcid': 'orcid', + 'wikidata_qid': 'wikidata_qid' } - def __init__(self, wikidata_qid=None, orcid=None, surname=None, given_name=None, display_name=None, state=None, ident=None, revision=None, redirect=None, extra=None, edit_extra=None): # noqa: E501 - """CreatorEntity - a model defined in Swagger""" # noqa: E501 + def __init__(self, state=None, ident=None, revision=None, redirect=None, extra=None, edit_extra=None, display_name=None, given_name=None, surname=None, orcid=None, wikidata_qid=None): # noqa: E501 + """CreatorEntity - a model defined in OpenAPI""" # noqa: E501 - self._wikidata_qid = None - self._orcid = None - self._surname = None - self._given_name = None - self._display_name = None self._state = None self._ident = None self._revision = None self._redirect = None self._extra = None self._edit_extra = None + self._display_name = None + self._given_name = None + self._surname = None + self._orcid = None + self._wikidata_qid = None self.discriminator = None - if wikidata_qid is not None: - self.wikidata_qid = wikidata_qid - if orcid is not None: - self.orcid = orcid - if surname is not None: - self.surname = surname - if given_name is not None: - self.given_name = given_name - if display_name is not None: - self.display_name = display_name if state is not None: self.state = state if ident is not None: @@ -96,127 +87,16 @@ class CreatorEntity(object): self.extra = extra if edit_extra is not None: self.edit_extra = edit_extra - - @property - def wikidata_qid(self): - """Gets the wikidata_qid of this CreatorEntity. # noqa: E501 - - Wikidata entity QID # noqa: E501 - - :return: The wikidata_qid of this CreatorEntity. # noqa: E501 - :rtype: str - """ - return self._wikidata_qid - - @wikidata_qid.setter - def wikidata_qid(self, wikidata_qid): - """Sets the wikidata_qid of this CreatorEntity. - - Wikidata entity QID # noqa: E501 - - :param wikidata_qid: The wikidata_qid of this CreatorEntity. # noqa: E501 - :type: str - """ - - self._wikidata_qid = wikidata_qid - - @property - def orcid(self): - """Gets the orcid of this CreatorEntity. # noqa: E501 - - ORCiD (https://orcid.org) identifier # noqa: E501 - - :return: The orcid of this CreatorEntity. # noqa: E501 - :rtype: str - """ - return self._orcid - - @orcid.setter - def orcid(self, orcid): - """Sets the orcid of this CreatorEntity. - - ORCiD (https://orcid.org) identifier # noqa: E501 - - :param orcid: The orcid of this CreatorEntity. # noqa: E501 - :type: str - """ - if orcid is not None and len(orcid) > 19: - raise ValueError("Invalid value for `orcid`, length must be less than or equal to `19`") # noqa: E501 - if orcid is not None and len(orcid) < 19: - raise ValueError("Invalid value for `orcid`, length must be greater than or equal to `19`") # noqa: E501 - if orcid is not None and not re.search('\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]', orcid): # noqa: E501 - raise ValueError("Invalid value for `orcid`, must be a follow pattern or equal to `/\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]/`") # noqa: E501 - - self._orcid = orcid - - @property - def surname(self): - """Gets the surname of this CreatorEntity. # noqa: E501 - - In English commonly the last, or family name, but ordering is context and culture specific. # noqa: E501 - - :return: The surname of this CreatorEntity. # noqa: E501 - :rtype: str - """ - return self._surname - - @surname.setter - def surname(self, surname): - """Sets the surname of this CreatorEntity. - - In English commonly the last, or family name, but ordering is context and culture specific. # noqa: E501 - - :param surname: The surname of this CreatorEntity. # noqa: E501 - :type: str - """ - - self._surname = surname - - @property - def given_name(self): - """Gets the given_name of this CreatorEntity. # noqa: E501 - - In English commonly the first name, but ordering is context and culture specific. # noqa: E501 - - :return: The given_name of this CreatorEntity. # noqa: E501 - :rtype: str - """ - return self._given_name - - @given_name.setter - def given_name(self, given_name): - """Sets the given_name of this CreatorEntity. - - In English commonly the first name, but ordering is context and culture specific. # noqa: E501 - - :param given_name: The given_name of this CreatorEntity. # noqa: E501 - :type: str - """ - - self._given_name = given_name - - @property - def display_name(self): - """Gets the display_name of this CreatorEntity. # noqa: E501 - - Name as should be displayed in web interface or in author lists (not index/sorted). Required for valid entities. # noqa: E501 - - :return: The display_name of this CreatorEntity. # noqa: E501 - :rtype: str - """ - return self._display_name - - @display_name.setter - def display_name(self, display_name): - """Sets the display_name of this CreatorEntity. - - Name as should be displayed in web interface or in author lists (not index/sorted). Required for valid entities. # noqa: E501 - - :param display_name: The display_name of this CreatorEntity. # noqa: E501 - :type: str - """ - - self._display_name = display_name + if display_name is not None: + self.display_name = display_name + if given_name is not None: + self.given_name = given_name + if surname is not None: + self.surname = surname + if orcid is not None: + self.orcid = orcid + if wikidata_qid is not None: + self.wikidata_qid = wikidata_qid @property def state(self): @@ -269,8 +149,8 @@ class CreatorEntity(object): 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 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._ident = ident @@ -298,8 +178,8 @@ class CreatorEntity(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 @@ -327,8 +207,8 @@ class CreatorEntity(object): 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 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._redirect = redirect @@ -339,7 +219,7 @@ class CreatorEntity(object): 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 CreatorEntity. # noqa: E501 - :rtype: object + :rtype: dict(str, object) """ return self._extra @@ -350,7 +230,7 @@ class CreatorEntity(object): 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 CreatorEntity. # noqa: E501 - :type: object + :type: dict(str, object) """ self._extra = extra @@ -362,7 +242,7 @@ class CreatorEntity(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 CreatorEntity. # noqa: E501 - :rtype: object + :rtype: dict(str, object) """ return self._edit_extra @@ -373,16 +253,137 @@ class CreatorEntity(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 CreatorEntity. # noqa: E501 - :type: object + :type: dict(str, object) """ self._edit_extra = edit_extra + @property + def display_name(self): + """Gets the display_name of this CreatorEntity. # noqa: E501 + + Name as should be displayed in web interface or in author lists (not index/sorted). Required for valid entities. # noqa: E501 + + :return: The display_name of this CreatorEntity. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this CreatorEntity. + + Name as should be displayed in web interface or in author lists (not index/sorted). Required for valid entities. # noqa: E501 + + :param display_name: The display_name of this CreatorEntity. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def given_name(self): + """Gets the given_name of this CreatorEntity. # noqa: E501 + + In English commonly the first name, but ordering is context and culture specific. # noqa: E501 + + :return: The given_name of this CreatorEntity. # noqa: E501 + :rtype: str + """ + return self._given_name + + @given_name.setter + def given_name(self, given_name): + """Sets the given_name of this CreatorEntity. + + In English commonly the first name, but ordering is context and culture specific. # noqa: E501 + + :param given_name: The given_name of this CreatorEntity. # noqa: E501 + :type: str + """ + + self._given_name = given_name + + @property + def surname(self): + """Gets the surname of this CreatorEntity. # noqa: E501 + + In English commonly the last, or family name, but ordering is context and culture specific. # noqa: E501 + + :return: The surname of this CreatorEntity. # noqa: E501 + :rtype: str + """ + return self._surname + + @surname.setter + def surname(self, surname): + """Sets the surname of this CreatorEntity. + + In English commonly the last, or family name, but ordering is context and culture specific. # noqa: E501 + + :param surname: The surname of this CreatorEntity. # noqa: E501 + :type: str + """ + + self._surname = surname + + @property + def orcid(self): + """Gets the orcid of this CreatorEntity. # noqa: E501 + + ORCiD (https://orcid.org) identifier # noqa: E501 + + :return: The orcid of this CreatorEntity. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this CreatorEntity. + + ORCiD (https://orcid.org) identifier # noqa: E501 + + :param orcid: The orcid of this CreatorEntity. # noqa: E501 + :type: str + """ + if orcid is not None and len(orcid) > 19: + raise ValueError("Invalid value for `orcid`, length must be less than or equal to `19`") # noqa: E501 + if orcid is not None and len(orcid) < 19: + raise ValueError("Invalid value for `orcid`, length must be greater than or equal to `19`") # noqa: E501 + if orcid is not None and not re.search(r'\d{4}-\d{4}-\d{4}-\d{3}[\dX]', orcid): # noqa: E501 + raise ValueError(r"Invalid value for `orcid`, must be a follow pattern or equal to `/\d{4}-\d{4}-\d{4}-\d{3}[\dX]/`") # noqa: E501 + + self._orcid = orcid + + @property + def wikidata_qid(self): + """Gets the wikidata_qid of this CreatorEntity. # noqa: E501 + + Wikidata entity QID # noqa: E501 + + :return: The wikidata_qid of this CreatorEntity. # noqa: E501 + :rtype: str + """ + return self._wikidata_qid + + @wikidata_qid.setter + def wikidata_qid(self, wikidata_qid): + """Sets the wikidata_qid of this CreatorEntity. + + Wikidata entity QID # noqa: E501 + + :param wikidata_qid: The wikidata_qid of this CreatorEntity. # noqa: E501 + :type: str + """ + + 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