diff --git a/.jupyter/api_authentication/api/user_endpoint_api.py b/.jupyter/api_authentication/api/user_endpoint_api.py index 40ba9632a02912ec9fd5d6167d27b8b14ebe7760..e6a913e11433557346ee7cab11c9632d90d8bdfd 100644 --- a/.jupyter/api_authentication/api/user_endpoint_api.py +++ b/.jupyter/api_authentication/api/user_endpoint_api.py @@ -231,7 +231,7 @@ class UserEndpointApi(object): >>> result = thread.get() :param async_req bool - :return: list[UserDto] + :return: list[UserBriefDto] If the method is called asynchronously, returns the request thread. """ @@ -251,7 +251,7 @@ class UserEndpointApi(object): >>> result = thread.get() :param async_req bool - :return: list[UserDto] + :return: list[UserBriefDto] If the method is called asynchronously, returns the request thread. """ @@ -289,7 +289,7 @@ class UserEndpointApi(object): ['*/*']) # noqa: E501 # Authentication setting - auth_settings = ['bearerAuth'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/user', 'GET', @@ -299,7 +299,7 @@ class UserEndpointApi(object): body=body_params, post_params=form_params, files=local_var_files, - response_type='list[UserDto]', # noqa: E501 + response_type='list[UserBriefDto]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/.jupyter/api_authentication/models/database_dto.py b/.jupyter/api_authentication/models/database_dto.py index baeaf0e46fa9a534e439e687533e6e6e86300d83..6119a4d801d552d4994ae04eae81b457e5c98622 100644 --- a/.jupyter/api_authentication/models/database_dto.py +++ b/.jupyter/api_authentication/models/database_dto.py @@ -28,322 +28,334 @@ class DatabaseDto(object): and the value is json key in definition. """ swagger_types = { - 'id': 'int', - 'name': 'str', - 'exchange': 'str', - 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', - 'description': 'str', - 'publisher': 'str', - 'contact': 'UserDto', + 'database_id': 'int', + 'database_name': 'str', + 'database_exchange': 'str', + 'database_creator': 'UserBriefDto', + 'database_subjects': 'list[str]', + 'database_language': 'str', + 'database_license': 'LicenseDto', + 'database_description': 'str', + 'database_publisher': 'str', + 'database_contact_person': 'UserDto', 'tables': 'list[TableBriefDto]', - 'image': 'ImageDto', + 'database_container_image': 'ImageDto', 'container': 'ContainerDto', - 'created': 'datetime', + 'database_creation_time': 'datetime', 'deleted': 'datetime', - 'internal_name': 'str', - 'publication_year': 'int', - 'is_public': 'bool' + 'database_internal_name': 'str', + 'database_publication_year': 'int', + 'database_publication_month': 'int', + 'database_publication_day': 'int', + 'database_public': 'bool' } attribute_map = { - 'id': 'id', - 'name': 'name', - 'exchange': 'exchange', - 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', - 'description': 'description', - 'publisher': 'publisher', - 'contact': 'contact', + 'database_id': 'database id', + 'database_name': 'database name', + 'database_exchange': 'database exchange', + 'database_creator': 'database creator', + 'database_subjects': 'database subjects', + 'database_language': 'database language', + 'database_license': 'database license', + 'database_description': 'database description', + 'database_publisher': 'database publisher', + 'database_contact_person': 'database contact person', 'tables': 'tables', - 'image': 'image', + 'database_container_image': 'database container image', 'container': 'container', - 'created': 'created', + 'database_creation_time': 'database creation time', 'deleted': 'deleted', - 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'is_public': 'is_public' + 'database_internal_name': 'database internal name', + 'database_publication_year': 'database publication year', + 'database_publication_month': 'database publication month', + 'database_publication_day': 'database publication day', + 'database_public': 'database public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 + def __init__(self, database_id=None, database_name=None, database_exchange=None, database_creator=None, database_subjects=None, database_language=None, database_license=None, database_description=None, database_publisher=None, database_contact_person=None, tables=None, database_container_image=None, container=None, database_creation_time=None, deleted=None, database_internal_name=None, database_publication_year=None, database_publication_month=None, database_publication_day=None, database_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 - self._id = None - self._name = None - self._exchange = None - self._creator = None - self._subjects = None - self._language = None - self._license = None - self._description = None - self._publisher = None - self._contact = None + self._database_id = None + self._database_name = None + self._database_exchange = None + self._database_creator = None + self._database_subjects = None + self._database_language = None + self._database_license = None + self._database_description = None + self._database_publisher = None + self._database_contact_person = None self._tables = None - self._image = None + self._database_container_image = None self._container = None - self._created = None + self._database_creation_time = None self._deleted = None - self._internal_name = None - self._publication_year = None - self._is_public = None + self._database_internal_name = None + self._database_publication_year = None + self._database_publication_month = None + self._database_publication_day = None + self._database_public = None self.discriminator = None - self.id = id - self.name = name - self.exchange = exchange - self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license - if description is not None: - self.description = description - if publisher is not None: - self.publisher = publisher - if contact is not None: - self.contact = contact + self.database_id = database_id + self.database_name = database_name + self.database_exchange = database_exchange + self.database_creator = database_creator + if database_subjects is not None: + self.database_subjects = database_subjects + if database_language is not None: + self.database_language = database_language + if database_license is not None: + self.database_license = database_license + self.database_description = database_description + if database_publisher is not None: + self.database_publisher = database_publisher + if database_contact_person is not None: + self.database_contact_person = database_contact_person if tables is not None: self.tables = tables - if image is not None: - self.image = image + if database_container_image is not None: + self.database_container_image = database_container_image if container is not None: self.container = container - if created is not None: - self.created = created + if database_creation_time is not None: + self.database_creation_time = database_creation_time if deleted is not None: self.deleted = deleted - self.internal_name = internal_name - self.publication_year = publication_year - if is_public is not None: - self.is_public = is_public + self.database_internal_name = database_internal_name + if database_publication_year is not None: + self.database_publication_year = database_publication_year + if database_publication_month is not None: + self.database_publication_month = database_publication_month + if database_publication_day is not None: + self.database_publication_day = database_publication_day + if database_public is not None: + self.database_public = database_public @property - def id(self): - """Gets the id of this DatabaseDto. # noqa: E501 + def database_id(self): + """Gets the database_id of this DatabaseDto. # noqa: E501 - :return: The id of this DatabaseDto. # noqa: E501 + :return: The database_id of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._id + return self._database_id - @id.setter - def id(self, id): - """Sets the id of this DatabaseDto. + @database_id.setter + def database_id(self, database_id): + """Sets the database_id of this DatabaseDto. - :param id: The id of this DatabaseDto. # noqa: E501 + :param database_id: The database_id of this DatabaseDto. # noqa: E501 :type: int """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + if database_id is None: + raise ValueError("Invalid value for `database_id`, must not be `None`") # noqa: E501 - self._id = id + self._database_id = database_id @property - def name(self): - """Gets the name of this DatabaseDto. # noqa: E501 + def database_name(self): + """Gets the database_name of this DatabaseDto. # noqa: E501 - :return: The name of this DatabaseDto. # noqa: E501 + :return: The database_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._name + return self._database_name - @name.setter - def name(self, name): - """Sets the name of this DatabaseDto. + @database_name.setter + def database_name(self, database_name): + """Sets the database_name of this DatabaseDto. - :param name: The name of this DatabaseDto. # noqa: E501 + :param database_name: The database_name of this DatabaseDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if database_name is None: + raise ValueError("Invalid value for `database_name`, must not be `None`") # noqa: E501 - self._name = name + self._database_name = database_name @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 + def database_exchange(self): + """Gets the database_exchange of this DatabaseDto. # noqa: E501 - :return: The exchange of this DatabaseDto. # noqa: E501 + :return: The database_exchange of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._exchange + return self._database_exchange - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. + @database_exchange.setter + def database_exchange(self, database_exchange): + """Sets the database_exchange of this DatabaseDto. - :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :param database_exchange: The database_exchange of this DatabaseDto. # noqa: E501 :type: str """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + if database_exchange is None: + raise ValueError("Invalid value for `database_exchange`, must not be `None`") # noqa: E501 - self._exchange = exchange + self._database_exchange = database_exchange @property - def creator(self): - """Gets the creator of this DatabaseDto. # noqa: E501 + def database_creator(self): + """Gets the database_creator of this DatabaseDto. # noqa: E501 - :return: The creator of this DatabaseDto. # noqa: E501 + :return: The database_creator of this DatabaseDto. # noqa: E501 :rtype: UserBriefDto """ - return self._creator + return self._database_creator - @creator.setter - def creator(self, creator): - """Sets the creator of this DatabaseDto. + @database_creator.setter + def database_creator(self, database_creator): + """Sets the database_creator of this DatabaseDto. - :param creator: The creator of this DatabaseDto. # noqa: E501 + :param database_creator: The database_creator of this DatabaseDto. # noqa: E501 :type: UserBriefDto """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + if database_creator is None: + raise ValueError("Invalid value for `database_creator`, must not be `None`") # noqa: E501 - self._creator = creator + self._database_creator = database_creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def database_subjects(self): + """Gets the database_subjects of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 + :return: The database_subjects of this DatabaseDto. # noqa: E501 :rtype: list[str] """ - return self._subjects + return self._database_subjects - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @database_subjects.setter + def database_subjects(self, database_subjects): + """Sets the database_subjects of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :param database_subjects: The database_subjects of this DatabaseDto. # noqa: E501 :type: list[str] """ - self._subjects = subjects + self._database_subjects = database_subjects @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 + def database_language(self): + """Gets the database_language of this DatabaseDto. # noqa: E501 - :return: The language of this DatabaseDto. # noqa: E501 + :return: The database_language of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._language + return self._database_language - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. + @database_language.setter + def database_language(self, database_language): + """Sets the database_language of this DatabaseDto. - :param language: The language of this DatabaseDto. # noqa: E501 + :param database_language: The database_language of this DatabaseDto. # noqa: E501 :type: str """ allowed_values = ["ab", "aa", "af", "ak", "sq", "am", "ar", "an", "hy", "as", "av", "ae", "ay", "az", "bm", "ba", "eu", "be", "bn", "bh", "bi", "bs", "br", "bg", "my", "ca", "km", "ch", "ce", "ny", "zh", "cu", "cv", "kw", "co", "cr", "hr", "cs", "da", "dv", "nl", "dz", "en", "eo", "et", "ee", "fo", "fj", "fi", "fr", "ff", "gd", "gl", "lg", "ka", "de", "ki", "el", "kl", "gn", "gu", "ht", "ha", "he", "hz", "hi", "ho", "hu", "is", "io", "ig", "id", "ia", "ie", "iu", "ik", "ga", "it", "ja", "jv", "kn", "kr", "ks", "kk", "rw", "kv", "kg", "ko", "kj", "ku", "ky", "lo", "la", "lv", "lb", "li", "ln", "lt", "lu", "mk", "mg", "ms", "ml", "mt", "gv", "mi", "mr", "mh", "ro", "mn", "na", "nv", "nd", "ng", "ne", "se", "no", "nb", "nn", "ii", "oc", "oj", "or", "om", "os", "pi", "pa", "ps", "fa", "pl", "pt", "qu", "rm", "rn", "ru", "sm", "sg", "sa", "sc", "sr", "sn", "sd", "si", "sk", "sl", "so", "st", "nr", "es", "su", "sw", "ss", "sv", "tl", "ty", "tg", "ta", "tt", "te", "th", "bo", "ti", "to", "ts", "tn", "tr", "tk", "tw", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "cy", "fy", "wo", "xh", "yi", "yo", "za", "zu"] # noqa: E501 - if language not in allowed_values: + if database_language not in allowed_values: raise ValueError( - "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 - .format(language, allowed_values) + "Invalid value for `database_language` ({0}), must be one of {1}" # noqa: E501 + .format(database_language, allowed_values) ) - self._language = language + self._database_language = database_language @property - def license(self): - """Gets the license of this DatabaseDto. # noqa: E501 + def database_license(self): + """Gets the database_license of this DatabaseDto. # noqa: E501 - :return: The license of this DatabaseDto. # noqa: E501 + :return: The database_license of this DatabaseDto. # noqa: E501 :rtype: LicenseDto """ - return self._license + return self._database_license - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. + @database_license.setter + def database_license(self, database_license): + """Sets the database_license of this DatabaseDto. - :param license: The license of this DatabaseDto. # noqa: E501 + :param database_license: The database_license of this DatabaseDto. # noqa: E501 :type: LicenseDto """ - self._license = license + self._database_license = database_license @property - def description(self): - """Gets the description of this DatabaseDto. # noqa: E501 + def database_description(self): + """Gets the database_description of this DatabaseDto. # noqa: E501 - :return: The description of this DatabaseDto. # noqa: E501 + :return: The database_description of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._description + return self._database_description - @description.setter - def description(self, description): - """Sets the description of this DatabaseDto. + @database_description.setter + def database_description(self, database_description): + """Sets the database_description of this DatabaseDto. - :param description: The description of this DatabaseDto. # noqa: E501 + :param database_description: The database_description of this DatabaseDto. # noqa: E501 :type: str """ + if database_description is None: + raise ValueError("Invalid value for `database_description`, must not be `None`") # noqa: E501 - self._description = description + self._database_description = database_description @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 + def database_publisher(self): + """Gets the database_publisher of this DatabaseDto. # noqa: E501 - :return: The publisher of this DatabaseDto. # noqa: E501 + :return: The database_publisher of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._publisher + return self._database_publisher - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. + @database_publisher.setter + def database_publisher(self, database_publisher): + """Sets the database_publisher of this DatabaseDto. - :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :param database_publisher: The database_publisher of this DatabaseDto. # noqa: E501 :type: str """ - self._publisher = publisher + self._database_publisher = database_publisher @property - def contact(self): - """Gets the contact of this DatabaseDto. # noqa: E501 + def database_contact_person(self): + """Gets the database_contact_person of this DatabaseDto. # noqa: E501 - :return: The contact of this DatabaseDto. # noqa: E501 + :return: The database_contact_person of this DatabaseDto. # noqa: E501 :rtype: UserDto """ - return self._contact + return self._database_contact_person - @contact.setter - def contact(self, contact): - """Sets the contact of this DatabaseDto. + @database_contact_person.setter + def database_contact_person(self, database_contact_person): + """Sets the database_contact_person of this DatabaseDto. - :param contact: The contact of this DatabaseDto. # noqa: E501 + :param database_contact_person: The database_contact_person of this DatabaseDto. # noqa: E501 :type: UserDto """ - self._contact = contact + self._database_contact_person = database_contact_person @property def tables(self): @@ -367,25 +379,25 @@ class DatabaseDto(object): self._tables = tables @property - def image(self): - """Gets the image of this DatabaseDto. # noqa: E501 + def database_container_image(self): + """Gets the database_container_image of this DatabaseDto. # noqa: E501 - :return: The image of this DatabaseDto. # noqa: E501 + :return: The database_container_image of this DatabaseDto. # noqa: E501 :rtype: ImageDto """ - return self._image + return self._database_container_image - @image.setter - def image(self, image): - """Sets the image of this DatabaseDto. + @database_container_image.setter + def database_container_image(self, database_container_image): + """Sets the database_container_image of this DatabaseDto. - :param image: The image of this DatabaseDto. # noqa: E501 + :param database_container_image: The database_container_image of this DatabaseDto. # noqa: E501 :type: ImageDto """ - self._image = image + self._database_container_image = database_container_image @property def container(self): @@ -409,25 +421,25 @@ class DatabaseDto(object): self._container = container @property - def created(self): - """Gets the created of this DatabaseDto. # noqa: E501 + def database_creation_time(self): + """Gets the database_creation_time of this DatabaseDto. # noqa: E501 - :return: The created of this DatabaseDto. # noqa: E501 + :return: The database_creation_time of this DatabaseDto. # noqa: E501 :rtype: datetime """ - return self._created + return self._database_creation_time - @created.setter - def created(self, created): - """Sets the created of this DatabaseDto. + @database_creation_time.setter + def database_creation_time(self, database_creation_time): + """Sets the database_creation_time of this DatabaseDto. - :param created: The created of this DatabaseDto. # noqa: E501 + :param database_creation_time: The database_creation_time of this DatabaseDto. # noqa: E501 :type: datetime """ - self._created = created + self._database_creation_time = database_creation_time @property def deleted(self): @@ -451,71 +463,111 @@ class DatabaseDto(object): self._deleted = deleted @property - def internal_name(self): - """Gets the internal_name of this DatabaseDto. # noqa: E501 + def database_internal_name(self): + """Gets the database_internal_name of this DatabaseDto. # noqa: E501 - :return: The internal_name of this DatabaseDto. # noqa: E501 + :return: The database_internal_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._internal_name + return self._database_internal_name - @internal_name.setter - def internal_name(self, internal_name): - """Sets the internal_name of this DatabaseDto. + @database_internal_name.setter + def database_internal_name(self, database_internal_name): + """Sets the database_internal_name of this DatabaseDto. - :param internal_name: The internal_name of this DatabaseDto. # noqa: E501 + :param database_internal_name: The database_internal_name of this DatabaseDto. # noqa: E501 :type: str """ - if internal_name is None: - raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + if database_internal_name is None: + raise ValueError("Invalid value for `database_internal_name`, must not be `None`") # noqa: E501 - self._internal_name = internal_name + self._database_internal_name = database_internal_name @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 + def database_publication_year(self): + """Gets the database_publication_year of this DatabaseDto. # noqa: E501 - :return: The publication_year of this DatabaseDto. # noqa: E501 + :return: The database_publication_year of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._publication_year + return self._database_publication_year - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. + @database_publication_year.setter + def database_publication_year(self, database_publication_year): + """Sets the database_publication_year of this DatabaseDto. - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :param database_publication_year: The database_publication_year of this DatabaseDto. # noqa: E501 :type: int """ - if publication_year is None: - raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - self._publication_year = publication_year + self._database_publication_year = database_publication_year @property - def is_public(self): - """Gets the is_public of this DatabaseDto. # noqa: E501 + def database_publication_month(self): + """Gets the database_publication_month of this DatabaseDto. # noqa: E501 - :return: The is_public of this DatabaseDto. # noqa: E501 + :return: The database_publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_month + + @database_publication_month.setter + def database_publication_month(self, database_publication_month): + """Sets the database_publication_month of this DatabaseDto. + + + :param database_publication_month: The database_publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_month = database_publication_month + + @property + def database_publication_day(self): + """Gets the database_publication_day of this DatabaseDto. # noqa: E501 + + + :return: The database_publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_day + + @database_publication_day.setter + def database_publication_day(self, database_publication_day): + """Sets the database_publication_day of this DatabaseDto. + + + :param database_publication_day: The database_publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_day = database_publication_day + + @property + def database_public(self): + """Gets the database_public of this DatabaseDto. # noqa: E501 + + + :return: The database_public of this DatabaseDto. # noqa: E501 :rtype: bool """ - return self._is_public + return self._database_public - @is_public.setter - def is_public(self, is_public): - """Sets the is_public of this DatabaseDto. + @database_public.setter + def database_public(self, database_public): + """Sets the database_public of this DatabaseDto. - :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :param database_public: The database_public of this DatabaseDto. # noqa: E501 :type: bool """ - self._is_public = is_public + self._database_public = database_public def to_dict(self): """Returns the model properties as a dict""" diff --git a/.jupyter/api_container/models/database_dto.py b/.jupyter/api_container/models/database_dto.py index 0aa1b92b3db1bf2fd768ccff07f61361a4a56f21..95e967060fc4db7b769e9d3d3ebf7b6d63e22997 100644 --- a/.jupyter/api_container/models/database_dto.py +++ b/.jupyter/api_container/models/database_dto.py @@ -28,322 +28,334 @@ class DatabaseDto(object): and the value is json key in definition. """ swagger_types = { - 'id': 'int', - 'name': 'str', - 'exchange': 'str', - 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', - 'description': 'str', - 'publisher': 'str', - 'contact': 'UserDto', + 'database_id': 'int', + 'database_name': 'str', + 'database_exchange': 'str', + 'database_creator': 'UserBriefDto', + 'database_subjects': 'list[str]', + 'database_language': 'str', + 'database_license': 'LicenseDto', + 'database_description': 'str', + 'database_publisher': 'str', + 'database_contact_person': 'UserDto', 'tables': 'list[TableBriefDto]', - 'image': 'ImageDto', + 'database_container_image': 'ImageDto', 'container': 'ContainerDto', - 'created': 'datetime', + 'database_creation_time': 'datetime', 'deleted': 'datetime', - 'internal_name': 'str', - 'publication_year': 'int', - 'is_public': 'bool' + 'database_internal_name': 'str', + 'database_publication_year': 'int', + 'database_publication_month': 'int', + 'database_publication_day': 'int', + 'database_public': 'bool' } attribute_map = { - 'id': 'id', - 'name': 'name', - 'exchange': 'exchange', - 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', - 'description': 'description', - 'publisher': 'publisher', - 'contact': 'contact', + 'database_id': 'database id', + 'database_name': 'database name', + 'database_exchange': 'database exchange', + 'database_creator': 'database creator', + 'database_subjects': 'database subjects', + 'database_language': 'database language', + 'database_license': 'database license', + 'database_description': 'database description', + 'database_publisher': 'database publisher', + 'database_contact_person': 'database contact person', 'tables': 'tables', - 'image': 'image', + 'database_container_image': 'database container image', 'container': 'container', - 'created': 'created', + 'database_creation_time': 'database creation time', 'deleted': 'deleted', - 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'is_public': 'is_public' + 'database_internal_name': 'database internal name', + 'database_publication_year': 'database publication year', + 'database_publication_month': 'database publication month', + 'database_publication_day': 'database publication day', + 'database_public': 'database public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 + def __init__(self, database_id=None, database_name=None, database_exchange=None, database_creator=None, database_subjects=None, database_language=None, database_license=None, database_description=None, database_publisher=None, database_contact_person=None, tables=None, database_container_image=None, container=None, database_creation_time=None, deleted=None, database_internal_name=None, database_publication_year=None, database_publication_month=None, database_publication_day=None, database_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 - self._id = None - self._name = None - self._exchange = None - self._creator = None - self._subjects = None - self._language = None - self._license = None - self._description = None - self._publisher = None - self._contact = None + self._database_id = None + self._database_name = None + self._database_exchange = None + self._database_creator = None + self._database_subjects = None + self._database_language = None + self._database_license = None + self._database_description = None + self._database_publisher = None + self._database_contact_person = None self._tables = None - self._image = None + self._database_container_image = None self._container = None - self._created = None + self._database_creation_time = None self._deleted = None - self._internal_name = None - self._publication_year = None - self._is_public = None + self._database_internal_name = None + self._database_publication_year = None + self._database_publication_month = None + self._database_publication_day = None + self._database_public = None self.discriminator = None - self.id = id - self.name = name - self.exchange = exchange - self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license - if description is not None: - self.description = description - if publisher is not None: - self.publisher = publisher - if contact is not None: - self.contact = contact + self.database_id = database_id + self.database_name = database_name + self.database_exchange = database_exchange + self.database_creator = database_creator + if database_subjects is not None: + self.database_subjects = database_subjects + if database_language is not None: + self.database_language = database_language + if database_license is not None: + self.database_license = database_license + self.database_description = database_description + if database_publisher is not None: + self.database_publisher = database_publisher + if database_contact_person is not None: + self.database_contact_person = database_contact_person if tables is not None: self.tables = tables - if image is not None: - self.image = image + if database_container_image is not None: + self.database_container_image = database_container_image if container is not None: self.container = container - if created is not None: - self.created = created + if database_creation_time is not None: + self.database_creation_time = database_creation_time if deleted is not None: self.deleted = deleted - self.internal_name = internal_name - self.publication_year = publication_year - if is_public is not None: - self.is_public = is_public + self.database_internal_name = database_internal_name + if database_publication_year is not None: + self.database_publication_year = database_publication_year + if database_publication_month is not None: + self.database_publication_month = database_publication_month + if database_publication_day is not None: + self.database_publication_day = database_publication_day + if database_public is not None: + self.database_public = database_public @property - def id(self): - """Gets the id of this DatabaseDto. # noqa: E501 + def database_id(self): + """Gets the database_id of this DatabaseDto. # noqa: E501 - :return: The id of this DatabaseDto. # noqa: E501 + :return: The database_id of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._id + return self._database_id - @id.setter - def id(self, id): - """Sets the id of this DatabaseDto. + @database_id.setter + def database_id(self, database_id): + """Sets the database_id of this DatabaseDto. - :param id: The id of this DatabaseDto. # noqa: E501 + :param database_id: The database_id of this DatabaseDto. # noqa: E501 :type: int """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + if database_id is None: + raise ValueError("Invalid value for `database_id`, must not be `None`") # noqa: E501 - self._id = id + self._database_id = database_id @property - def name(self): - """Gets the name of this DatabaseDto. # noqa: E501 + def database_name(self): + """Gets the database_name of this DatabaseDto. # noqa: E501 - :return: The name of this DatabaseDto. # noqa: E501 + :return: The database_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._name + return self._database_name - @name.setter - def name(self, name): - """Sets the name of this DatabaseDto. + @database_name.setter + def database_name(self, database_name): + """Sets the database_name of this DatabaseDto. - :param name: The name of this DatabaseDto. # noqa: E501 + :param database_name: The database_name of this DatabaseDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if database_name is None: + raise ValueError("Invalid value for `database_name`, must not be `None`") # noqa: E501 - self._name = name + self._database_name = database_name @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 + def database_exchange(self): + """Gets the database_exchange of this DatabaseDto. # noqa: E501 - :return: The exchange of this DatabaseDto. # noqa: E501 + :return: The database_exchange of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._exchange + return self._database_exchange - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. + @database_exchange.setter + def database_exchange(self, database_exchange): + """Sets the database_exchange of this DatabaseDto. - :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :param database_exchange: The database_exchange of this DatabaseDto. # noqa: E501 :type: str """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + if database_exchange is None: + raise ValueError("Invalid value for `database_exchange`, must not be `None`") # noqa: E501 - self._exchange = exchange + self._database_exchange = database_exchange @property - def creator(self): - """Gets the creator of this DatabaseDto. # noqa: E501 + def database_creator(self): + """Gets the database_creator of this DatabaseDto. # noqa: E501 - :return: The creator of this DatabaseDto. # noqa: E501 + :return: The database_creator of this DatabaseDto. # noqa: E501 :rtype: UserBriefDto """ - return self._creator + return self._database_creator - @creator.setter - def creator(self, creator): - """Sets the creator of this DatabaseDto. + @database_creator.setter + def database_creator(self, database_creator): + """Sets the database_creator of this DatabaseDto. - :param creator: The creator of this DatabaseDto. # noqa: E501 + :param database_creator: The database_creator of this DatabaseDto. # noqa: E501 :type: UserBriefDto """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + if database_creator is None: + raise ValueError("Invalid value for `database_creator`, must not be `None`") # noqa: E501 - self._creator = creator + self._database_creator = database_creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def database_subjects(self): + """Gets the database_subjects of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 + :return: The database_subjects of this DatabaseDto. # noqa: E501 :rtype: list[str] """ - return self._subjects + return self._database_subjects - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @database_subjects.setter + def database_subjects(self, database_subjects): + """Sets the database_subjects of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :param database_subjects: The database_subjects of this DatabaseDto. # noqa: E501 :type: list[str] """ - self._subjects = subjects + self._database_subjects = database_subjects @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 + def database_language(self): + """Gets the database_language of this DatabaseDto. # noqa: E501 - :return: The language of this DatabaseDto. # noqa: E501 + :return: The database_language of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._language + return self._database_language - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. + @database_language.setter + def database_language(self, database_language): + """Sets the database_language of this DatabaseDto. - :param language: The language of this DatabaseDto. # noqa: E501 + :param database_language: The database_language of this DatabaseDto. # noqa: E501 :type: str """ allowed_values = ["ab", "aa", "af", "ak", "sq", "am", "ar", "an", "hy", "as", "av", "ae", "ay", "az", "bm", "ba", "eu", "be", "bn", "bh", "bi", "bs", "br", "bg", "my", "ca", "km", "ch", "ce", "ny", "zh", "cu", "cv", "kw", "co", "cr", "hr", "cs", "da", "dv", "nl", "dz", "en", "eo", "et", "ee", "fo", "fj", "fi", "fr", "ff", "gd", "gl", "lg", "ka", "de", "ki", "el", "kl", "gn", "gu", "ht", "ha", "he", "hz", "hi", "ho", "hu", "is", "io", "ig", "id", "ia", "ie", "iu", "ik", "ga", "it", "ja", "jv", "kn", "kr", "ks", "kk", "rw", "kv", "kg", "ko", "kj", "ku", "ky", "lo", "la", "lv", "lb", "li", "ln", "lt", "lu", "mk", "mg", "ms", "ml", "mt", "gv", "mi", "mr", "mh", "ro", "mn", "na", "nv", "nd", "ng", "ne", "se", "no", "nb", "nn", "ii", "oc", "oj", "or", "om", "os", "pi", "pa", "ps", "fa", "pl", "pt", "qu", "rm", "rn", "ru", "sm", "sg", "sa", "sc", "sr", "sn", "sd", "si", "sk", "sl", "so", "st", "nr", "es", "su", "sw", "ss", "sv", "tl", "ty", "tg", "ta", "tt", "te", "th", "bo", "ti", "to", "ts", "tn", "tr", "tk", "tw", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "cy", "fy", "wo", "xh", "yi", "yo", "za", "zu"] # noqa: E501 - if language not in allowed_values: + if database_language not in allowed_values: raise ValueError( - "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 - .format(language, allowed_values) + "Invalid value for `database_language` ({0}), must be one of {1}" # noqa: E501 + .format(database_language, allowed_values) ) - self._language = language + self._database_language = database_language @property - def license(self): - """Gets the license of this DatabaseDto. # noqa: E501 + def database_license(self): + """Gets the database_license of this DatabaseDto. # noqa: E501 - :return: The license of this DatabaseDto. # noqa: E501 + :return: The database_license of this DatabaseDto. # noqa: E501 :rtype: LicenseDto """ - return self._license + return self._database_license - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. + @database_license.setter + def database_license(self, database_license): + """Sets the database_license of this DatabaseDto. - :param license: The license of this DatabaseDto. # noqa: E501 + :param database_license: The database_license of this DatabaseDto. # noqa: E501 :type: LicenseDto """ - self._license = license + self._database_license = database_license @property - def description(self): - """Gets the description of this DatabaseDto. # noqa: E501 + def database_description(self): + """Gets the database_description of this DatabaseDto. # noqa: E501 - :return: The description of this DatabaseDto. # noqa: E501 + :return: The database_description of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._description + return self._database_description - @description.setter - def description(self, description): - """Sets the description of this DatabaseDto. + @database_description.setter + def database_description(self, database_description): + """Sets the database_description of this DatabaseDto. - :param description: The description of this DatabaseDto. # noqa: E501 + :param database_description: The database_description of this DatabaseDto. # noqa: E501 :type: str """ + if database_description is None: + raise ValueError("Invalid value for `database_description`, must not be `None`") # noqa: E501 - self._description = description + self._database_description = database_description @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 + def database_publisher(self): + """Gets the database_publisher of this DatabaseDto. # noqa: E501 - :return: The publisher of this DatabaseDto. # noqa: E501 + :return: The database_publisher of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._publisher + return self._database_publisher - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. + @database_publisher.setter + def database_publisher(self, database_publisher): + """Sets the database_publisher of this DatabaseDto. - :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :param database_publisher: The database_publisher of this DatabaseDto. # noqa: E501 :type: str """ - self._publisher = publisher + self._database_publisher = database_publisher @property - def contact(self): - """Gets the contact of this DatabaseDto. # noqa: E501 + def database_contact_person(self): + """Gets the database_contact_person of this DatabaseDto. # noqa: E501 - :return: The contact of this DatabaseDto. # noqa: E501 + :return: The database_contact_person of this DatabaseDto. # noqa: E501 :rtype: UserDto """ - return self._contact + return self._database_contact_person - @contact.setter - def contact(self, contact): - """Sets the contact of this DatabaseDto. + @database_contact_person.setter + def database_contact_person(self, database_contact_person): + """Sets the database_contact_person of this DatabaseDto. - :param contact: The contact of this DatabaseDto. # noqa: E501 + :param database_contact_person: The database_contact_person of this DatabaseDto. # noqa: E501 :type: UserDto """ - self._contact = contact + self._database_contact_person = database_contact_person @property def tables(self): @@ -367,25 +379,25 @@ class DatabaseDto(object): self._tables = tables @property - def image(self): - """Gets the image of this DatabaseDto. # noqa: E501 + def database_container_image(self): + """Gets the database_container_image of this DatabaseDto. # noqa: E501 - :return: The image of this DatabaseDto. # noqa: E501 + :return: The database_container_image of this DatabaseDto. # noqa: E501 :rtype: ImageDto """ - return self._image + return self._database_container_image - @image.setter - def image(self, image): - """Sets the image of this DatabaseDto. + @database_container_image.setter + def database_container_image(self, database_container_image): + """Sets the database_container_image of this DatabaseDto. - :param image: The image of this DatabaseDto. # noqa: E501 + :param database_container_image: The database_container_image of this DatabaseDto. # noqa: E501 :type: ImageDto """ - self._image = image + self._database_container_image = database_container_image @property def container(self): @@ -409,25 +421,25 @@ class DatabaseDto(object): self._container = container @property - def created(self): - """Gets the created of this DatabaseDto. # noqa: E501 + def database_creation_time(self): + """Gets the database_creation_time of this DatabaseDto. # noqa: E501 - :return: The created of this DatabaseDto. # noqa: E501 + :return: The database_creation_time of this DatabaseDto. # noqa: E501 :rtype: datetime """ - return self._created + return self._database_creation_time - @created.setter - def created(self, created): - """Sets the created of this DatabaseDto. + @database_creation_time.setter + def database_creation_time(self, database_creation_time): + """Sets the database_creation_time of this DatabaseDto. - :param created: The created of this DatabaseDto. # noqa: E501 + :param database_creation_time: The database_creation_time of this DatabaseDto. # noqa: E501 :type: datetime """ - self._created = created + self._database_creation_time = database_creation_time @property def deleted(self): @@ -451,71 +463,111 @@ class DatabaseDto(object): self._deleted = deleted @property - def internal_name(self): - """Gets the internal_name of this DatabaseDto. # noqa: E501 + def database_internal_name(self): + """Gets the database_internal_name of this DatabaseDto. # noqa: E501 - :return: The internal_name of this DatabaseDto. # noqa: E501 + :return: The database_internal_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._internal_name + return self._database_internal_name - @internal_name.setter - def internal_name(self, internal_name): - """Sets the internal_name of this DatabaseDto. + @database_internal_name.setter + def database_internal_name(self, database_internal_name): + """Sets the database_internal_name of this DatabaseDto. - :param internal_name: The internal_name of this DatabaseDto. # noqa: E501 + :param database_internal_name: The database_internal_name of this DatabaseDto. # noqa: E501 :type: str """ - if internal_name is None: - raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + if database_internal_name is None: + raise ValueError("Invalid value for `database_internal_name`, must not be `None`") # noqa: E501 - self._internal_name = internal_name + self._database_internal_name = database_internal_name @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 + def database_publication_year(self): + """Gets the database_publication_year of this DatabaseDto. # noqa: E501 - :return: The publication_year of this DatabaseDto. # noqa: E501 + :return: The database_publication_year of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._publication_year + return self._database_publication_year - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. + @database_publication_year.setter + def database_publication_year(self, database_publication_year): + """Sets the database_publication_year of this DatabaseDto. - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :param database_publication_year: The database_publication_year of this DatabaseDto. # noqa: E501 :type: int """ - if publication_year is None: - raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - self._publication_year = publication_year + self._database_publication_year = database_publication_year @property - def is_public(self): - """Gets the is_public of this DatabaseDto. # noqa: E501 + def database_publication_month(self): + """Gets the database_publication_month of this DatabaseDto. # noqa: E501 - :return: The is_public of this DatabaseDto. # noqa: E501 + :return: The database_publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_month + + @database_publication_month.setter + def database_publication_month(self, database_publication_month): + """Sets the database_publication_month of this DatabaseDto. + + + :param database_publication_month: The database_publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_month = database_publication_month + + @property + def database_publication_day(self): + """Gets the database_publication_day of this DatabaseDto. # noqa: E501 + + + :return: The database_publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_day + + @database_publication_day.setter + def database_publication_day(self, database_publication_day): + """Sets the database_publication_day of this DatabaseDto. + + + :param database_publication_day: The database_publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_day = database_publication_day + + @property + def database_public(self): + """Gets the database_public of this DatabaseDto. # noqa: E501 + + + :return: The database_public of this DatabaseDto. # noqa: E501 :rtype: bool """ - return self._is_public + return self._database_public - @is_public.setter - def is_public(self, is_public): - """Sets the is_public of this DatabaseDto. + @database_public.setter + def database_public(self, database_public): + """Sets the database_public of this DatabaseDto. - :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :param database_public: The database_public of this DatabaseDto. # noqa: E501 :type: bool """ - self._is_public = is_public + self._database_public = database_public def to_dict(self): """Returns the model properties as a dict""" diff --git a/.jupyter/api_database/__init__.py b/.jupyter/api_database/__init__.py index 5da8bf97a428a1bc5e19898c594a8cd20c729876..9a42f3144f688a0c9784305f49f763d26606d2b9 100644 --- a/.jupyter/api_database/__init__.py +++ b/.jupyter/api_database/__init__.py @@ -28,6 +28,7 @@ from api_database.models.database_brief_dto import DatabaseBriefDto from api_database.models.database_create_dto import DatabaseCreateDto from api_database.models.database_dto import DatabaseDto from api_database.models.database_modify_dto import DatabaseModifyDto +from api_database.models.database_transfer_dto import DatabaseTransferDto from api_database.models.granted_authority_dto import GrantedAuthorityDto from api_database.models.image_brief_dto import ImageBriefDto from api_database.models.image_date_dto import ImageDateDto diff --git a/.jupyter/api_database/api/container_database_endpoint_api.py b/.jupyter/api_database/api/container_database_endpoint_api.py index b2740125af65140fc7b27281ca0209c6cca8d271..c05c11e8bbf51f594aa5736b1f4a5abed2d61e3f 100644 --- a/.jupyter/api_database/api/container_database_endpoint_api.py +++ b/.jupyter/api_database/api/container_database_endpoint_api.py @@ -432,6 +432,119 @@ class ContainerDatabaseEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def transfer(self, body, id, database_id, **kwargs): # noqa: E501 + """Update database # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.transfer(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseTransferDto body: (required) + :param int id: (required) + :param int database_id: (required) + :return: DatabaseDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.transfer_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.transfer_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + return data + + def transfer_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 + """Update database # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.transfer_with_http_info(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseTransferDto body: (required) + :param int id: (required) + :param int database_id: (required) + :return: DatabaseDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id', 'database_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method transfer" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `transfer`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `transfer`") # noqa: E501 + # verify the required parameter 'database_id' is set + if ('database_id' not in params or + params['database_id'] is None): + raise ValueError("Missing the required parameter `database_id` when calling `transfer`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'database_id' in params: + path_params['databaseId'] = params['database_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/transfer', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DatabaseDto', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def update(self, body, id, database_id, **kwargs): # noqa: E501 """Update database # noqa: E501 @@ -444,7 +557,7 @@ class ContainerDatabaseEndpointApi(object): :param DatabaseModifyDto body: (required) :param int id: (required) :param int database_id: (required) - :return: DatabaseBriefDto + :return: DatabaseDto If the method is called asynchronously, returns the request thread. """ @@ -467,7 +580,7 @@ class ContainerDatabaseEndpointApi(object): :param DatabaseModifyDto body: (required) :param int id: (required) :param int database_id: (required) - :return: DatabaseBriefDto + :return: DatabaseDto If the method is called asynchronously, returns the request thread. """ @@ -537,7 +650,7 @@ class ContainerDatabaseEndpointApi(object): body=body_params, post_params=form_params, files=local_var_files, - response_type='DatabaseBriefDto', # noqa: E501 + response_type='DatabaseDto', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/.jupyter/api_database/models/__init__.py b/.jupyter/api_database/models/__init__.py index 17ab89a69b0183bc10388c23d898f30aaf44f6be..caa6d6454ea0d69452d82095c5636da19c8ca164 100644 --- a/.jupyter/api_database/models/__init__.py +++ b/.jupyter/api_database/models/__init__.py @@ -21,6 +21,7 @@ from api_database.models.database_brief_dto import DatabaseBriefDto from api_database.models.database_create_dto import DatabaseCreateDto from api_database.models.database_dto import DatabaseDto from api_database.models.database_modify_dto import DatabaseModifyDto +from api_database.models.database_transfer_dto import DatabaseTransferDto from api_database.models.granted_authority_dto import GrantedAuthorityDto from api_database.models.image_brief_dto import ImageBriefDto from api_database.models.image_date_dto import ImageDateDto diff --git a/.jupyter/api_database/models/database_create_dto.py b/.jupyter/api_database/models/database_create_dto.py index a1a6d6bc699759d833b18f43581e7bb96013adc7..abf98982263f239fb5eb2dbe828b874b5e6ef44a 100644 --- a/.jupyter/api_database/models/database_create_dto.py +++ b/.jupyter/api_database/models/database_create_dto.py @@ -29,24 +29,20 @@ class DatabaseCreateDto(object): """ swagger_types = { 'name': 'str', - 'description': 'str', 'is_public': 'bool' } attribute_map = { 'name': 'name', - 'description': 'description', 'is_public': 'is_public' } - def __init__(self, name=None, description=None, is_public=None): # noqa: E501 + def __init__(self, name=None, is_public=None): # noqa: E501 """DatabaseCreateDto - a model defined in Swagger""" # noqa: E501 self._name = None - self._description = None self._is_public = None self.discriminator = None self.name = name - self.description = description self.is_public = is_public @property @@ -72,29 +68,6 @@ class DatabaseCreateDto(object): self._name = name - @property - def description(self): - """Gets the description of this DatabaseCreateDto. # noqa: E501 - - - :return: The description of this DatabaseCreateDto. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this DatabaseCreateDto. - - - :param description: The description of this DatabaseCreateDto. # noqa: E501 - :type: str - """ - if description is None: - raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 - - self._description = description - @property def is_public(self): """Gets the is_public of this DatabaseCreateDto. # noqa: E501 diff --git a/.jupyter/api_database/models/database_dto.py b/.jupyter/api_database/models/database_dto.py index 52e21473a2256ae38d006e121c8080abecc2b7ad..56899bd1051f4bf6440c22f309aae45d1d9c4e3f 100644 --- a/.jupyter/api_database/models/database_dto.py +++ b/.jupyter/api_database/models/database_dto.py @@ -28,322 +28,334 @@ class DatabaseDto(object): and the value is json key in definition. """ swagger_types = { - 'id': 'int', - 'name': 'str', - 'exchange': 'str', - 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', - 'description': 'str', - 'publisher': 'str', - 'contact': 'UserDto', + 'database_id': 'int', + 'database_name': 'str', + 'database_exchange': 'str', + 'database_creator': 'UserBriefDto', + 'database_subjects': 'list[str]', + 'database_language': 'str', + 'database_license': 'LicenseDto', + 'database_description': 'str', + 'database_publisher': 'str', + 'database_contact_person': 'UserDto', 'tables': 'list[TableBriefDto]', - 'image': 'ImageDto', + 'database_container_image': 'ImageDto', 'container': 'ContainerDto', - 'created': 'datetime', + 'database_creation_time': 'datetime', 'deleted': 'datetime', - 'internal_name': 'str', - 'publication_year': 'int', - 'is_public': 'bool' + 'database_internal_name': 'str', + 'database_publication_year': 'int', + 'database_publication_month': 'int', + 'database_publication_day': 'int', + 'database_public': 'bool' } attribute_map = { - 'id': 'id', - 'name': 'name', - 'exchange': 'exchange', - 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', - 'description': 'description', - 'publisher': 'publisher', - 'contact': 'contact', + 'database_id': 'database id', + 'database_name': 'database name', + 'database_exchange': 'database exchange', + 'database_creator': 'database creator', + 'database_subjects': 'database subjects', + 'database_language': 'database language', + 'database_license': 'database license', + 'database_description': 'database description', + 'database_publisher': 'database publisher', + 'database_contact_person': 'database contact person', 'tables': 'tables', - 'image': 'image', + 'database_container_image': 'database container image', 'container': 'container', - 'created': 'created', + 'database_creation_time': 'database creation time', 'deleted': 'deleted', - 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'is_public': 'is_public' + 'database_internal_name': 'database internal name', + 'database_publication_year': 'database publication year', + 'database_publication_month': 'database publication month', + 'database_publication_day': 'database publication day', + 'database_public': 'database public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 + def __init__(self, database_id=None, database_name=None, database_exchange=None, database_creator=None, database_subjects=None, database_language=None, database_license=None, database_description=None, database_publisher=None, database_contact_person=None, tables=None, database_container_image=None, container=None, database_creation_time=None, deleted=None, database_internal_name=None, database_publication_year=None, database_publication_month=None, database_publication_day=None, database_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 - self._id = None - self._name = None - self._exchange = None - self._creator = None - self._subjects = None - self._language = None - self._license = None - self._description = None - self._publisher = None - self._contact = None + self._database_id = None + self._database_name = None + self._database_exchange = None + self._database_creator = None + self._database_subjects = None + self._database_language = None + self._database_license = None + self._database_description = None + self._database_publisher = None + self._database_contact_person = None self._tables = None - self._image = None + self._database_container_image = None self._container = None - self._created = None + self._database_creation_time = None self._deleted = None - self._internal_name = None - self._publication_year = None - self._is_public = None + self._database_internal_name = None + self._database_publication_year = None + self._database_publication_month = None + self._database_publication_day = None + self._database_public = None self.discriminator = None - self.id = id - self.name = name - self.exchange = exchange - self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license - if description is not None: - self.description = description - if publisher is not None: - self.publisher = publisher - if contact is not None: - self.contact = contact + self.database_id = database_id + self.database_name = database_name + self.database_exchange = database_exchange + self.database_creator = database_creator + if database_subjects is not None: + self.database_subjects = database_subjects + if database_language is not None: + self.database_language = database_language + if database_license is not None: + self.database_license = database_license + self.database_description = database_description + if database_publisher is not None: + self.database_publisher = database_publisher + if database_contact_person is not None: + self.database_contact_person = database_contact_person if tables is not None: self.tables = tables - if image is not None: - self.image = image + if database_container_image is not None: + self.database_container_image = database_container_image if container is not None: self.container = container - if created is not None: - self.created = created + if database_creation_time is not None: + self.database_creation_time = database_creation_time if deleted is not None: self.deleted = deleted - self.internal_name = internal_name - self.publication_year = publication_year - if is_public is not None: - self.is_public = is_public + self.database_internal_name = database_internal_name + if database_publication_year is not None: + self.database_publication_year = database_publication_year + if database_publication_month is not None: + self.database_publication_month = database_publication_month + if database_publication_day is not None: + self.database_publication_day = database_publication_day + if database_public is not None: + self.database_public = database_public @property - def id(self): - """Gets the id of this DatabaseDto. # noqa: E501 + def database_id(self): + """Gets the database_id of this DatabaseDto. # noqa: E501 - :return: The id of this DatabaseDto. # noqa: E501 + :return: The database_id of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._id + return self._database_id - @id.setter - def id(self, id): - """Sets the id of this DatabaseDto. + @database_id.setter + def database_id(self, database_id): + """Sets the database_id of this DatabaseDto. - :param id: The id of this DatabaseDto. # noqa: E501 + :param database_id: The database_id of this DatabaseDto. # noqa: E501 :type: int """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + if database_id is None: + raise ValueError("Invalid value for `database_id`, must not be `None`") # noqa: E501 - self._id = id + self._database_id = database_id @property - def name(self): - """Gets the name of this DatabaseDto. # noqa: E501 + def database_name(self): + """Gets the database_name of this DatabaseDto. # noqa: E501 - :return: The name of this DatabaseDto. # noqa: E501 + :return: The database_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._name + return self._database_name - @name.setter - def name(self, name): - """Sets the name of this DatabaseDto. + @database_name.setter + def database_name(self, database_name): + """Sets the database_name of this DatabaseDto. - :param name: The name of this DatabaseDto. # noqa: E501 + :param database_name: The database_name of this DatabaseDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if database_name is None: + raise ValueError("Invalid value for `database_name`, must not be `None`") # noqa: E501 - self._name = name + self._database_name = database_name @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 + def database_exchange(self): + """Gets the database_exchange of this DatabaseDto. # noqa: E501 - :return: The exchange of this DatabaseDto. # noqa: E501 + :return: The database_exchange of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._exchange + return self._database_exchange - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. + @database_exchange.setter + def database_exchange(self, database_exchange): + """Sets the database_exchange of this DatabaseDto. - :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :param database_exchange: The database_exchange of this DatabaseDto. # noqa: E501 :type: str """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + if database_exchange is None: + raise ValueError("Invalid value for `database_exchange`, must not be `None`") # noqa: E501 - self._exchange = exchange + self._database_exchange = database_exchange @property - def creator(self): - """Gets the creator of this DatabaseDto. # noqa: E501 + def database_creator(self): + """Gets the database_creator of this DatabaseDto. # noqa: E501 - :return: The creator of this DatabaseDto. # noqa: E501 + :return: The database_creator of this DatabaseDto. # noqa: E501 :rtype: UserBriefDto """ - return self._creator + return self._database_creator - @creator.setter - def creator(self, creator): - """Sets the creator of this DatabaseDto. + @database_creator.setter + def database_creator(self, database_creator): + """Sets the database_creator of this DatabaseDto. - :param creator: The creator of this DatabaseDto. # noqa: E501 + :param database_creator: The database_creator of this DatabaseDto. # noqa: E501 :type: UserBriefDto """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + if database_creator is None: + raise ValueError("Invalid value for `database_creator`, must not be `None`") # noqa: E501 - self._creator = creator + self._database_creator = database_creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def database_subjects(self): + """Gets the database_subjects of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 + :return: The database_subjects of this DatabaseDto. # noqa: E501 :rtype: list[str] """ - return self._subjects + return self._database_subjects - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @database_subjects.setter + def database_subjects(self, database_subjects): + """Sets the database_subjects of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :param database_subjects: The database_subjects of this DatabaseDto. # noqa: E501 :type: list[str] """ - self._subjects = subjects + self._database_subjects = database_subjects @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 + def database_language(self): + """Gets the database_language of this DatabaseDto. # noqa: E501 - :return: The language of this DatabaseDto. # noqa: E501 + :return: The database_language of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._language + return self._database_language - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. + @database_language.setter + def database_language(self, database_language): + """Sets the database_language of this DatabaseDto. - :param language: The language of this DatabaseDto. # noqa: E501 + :param database_language: The database_language of this DatabaseDto. # noqa: E501 :type: str """ allowed_values = ["ab", "aa", "af", "ak", "sq", "am", "ar", "an", "hy", "as", "av", "ae", "ay", "az", "bm", "ba", "eu", "be", "bn", "bh", "bi", "bs", "br", "bg", "my", "ca", "km", "ch", "ce", "ny", "zh", "cu", "cv", "kw", "co", "cr", "hr", "cs", "da", "dv", "nl", "dz", "en", "eo", "et", "ee", "fo", "fj", "fi", "fr", "ff", "gd", "gl", "lg", "ka", "de", "ki", "el", "kl", "gn", "gu", "ht", "ha", "he", "hz", "hi", "ho", "hu", "is", "io", "ig", "id", "ia", "ie", "iu", "ik", "ga", "it", "ja", "jv", "kn", "kr", "ks", "kk", "rw", "kv", "kg", "ko", "kj", "ku", "ky", "lo", "la", "lv", "lb", "li", "ln", "lt", "lu", "mk", "mg", "ms", "ml", "mt", "gv", "mi", "mr", "mh", "ro", "mn", "na", "nv", "nd", "ng", "ne", "se", "no", "nb", "nn", "ii", "oc", "oj", "or", "om", "os", "pi", "pa", "ps", "fa", "pl", "pt", "qu", "rm", "rn", "ru", "sm", "sg", "sa", "sc", "sr", "sn", "sd", "si", "sk", "sl", "so", "st", "nr", "es", "su", "sw", "ss", "sv", "tl", "ty", "tg", "ta", "tt", "te", "th", "bo", "ti", "to", "ts", "tn", "tr", "tk", "tw", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "cy", "fy", "wo", "xh", "yi", "yo", "za", "zu"] # noqa: E501 - if language not in allowed_values: + if database_language not in allowed_values: raise ValueError( - "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 - .format(language, allowed_values) + "Invalid value for `database_language` ({0}), must be one of {1}" # noqa: E501 + .format(database_language, allowed_values) ) - self._language = language + self._database_language = database_language @property - def license(self): - """Gets the license of this DatabaseDto. # noqa: E501 + def database_license(self): + """Gets the database_license of this DatabaseDto. # noqa: E501 - :return: The license of this DatabaseDto. # noqa: E501 + :return: The database_license of this DatabaseDto. # noqa: E501 :rtype: LicenseDto """ - return self._license + return self._database_license - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. + @database_license.setter + def database_license(self, database_license): + """Sets the database_license of this DatabaseDto. - :param license: The license of this DatabaseDto. # noqa: E501 + :param database_license: The database_license of this DatabaseDto. # noqa: E501 :type: LicenseDto """ - self._license = license + self._database_license = database_license @property - def description(self): - """Gets the description of this DatabaseDto. # noqa: E501 + def database_description(self): + """Gets the database_description of this DatabaseDto. # noqa: E501 - :return: The description of this DatabaseDto. # noqa: E501 + :return: The database_description of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._description + return self._database_description - @description.setter - def description(self, description): - """Sets the description of this DatabaseDto. + @database_description.setter + def database_description(self, database_description): + """Sets the database_description of this DatabaseDto. - :param description: The description of this DatabaseDto. # noqa: E501 + :param database_description: The database_description of this DatabaseDto. # noqa: E501 :type: str """ + if database_description is None: + raise ValueError("Invalid value for `database_description`, must not be `None`") # noqa: E501 - self._description = description + self._database_description = database_description @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 + def database_publisher(self): + """Gets the database_publisher of this DatabaseDto. # noqa: E501 - :return: The publisher of this DatabaseDto. # noqa: E501 + :return: The database_publisher of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._publisher + return self._database_publisher - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. + @database_publisher.setter + def database_publisher(self, database_publisher): + """Sets the database_publisher of this DatabaseDto. - :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :param database_publisher: The database_publisher of this DatabaseDto. # noqa: E501 :type: str """ - self._publisher = publisher + self._database_publisher = database_publisher @property - def contact(self): - """Gets the contact of this DatabaseDto. # noqa: E501 + def database_contact_person(self): + """Gets the database_contact_person of this DatabaseDto. # noqa: E501 - :return: The contact of this DatabaseDto. # noqa: E501 + :return: The database_contact_person of this DatabaseDto. # noqa: E501 :rtype: UserDto """ - return self._contact + return self._database_contact_person - @contact.setter - def contact(self, contact): - """Sets the contact of this DatabaseDto. + @database_contact_person.setter + def database_contact_person(self, database_contact_person): + """Sets the database_contact_person of this DatabaseDto. - :param contact: The contact of this DatabaseDto. # noqa: E501 + :param database_contact_person: The database_contact_person of this DatabaseDto. # noqa: E501 :type: UserDto """ - self._contact = contact + self._database_contact_person = database_contact_person @property def tables(self): @@ -367,25 +379,25 @@ class DatabaseDto(object): self._tables = tables @property - def image(self): - """Gets the image of this DatabaseDto. # noqa: E501 + def database_container_image(self): + """Gets the database_container_image of this DatabaseDto. # noqa: E501 - :return: The image of this DatabaseDto. # noqa: E501 + :return: The database_container_image of this DatabaseDto. # noqa: E501 :rtype: ImageDto """ - return self._image + return self._database_container_image - @image.setter - def image(self, image): - """Sets the image of this DatabaseDto. + @database_container_image.setter + def database_container_image(self, database_container_image): + """Sets the database_container_image of this DatabaseDto. - :param image: The image of this DatabaseDto. # noqa: E501 + :param database_container_image: The database_container_image of this DatabaseDto. # noqa: E501 :type: ImageDto """ - self._image = image + self._database_container_image = database_container_image @property def container(self): @@ -409,25 +421,25 @@ class DatabaseDto(object): self._container = container @property - def created(self): - """Gets the created of this DatabaseDto. # noqa: E501 + def database_creation_time(self): + """Gets the database_creation_time of this DatabaseDto. # noqa: E501 - :return: The created of this DatabaseDto. # noqa: E501 + :return: The database_creation_time of this DatabaseDto. # noqa: E501 :rtype: datetime """ - return self._created + return self._database_creation_time - @created.setter - def created(self, created): - """Sets the created of this DatabaseDto. + @database_creation_time.setter + def database_creation_time(self, database_creation_time): + """Sets the database_creation_time of this DatabaseDto. - :param created: The created of this DatabaseDto. # noqa: E501 + :param database_creation_time: The database_creation_time of this DatabaseDto. # noqa: E501 :type: datetime """ - self._created = created + self._database_creation_time = database_creation_time @property def deleted(self): @@ -451,71 +463,111 @@ class DatabaseDto(object): self._deleted = deleted @property - def internal_name(self): - """Gets the internal_name of this DatabaseDto. # noqa: E501 + def database_internal_name(self): + """Gets the database_internal_name of this DatabaseDto. # noqa: E501 - :return: The internal_name of this DatabaseDto. # noqa: E501 + :return: The database_internal_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._internal_name + return self._database_internal_name - @internal_name.setter - def internal_name(self, internal_name): - """Sets the internal_name of this DatabaseDto. + @database_internal_name.setter + def database_internal_name(self, database_internal_name): + """Sets the database_internal_name of this DatabaseDto. - :param internal_name: The internal_name of this DatabaseDto. # noqa: E501 + :param database_internal_name: The database_internal_name of this DatabaseDto. # noqa: E501 :type: str """ - if internal_name is None: - raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + if database_internal_name is None: + raise ValueError("Invalid value for `database_internal_name`, must not be `None`") # noqa: E501 - self._internal_name = internal_name + self._database_internal_name = database_internal_name @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 + def database_publication_year(self): + """Gets the database_publication_year of this DatabaseDto. # noqa: E501 - :return: The publication_year of this DatabaseDto. # noqa: E501 + :return: The database_publication_year of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._publication_year + return self._database_publication_year - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. + @database_publication_year.setter + def database_publication_year(self, database_publication_year): + """Sets the database_publication_year of this DatabaseDto. - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :param database_publication_year: The database_publication_year of this DatabaseDto. # noqa: E501 :type: int """ - if publication_year is None: - raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - self._publication_year = publication_year + self._database_publication_year = database_publication_year @property - def is_public(self): - """Gets the is_public of this DatabaseDto. # noqa: E501 + def database_publication_month(self): + """Gets the database_publication_month of this DatabaseDto. # noqa: E501 - :return: The is_public of this DatabaseDto. # noqa: E501 + :return: The database_publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_month + + @database_publication_month.setter + def database_publication_month(self, database_publication_month): + """Sets the database_publication_month of this DatabaseDto. + + + :param database_publication_month: The database_publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_month = database_publication_month + + @property + def database_publication_day(self): + """Gets the database_publication_day of this DatabaseDto. # noqa: E501 + + + :return: The database_publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_day + + @database_publication_day.setter + def database_publication_day(self, database_publication_day): + """Sets the database_publication_day of this DatabaseDto. + + + :param database_publication_day: The database_publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_day = database_publication_day + + @property + def database_public(self): + """Gets the database_public of this DatabaseDto. # noqa: E501 + + + :return: The database_public of this DatabaseDto. # noqa: E501 :rtype: bool """ - return self._is_public + return self._database_public - @is_public.setter - def is_public(self, is_public): - """Sets the is_public of this DatabaseDto. + @database_public.setter + def database_public(self, database_public): + """Sets the database_public of this DatabaseDto. - :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :param database_public: The database_public of this DatabaseDto. # noqa: E501 :type: bool """ - self._is_public = is_public + self._database_public = database_public def to_dict(self): """Returns the model properties as a dict""" diff --git a/.jupyter/api_database/models/database_modify_dto.py b/.jupyter/api_database/models/database_modify_dto.py index f61145aa15e81aaf865f5b7d13e37deb8d1a2386..1e74ccca7b8e024459bd90b76f71f87724fc23c4 100644 --- a/.jupyter/api_database/models/database_modify_dto.py +++ b/.jupyter/api_database/models/database_modify_dto.py @@ -28,40 +28,43 @@ class DatabaseModifyDto(object): and the value is json key in definition. """ swagger_types = { - 'subject': 'list[str]', + 'subjects': 'list[str]', 'description': 'str', 'publisher': 'str', 'license': 'LicenseDto', 'language': 'str', - 'is_public': 'bool', - 'publication_year': 'int', + 'database_publication_year': 'int', + 'publication_month': 'int', + 'publication_day': 'int', 'contact_person': 'str' } attribute_map = { - 'subject': 'subject', + 'subjects': 'subjects', 'description': 'description', 'publisher': 'publisher', 'license': 'license', 'language': 'language', - 'is_public': 'is_public', - 'publication_year': 'publication_year', + 'database_publication_year': 'database publication year', + 'publication_month': 'publication_month', + 'publication_day': 'publication_day', 'contact_person': 'contact_person' } - def __init__(self, subject=None, description=None, publisher=None, license=None, language=None, is_public=None, publication_year=None, contact_person=None): # noqa: E501 + def __init__(self, subjects=None, description=None, publisher=None, license=None, language=None, database_publication_year=None, publication_month=None, publication_day=None, contact_person=None): # noqa: E501 """DatabaseModifyDto - a model defined in Swagger""" # noqa: E501 - self._subject = None + self._subjects = None self._description = None self._publisher = None self._license = None self._language = None - self._is_public = None - self._publication_year = None + self._database_publication_year = None + self._publication_month = None + self._publication_day = None self._contact_person = None self.discriminator = None - if subject is not None: - self.subject = subject + if subjects is not None: + self.subjects = subjects self.description = description if publisher is not None: self.publisher = publisher @@ -69,31 +72,34 @@ class DatabaseModifyDto(object): self.license = license if language is not None: self.language = language - self.is_public = is_public - self.publication_year = publication_year + self.database_publication_year = database_publication_year + if publication_month is not None: + self.publication_month = publication_month + if publication_day is not None: + self.publication_day = publication_day if contact_person is not None: self.contact_person = contact_person @property - def subject(self): - """Gets the subject of this DatabaseModifyDto. # noqa: E501 + def subjects(self): + """Gets the subjects of this DatabaseModifyDto. # noqa: E501 - :return: The subject of this DatabaseModifyDto. # noqa: E501 + :return: The subjects of this DatabaseModifyDto. # noqa: E501 :rtype: list[str] """ - return self._subject + return self._subjects - @subject.setter - def subject(self, subject): - """Sets the subject of this DatabaseModifyDto. + @subjects.setter + def subjects(self, subjects): + """Sets the subjects of this DatabaseModifyDto. - :param subject: The subject of this DatabaseModifyDto. # noqa: E501 + :param subjects: The subjects of this DatabaseModifyDto. # noqa: E501 :type: list[str] """ - self._subject = subject + self._subjects = subjects @property def description(self): @@ -188,50 +194,69 @@ class DatabaseModifyDto(object): self._language = language @property - def is_public(self): - """Gets the is_public of this DatabaseModifyDto. # noqa: E501 + def database_publication_year(self): + """Gets the database_publication_year of this DatabaseModifyDto. # noqa: E501 - :return: The is_public of this DatabaseModifyDto. # noqa: E501 - :rtype: bool + :return: The database_publication_year of this DatabaseModifyDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_year + + @database_publication_year.setter + def database_publication_year(self, database_publication_year): + """Sets the database_publication_year of this DatabaseModifyDto. + + + :param database_publication_year: The database_publication_year of this DatabaseModifyDto. # noqa: E501 + :type: int + """ + if database_publication_year is None: + raise ValueError("Invalid value for `database_publication_year`, must not be `None`") # noqa: E501 + + self._database_publication_year = database_publication_year + + @property + def publication_month(self): + """Gets the publication_month of this DatabaseModifyDto. # noqa: E501 + + + :return: The publication_month of this DatabaseModifyDto. # noqa: E501 + :rtype: int """ - return self._is_public + return self._publication_month - @is_public.setter - def is_public(self, is_public): - """Sets the is_public of this DatabaseModifyDto. + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this DatabaseModifyDto. - :param is_public: The is_public of this DatabaseModifyDto. # noqa: E501 - :type: bool + :param publication_month: The publication_month of this DatabaseModifyDto. # noqa: E501 + :type: int """ - if is_public is None: - raise ValueError("Invalid value for `is_public`, must not be `None`") # noqa: E501 - self._is_public = is_public + self._publication_month = publication_month @property - def publication_year(self): - """Gets the publication_year of this DatabaseModifyDto. # noqa: E501 + def publication_day(self): + """Gets the publication_day of this DatabaseModifyDto. # noqa: E501 - :return: The publication_year of this DatabaseModifyDto. # noqa: E501 + :return: The publication_day of this DatabaseModifyDto. # noqa: E501 :rtype: int """ - return self._publication_year + return self._publication_day - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseModifyDto. + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this DatabaseModifyDto. - :param publication_year: The publication_year of this DatabaseModifyDto. # noqa: E501 + :param publication_day: The publication_day of this DatabaseModifyDto. # noqa: E501 :type: int """ - if publication_year is None: - raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - self._publication_year = publication_year + self._publication_day = publication_day @property def contact_person(self): diff --git a/.jupyter/api_database/models/database_transfer_dto.py b/.jupyter/api_database/models/database_transfer_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e17937171833a088ef6adc96eca121498f1198cf --- /dev/null +++ b/.jupyter/api_database/models/database_transfer_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Database Repository Database Service API + + Service that manages the databases # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseTransferDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_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 = { + 'is_public': 'bool' + } + + attribute_map = { + 'is_public': 'is_public' + } + + def __init__(self, is_public=None): # noqa: E501 + """DatabaseTransferDto - a model defined in Swagger""" # noqa: E501 + self._is_public = None + self.discriminator = None + self.is_public = is_public + + @property + def is_public(self): + """Gets the is_public of this DatabaseTransferDto. # noqa: E501 + + + :return: The is_public of this DatabaseTransferDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseTransferDto. + + + :param is_public: The is_public of this DatabaseTransferDto. # noqa: E501 + :type: bool + """ + if is_public is None: + raise ValueError("Invalid value for `is_public`, must not be `None`") # noqa: E501 + + self._is_public = is_public + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseTransferDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseTransferDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/.jupyter/api_identifier/models/database_dto.py b/.jupyter/api_identifier/models/database_dto.py index 0648eb80932d6da8f79a6a11478f6ae389edc589..871e9b409172c3bef32a4a93367d0df5579f3fed 100644 --- a/.jupyter/api_identifier/models/database_dto.py +++ b/.jupyter/api_identifier/models/database_dto.py @@ -28,322 +28,334 @@ class DatabaseDto(object): and the value is json key in definition. """ swagger_types = { - 'id': 'int', - 'name': 'str', - 'exchange': 'str', - 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', - 'description': 'str', - 'publisher': 'str', - 'contact': 'UserDto', + 'database_id': 'int', + 'database_name': 'str', + 'database_exchange': 'str', + 'database_creator': 'UserBriefDto', + 'database_subjects': 'list[str]', + 'database_language': 'str', + 'database_license': 'LicenseDto', + 'database_description': 'str', + 'database_publisher': 'str', + 'database_contact_person': 'UserDto', 'tables': 'list[TableBriefDto]', - 'image': 'ImageDto', + 'database_container_image': 'ImageDto', 'container': 'ContainerDto', - 'created': 'datetime', + 'database_creation_time': 'datetime', 'deleted': 'datetime', - 'internal_name': 'str', - 'publication_year': 'int', - 'is_public': 'bool' + 'database_internal_name': 'str', + 'database_publication_year': 'int', + 'database_publication_month': 'int', + 'database_publication_day': 'int', + 'database_public': 'bool' } attribute_map = { - 'id': 'id', - 'name': 'name', - 'exchange': 'exchange', - 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', - 'description': 'description', - 'publisher': 'publisher', - 'contact': 'contact', + 'database_id': 'database id', + 'database_name': 'database name', + 'database_exchange': 'database exchange', + 'database_creator': 'database creator', + 'database_subjects': 'database subjects', + 'database_language': 'database language', + 'database_license': 'database license', + 'database_description': 'database description', + 'database_publisher': 'database publisher', + 'database_contact_person': 'database contact person', 'tables': 'tables', - 'image': 'image', + 'database_container_image': 'database container image', 'container': 'container', - 'created': 'created', + 'database_creation_time': 'database creation time', 'deleted': 'deleted', - 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'is_public': 'is_public' + 'database_internal_name': 'database internal name', + 'database_publication_year': 'database publication year', + 'database_publication_month': 'database publication month', + 'database_publication_day': 'database publication day', + 'database_public': 'database public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 + def __init__(self, database_id=None, database_name=None, database_exchange=None, database_creator=None, database_subjects=None, database_language=None, database_license=None, database_description=None, database_publisher=None, database_contact_person=None, tables=None, database_container_image=None, container=None, database_creation_time=None, deleted=None, database_internal_name=None, database_publication_year=None, database_publication_month=None, database_publication_day=None, database_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 - self._id = None - self._name = None - self._exchange = None - self._creator = None - self._subjects = None - self._language = None - self._license = None - self._description = None - self._publisher = None - self._contact = None + self._database_id = None + self._database_name = None + self._database_exchange = None + self._database_creator = None + self._database_subjects = None + self._database_language = None + self._database_license = None + self._database_description = None + self._database_publisher = None + self._database_contact_person = None self._tables = None - self._image = None + self._database_container_image = None self._container = None - self._created = None + self._database_creation_time = None self._deleted = None - self._internal_name = None - self._publication_year = None - self._is_public = None + self._database_internal_name = None + self._database_publication_year = None + self._database_publication_month = None + self._database_publication_day = None + self._database_public = None self.discriminator = None - self.id = id - self.name = name - self.exchange = exchange - self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license - if description is not None: - self.description = description - if publisher is not None: - self.publisher = publisher - if contact is not None: - self.contact = contact + self.database_id = database_id + self.database_name = database_name + self.database_exchange = database_exchange + self.database_creator = database_creator + if database_subjects is not None: + self.database_subjects = database_subjects + if database_language is not None: + self.database_language = database_language + if database_license is not None: + self.database_license = database_license + self.database_description = database_description + if database_publisher is not None: + self.database_publisher = database_publisher + if database_contact_person is not None: + self.database_contact_person = database_contact_person if tables is not None: self.tables = tables - if image is not None: - self.image = image + if database_container_image is not None: + self.database_container_image = database_container_image if container is not None: self.container = container - if created is not None: - self.created = created + if database_creation_time is not None: + self.database_creation_time = database_creation_time if deleted is not None: self.deleted = deleted - self.internal_name = internal_name - self.publication_year = publication_year - if is_public is not None: - self.is_public = is_public + self.database_internal_name = database_internal_name + if database_publication_year is not None: + self.database_publication_year = database_publication_year + if database_publication_month is not None: + self.database_publication_month = database_publication_month + if database_publication_day is not None: + self.database_publication_day = database_publication_day + if database_public is not None: + self.database_public = database_public @property - def id(self): - """Gets the id of this DatabaseDto. # noqa: E501 + def database_id(self): + """Gets the database_id of this DatabaseDto. # noqa: E501 - :return: The id of this DatabaseDto. # noqa: E501 + :return: The database_id of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._id + return self._database_id - @id.setter - def id(self, id): - """Sets the id of this DatabaseDto. + @database_id.setter + def database_id(self, database_id): + """Sets the database_id of this DatabaseDto. - :param id: The id of this DatabaseDto. # noqa: E501 + :param database_id: The database_id of this DatabaseDto. # noqa: E501 :type: int """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + if database_id is None: + raise ValueError("Invalid value for `database_id`, must not be `None`") # noqa: E501 - self._id = id + self._database_id = database_id @property - def name(self): - """Gets the name of this DatabaseDto. # noqa: E501 + def database_name(self): + """Gets the database_name of this DatabaseDto. # noqa: E501 - :return: The name of this DatabaseDto. # noqa: E501 + :return: The database_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._name + return self._database_name - @name.setter - def name(self, name): - """Sets the name of this DatabaseDto. + @database_name.setter + def database_name(self, database_name): + """Sets the database_name of this DatabaseDto. - :param name: The name of this DatabaseDto. # noqa: E501 + :param database_name: The database_name of this DatabaseDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if database_name is None: + raise ValueError("Invalid value for `database_name`, must not be `None`") # noqa: E501 - self._name = name + self._database_name = database_name @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 + def database_exchange(self): + """Gets the database_exchange of this DatabaseDto. # noqa: E501 - :return: The exchange of this DatabaseDto. # noqa: E501 + :return: The database_exchange of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._exchange + return self._database_exchange - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. + @database_exchange.setter + def database_exchange(self, database_exchange): + """Sets the database_exchange of this DatabaseDto. - :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :param database_exchange: The database_exchange of this DatabaseDto. # noqa: E501 :type: str """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + if database_exchange is None: + raise ValueError("Invalid value for `database_exchange`, must not be `None`") # noqa: E501 - self._exchange = exchange + self._database_exchange = database_exchange @property - def creator(self): - """Gets the creator of this DatabaseDto. # noqa: E501 + def database_creator(self): + """Gets the database_creator of this DatabaseDto. # noqa: E501 - :return: The creator of this DatabaseDto. # noqa: E501 + :return: The database_creator of this DatabaseDto. # noqa: E501 :rtype: UserBriefDto """ - return self._creator + return self._database_creator - @creator.setter - def creator(self, creator): - """Sets the creator of this DatabaseDto. + @database_creator.setter + def database_creator(self, database_creator): + """Sets the database_creator of this DatabaseDto. - :param creator: The creator of this DatabaseDto. # noqa: E501 + :param database_creator: The database_creator of this DatabaseDto. # noqa: E501 :type: UserBriefDto """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + if database_creator is None: + raise ValueError("Invalid value for `database_creator`, must not be `None`") # noqa: E501 - self._creator = creator + self._database_creator = database_creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def database_subjects(self): + """Gets the database_subjects of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 + :return: The database_subjects of this DatabaseDto. # noqa: E501 :rtype: list[str] """ - return self._subjects + return self._database_subjects - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @database_subjects.setter + def database_subjects(self, database_subjects): + """Sets the database_subjects of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :param database_subjects: The database_subjects of this DatabaseDto. # noqa: E501 :type: list[str] """ - self._subjects = subjects + self._database_subjects = database_subjects @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 + def database_language(self): + """Gets the database_language of this DatabaseDto. # noqa: E501 - :return: The language of this DatabaseDto. # noqa: E501 + :return: The database_language of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._language + return self._database_language - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. + @database_language.setter + def database_language(self, database_language): + """Sets the database_language of this DatabaseDto. - :param language: The language of this DatabaseDto. # noqa: E501 + :param database_language: The database_language of this DatabaseDto. # noqa: E501 :type: str """ allowed_values = ["ab", "aa", "af", "ak", "sq", "am", "ar", "an", "hy", "as", "av", "ae", "ay", "az", "bm", "ba", "eu", "be", "bn", "bh", "bi", "bs", "br", "bg", "my", "ca", "km", "ch", "ce", "ny", "zh", "cu", "cv", "kw", "co", "cr", "hr", "cs", "da", "dv", "nl", "dz", "en", "eo", "et", "ee", "fo", "fj", "fi", "fr", "ff", "gd", "gl", "lg", "ka", "de", "ki", "el", "kl", "gn", "gu", "ht", "ha", "he", "hz", "hi", "ho", "hu", "is", "io", "ig", "id", "ia", "ie", "iu", "ik", "ga", "it", "ja", "jv", "kn", "kr", "ks", "kk", "rw", "kv", "kg", "ko", "kj", "ku", "ky", "lo", "la", "lv", "lb", "li", "ln", "lt", "lu", "mk", "mg", "ms", "ml", "mt", "gv", "mi", "mr", "mh", "ro", "mn", "na", "nv", "nd", "ng", "ne", "se", "no", "nb", "nn", "ii", "oc", "oj", "or", "om", "os", "pi", "pa", "ps", "fa", "pl", "pt", "qu", "rm", "rn", "ru", "sm", "sg", "sa", "sc", "sr", "sn", "sd", "si", "sk", "sl", "so", "st", "nr", "es", "su", "sw", "ss", "sv", "tl", "ty", "tg", "ta", "tt", "te", "th", "bo", "ti", "to", "ts", "tn", "tr", "tk", "tw", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "cy", "fy", "wo", "xh", "yi", "yo", "za", "zu"] # noqa: E501 - if language not in allowed_values: + if database_language not in allowed_values: raise ValueError( - "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 - .format(language, allowed_values) + "Invalid value for `database_language` ({0}), must be one of {1}" # noqa: E501 + .format(database_language, allowed_values) ) - self._language = language + self._database_language = database_language @property - def license(self): - """Gets the license of this DatabaseDto. # noqa: E501 + def database_license(self): + """Gets the database_license of this DatabaseDto. # noqa: E501 - :return: The license of this DatabaseDto. # noqa: E501 + :return: The database_license of this DatabaseDto. # noqa: E501 :rtype: LicenseDto """ - return self._license + return self._database_license - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. + @database_license.setter + def database_license(self, database_license): + """Sets the database_license of this DatabaseDto. - :param license: The license of this DatabaseDto. # noqa: E501 + :param database_license: The database_license of this DatabaseDto. # noqa: E501 :type: LicenseDto """ - self._license = license + self._database_license = database_license @property - def description(self): - """Gets the description of this DatabaseDto. # noqa: E501 + def database_description(self): + """Gets the database_description of this DatabaseDto. # noqa: E501 - :return: The description of this DatabaseDto. # noqa: E501 + :return: The database_description of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._description + return self._database_description - @description.setter - def description(self, description): - """Sets the description of this DatabaseDto. + @database_description.setter + def database_description(self, database_description): + """Sets the database_description of this DatabaseDto. - :param description: The description of this DatabaseDto. # noqa: E501 + :param database_description: The database_description of this DatabaseDto. # noqa: E501 :type: str """ + if database_description is None: + raise ValueError("Invalid value for `database_description`, must not be `None`") # noqa: E501 - self._description = description + self._database_description = database_description @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 + def database_publisher(self): + """Gets the database_publisher of this DatabaseDto. # noqa: E501 - :return: The publisher of this DatabaseDto. # noqa: E501 + :return: The database_publisher of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._publisher + return self._database_publisher - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. + @database_publisher.setter + def database_publisher(self, database_publisher): + """Sets the database_publisher of this DatabaseDto. - :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :param database_publisher: The database_publisher of this DatabaseDto. # noqa: E501 :type: str """ - self._publisher = publisher + self._database_publisher = database_publisher @property - def contact(self): - """Gets the contact of this DatabaseDto. # noqa: E501 + def database_contact_person(self): + """Gets the database_contact_person of this DatabaseDto. # noqa: E501 - :return: The contact of this DatabaseDto. # noqa: E501 + :return: The database_contact_person of this DatabaseDto. # noqa: E501 :rtype: UserDto """ - return self._contact + return self._database_contact_person - @contact.setter - def contact(self, contact): - """Sets the contact of this DatabaseDto. + @database_contact_person.setter + def database_contact_person(self, database_contact_person): + """Sets the database_contact_person of this DatabaseDto. - :param contact: The contact of this DatabaseDto. # noqa: E501 + :param database_contact_person: The database_contact_person of this DatabaseDto. # noqa: E501 :type: UserDto """ - self._contact = contact + self._database_contact_person = database_contact_person @property def tables(self): @@ -367,25 +379,25 @@ class DatabaseDto(object): self._tables = tables @property - def image(self): - """Gets the image of this DatabaseDto. # noqa: E501 + def database_container_image(self): + """Gets the database_container_image of this DatabaseDto. # noqa: E501 - :return: The image of this DatabaseDto. # noqa: E501 + :return: The database_container_image of this DatabaseDto. # noqa: E501 :rtype: ImageDto """ - return self._image + return self._database_container_image - @image.setter - def image(self, image): - """Sets the image of this DatabaseDto. + @database_container_image.setter + def database_container_image(self, database_container_image): + """Sets the database_container_image of this DatabaseDto. - :param image: The image of this DatabaseDto. # noqa: E501 + :param database_container_image: The database_container_image of this DatabaseDto. # noqa: E501 :type: ImageDto """ - self._image = image + self._database_container_image = database_container_image @property def container(self): @@ -409,25 +421,25 @@ class DatabaseDto(object): self._container = container @property - def created(self): - """Gets the created of this DatabaseDto. # noqa: E501 + def database_creation_time(self): + """Gets the database_creation_time of this DatabaseDto. # noqa: E501 - :return: The created of this DatabaseDto. # noqa: E501 + :return: The database_creation_time of this DatabaseDto. # noqa: E501 :rtype: datetime """ - return self._created + return self._database_creation_time - @created.setter - def created(self, created): - """Sets the created of this DatabaseDto. + @database_creation_time.setter + def database_creation_time(self, database_creation_time): + """Sets the database_creation_time of this DatabaseDto. - :param created: The created of this DatabaseDto. # noqa: E501 + :param database_creation_time: The database_creation_time of this DatabaseDto. # noqa: E501 :type: datetime """ - self._created = created + self._database_creation_time = database_creation_time @property def deleted(self): @@ -451,71 +463,111 @@ class DatabaseDto(object): self._deleted = deleted @property - def internal_name(self): - """Gets the internal_name of this DatabaseDto. # noqa: E501 + def database_internal_name(self): + """Gets the database_internal_name of this DatabaseDto. # noqa: E501 - :return: The internal_name of this DatabaseDto. # noqa: E501 + :return: The database_internal_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._internal_name + return self._database_internal_name - @internal_name.setter - def internal_name(self, internal_name): - """Sets the internal_name of this DatabaseDto. + @database_internal_name.setter + def database_internal_name(self, database_internal_name): + """Sets the database_internal_name of this DatabaseDto. - :param internal_name: The internal_name of this DatabaseDto. # noqa: E501 + :param database_internal_name: The database_internal_name of this DatabaseDto. # noqa: E501 :type: str """ - if internal_name is None: - raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + if database_internal_name is None: + raise ValueError("Invalid value for `database_internal_name`, must not be `None`") # noqa: E501 - self._internal_name = internal_name + self._database_internal_name = database_internal_name @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 + def database_publication_year(self): + """Gets the database_publication_year of this DatabaseDto. # noqa: E501 - :return: The publication_year of this DatabaseDto. # noqa: E501 + :return: The database_publication_year of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._publication_year + return self._database_publication_year - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. + @database_publication_year.setter + def database_publication_year(self, database_publication_year): + """Sets the database_publication_year of this DatabaseDto. - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :param database_publication_year: The database_publication_year of this DatabaseDto. # noqa: E501 :type: int """ - if publication_year is None: - raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - self._publication_year = publication_year + self._database_publication_year = database_publication_year @property - def is_public(self): - """Gets the is_public of this DatabaseDto. # noqa: E501 + def database_publication_month(self): + """Gets the database_publication_month of this DatabaseDto. # noqa: E501 - :return: The is_public of this DatabaseDto. # noqa: E501 + :return: The database_publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_month + + @database_publication_month.setter + def database_publication_month(self, database_publication_month): + """Sets the database_publication_month of this DatabaseDto. + + + :param database_publication_month: The database_publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_month = database_publication_month + + @property + def database_publication_day(self): + """Gets the database_publication_day of this DatabaseDto. # noqa: E501 + + + :return: The database_publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_day + + @database_publication_day.setter + def database_publication_day(self, database_publication_day): + """Sets the database_publication_day of this DatabaseDto. + + + :param database_publication_day: The database_publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_day = database_publication_day + + @property + def database_public(self): + """Gets the database_public of this DatabaseDto. # noqa: E501 + + + :return: The database_public of this DatabaseDto. # noqa: E501 :rtype: bool """ - return self._is_public + return self._database_public - @is_public.setter - def is_public(self, is_public): - """Sets the is_public of this DatabaseDto. + @database_public.setter + def database_public(self, database_public): + """Sets the database_public of this DatabaseDto. - :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :param database_public: The database_public of this DatabaseDto. # noqa: E501 :type: bool """ - self._is_public = is_public + self._database_public = database_public def to_dict(self): """Returns the model properties as a dict""" diff --git a/.jupyter/api_identifier/models/identifier_create_dto.py b/.jupyter/api_identifier/models/identifier_create_dto.py index d0ac2f8bd4eafe0c4a7da50afce5cfa37ff43a73..80c8790bdcde9549390fc471a5a7bf95228d940d 100644 --- a/.jupyter/api_identifier/models/identifier_create_dto.py +++ b/.jupyter/api_identifier/models/identifier_create_dto.py @@ -33,6 +33,7 @@ class IdentifierCreateDto(object): 'description': 'str', 'visibility': 'str', 'doi': 'str', + 'publisher': 'str', 'creators': 'list[CreatorCreateDto]', 'publication_day': 'int', 'publication_month': 'int', @@ -46,6 +47,7 @@ class IdentifierCreateDto(object): 'description': 'description', 'visibility': 'visibility', 'doi': 'doi', + 'publisher': 'publisher', 'creators': 'creators', 'publication_day': 'publication_day', 'publication_month': 'publication_month', @@ -53,13 +55,14 @@ class IdentifierCreateDto(object): 'related_identifiers': 'related_identifiers' } - def __init__(self, qid=None, title=None, description=None, visibility=None, doi=None, creators=None, publication_day=None, publication_month=None, publication_year=None, related_identifiers=None): # noqa: E501 + def __init__(self, qid=None, title=None, description=None, visibility=None, doi=None, publisher=None, creators=None, publication_day=None, publication_month=None, publication_year=None, related_identifiers=None): # noqa: E501 """IdentifierCreateDto - a model defined in Swagger""" # noqa: E501 self._qid = None self._title = None self._description = None self._visibility = None self._doi = None + self._publisher = None self._creators = None self._publication_day = None self._publication_month = None @@ -72,6 +75,8 @@ class IdentifierCreateDto(object): self.visibility = visibility if doi is not None: self.doi = doi + if publisher is not None: + self.publisher = publisher self.creators = creators if publication_day is not None: self.publication_day = publication_day @@ -200,6 +205,27 @@ class IdentifierCreateDto(object): self._doi = doi + @property + def publisher(self): + """Gets the publisher of this IdentifierCreateDto. # noqa: E501 + + + :return: The publisher of this IdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this IdentifierCreateDto. + + + :param publisher: The publisher of this IdentifierCreateDto. # noqa: E501 + :type: str + """ + + self._publisher = publisher + @property def creators(self): """Gets the creators of this IdentifierCreateDto. # noqa: E501 diff --git a/.jupyter/api_identifier/models/identifier_dto.py b/.jupyter/api_identifier/models/identifier_dto.py index 5ee9095a726672927b5099a687474f420c06c11d..f182dd5cd6339bca64060e97416d5fd71e2b14d5 100644 --- a/.jupyter/api_identifier/models/identifier_dto.py +++ b/.jupyter/api_identifier/models/identifier_dto.py @@ -38,6 +38,7 @@ class IdentifierDto(object): 'execution': 'datetime', 'visibility': 'str', 'doi': 'str', + 'publisher': 'str', 'creator': 'UserDto', 'creators': 'list[CreatorDto]', 'created': 'datetime', @@ -63,6 +64,7 @@ class IdentifierDto(object): 'execution': 'execution', 'visibility': 'visibility', 'doi': 'doi', + 'publisher': 'publisher', 'creator': 'creator', 'creators': 'creators', 'created': 'created', @@ -77,7 +79,7 @@ class IdentifierDto(object): 'last_modified': 'last_modified' } - def __init__(self, id=None, cid=None, dbid=None, qid=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, creator=None, creators=None, created=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, cid=None, dbid=None, qid=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, creator=None, creators=None, created=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 """IdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._cid = None @@ -89,6 +91,7 @@ class IdentifierDto(object): self._execution = None self._visibility = None self._doi = None + self._publisher = None self._creator = None self._creators = None self._created = None @@ -114,6 +117,8 @@ class IdentifierDto(object): self.visibility = visibility if doi is not None: self.doi = doi + if publisher is not None: + self.publisher = publisher self.creator = creator self.creators = creators if created is not None: @@ -364,6 +369,27 @@ class IdentifierDto(object): self._doi = doi + @property + def publisher(self): + """Gets the publisher of this IdentifierDto. # noqa: E501 + + + :return: The publisher of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this IdentifierDto. + + + :param publisher: The publisher of this IdentifierDto. # noqa: E501 + :type: str + """ + + self._publisher = publisher + @property def creator(self): """Gets the creator of this IdentifierDto. # noqa: E501 diff --git a/.jupyter/api_metadata/__init__.py b/.jupyter/api_metadata/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..80f445a80211c2a0238beb3f5171a74cff57d9eb --- /dev/null +++ b/.jupyter/api_metadata/__init__.py @@ -0,0 +1,23 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Metadata Service API + + Service that manages the metadata # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import apis into sdk package +from api_metadata.api.metadata_endpoint_api import MetadataEndpointApi +# import ApiClient +from api_metadata.api_client import ApiClient +from api_metadata.configuration import Configuration +# import models into sdk package +from api_metadata.models.oai_list_identifiers_parameters import OaiListIdentifiersParameters diff --git a/.jupyter/api_metadata/api/__init__.py b/.jupyter/api_metadata/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3b53275ce79733f9cdc9004ce857198382fe4581 --- /dev/null +++ b/.jupyter/api_metadata/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_metadata.api.metadata_endpoint_api import MetadataEndpointApi diff --git a/.jupyter/api_metadata/api/metadata_endpoint_api.py b/.jupyter/api_metadata/api/metadata_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..33218d17c89ce11e502a42543b610fd551e35dd9 --- /dev/null +++ b/.jupyter/api_metadata/api/metadata_endpoint_api.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_metadata.api_client import ApiClient + + +class MetadataEndpointApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def identify1111(self, parameters, **kwargs): # noqa: E501 + """Get the record # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.identify1111(parameters, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param OaiListIdentifiersParameters parameters: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.identify1111_with_http_info(parameters, **kwargs) # noqa: E501 + else: + (data) = self.identify1111_with_http_info(parameters, **kwargs) # noqa: E501 + return data + + def identify1111_with_http_info(self, parameters, **kwargs): # noqa: E501 + """Get the record # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.identify1111_with_http_info(parameters, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param OaiListIdentifiersParameters parameters: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['parameters'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method identify1111" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'parameters' is set + if ('parameters' not in params or + params['parameters'] is None): + raise ValueError("Missing the required parameter `parameters` when calling `identify1111`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'parameters' in params: + query_params.append(('parameters', params['parameters'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/xml;charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/oai', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/.jupyter/api_metadata/api_client.py b/.jupyter/api_metadata/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..168f238b4171ba853004d84752621f479abf7b72 --- /dev/null +++ b/.jupyter/api_metadata/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Metadata Service API + + Service that manages the metadata # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from api_metadata.configuration import Configuration +import api_metadata.models +from api_metadata import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = ThreadPool() + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + + def __del__(self): + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(api_metadata.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + response_data = response.data + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + else: + f.write(response_data) + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/.jupyter/api_metadata/configuration.py b/.jupyter/api_metadata/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..d8a184c34fee46c235812aaab9526ff9498ecf36 --- /dev/null +++ b/.jupyter/api_metadata/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self): + """Constructor""" + # Default Base url + self.host = "http://localhost:9095" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("api_metadata") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.1.0-alpha\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/.jupyter/api_metadata/models/__init__.py b/.jupyter/api_metadata/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b68804d4360ddf571835f3ce393b51e9f333c659 --- /dev/null +++ b/.jupyter/api_metadata/models/__init__.py @@ -0,0 +1,17 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Metadata Service API + + Service that manages the metadata # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import models into model package +from api_metadata.models.oai_list_identifiers_parameters import OaiListIdentifiersParameters diff --git a/.jupyter/api_metadata/models/oai_list_identifiers_parameters.py b/.jupyter/api_metadata/models/oai_list_identifiers_parameters.py new file mode 100644 index 0000000000000000000000000000000000000000..9afdd185ae784ed6a1d0b26883f43949b25da6d7 --- /dev/null +++ b/.jupyter/api_metadata/models/oai_list_identifiers_parameters.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OaiListIdentifiersParameters(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_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 = { + 'metadata_prefix': 'str', + '_from': 'str', + 'until': 'str', + 'set': 'str', + 'resumption_token': 'str', + 'from_date': 'datetime', + 'until_date': 'datetime', + 'parameters_string': 'str' + } + + attribute_map = { + 'metadata_prefix': 'metadataPrefix', + '_from': 'from', + 'until': 'until', + 'set': 'set', + 'resumption_token': 'resumptionToken', + 'from_date': 'fromDate', + 'until_date': 'untilDate', + 'parameters_string': 'parametersString' + } + + def __init__(self, metadata_prefix=None, _from=None, until=None, set=None, resumption_token=None, from_date=None, until_date=None, parameters_string=None): # noqa: E501 + """OaiListIdentifiersParameters - a model defined in Swagger""" # noqa: E501 + self._metadata_prefix = None + self.__from = None + self._until = None + self._set = None + self._resumption_token = None + self._from_date = None + self._until_date = None + self._parameters_string = None + self.discriminator = None + if metadata_prefix is not None: + self.metadata_prefix = metadata_prefix + if _from is not None: + self._from = _from + if until is not None: + self.until = until + if set is not None: + self.set = set + if resumption_token is not None: + self.resumption_token = resumption_token + if from_date is not None: + self.from_date = from_date + if until_date is not None: + self.until_date = until_date + if parameters_string is not None: + self.parameters_string = parameters_string + + @property + def metadata_prefix(self): + """Gets the metadata_prefix of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The metadata_prefix of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._metadata_prefix + + @metadata_prefix.setter + def metadata_prefix(self, metadata_prefix): + """Sets the metadata_prefix of this OaiListIdentifiersParameters. + + + :param metadata_prefix: The metadata_prefix of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._metadata_prefix = metadata_prefix + + @property + def _from(self): + """Gets the _from of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The _from of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this OaiListIdentifiersParameters. + + + :param _from: The _from of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self.__from = _from + + @property + def until(self): + """Gets the until of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The until of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._until + + @until.setter + def until(self, until): + """Sets the until of this OaiListIdentifiersParameters. + + + :param until: The until of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._until = until + + @property + def set(self): + """Gets the set of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The set of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._set + + @set.setter + def set(self, set): + """Sets the set of this OaiListIdentifiersParameters. + + + :param set: The set of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._set = set + + @property + def resumption_token(self): + """Gets the resumption_token of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The resumption_token of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._resumption_token + + @resumption_token.setter + def resumption_token(self, resumption_token): + """Sets the resumption_token of this OaiListIdentifiersParameters. + + + :param resumption_token: The resumption_token of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._resumption_token = resumption_token + + @property + def from_date(self): + """Gets the from_date of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The from_date of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: datetime + """ + return self._from_date + + @from_date.setter + def from_date(self, from_date): + """Sets the from_date of this OaiListIdentifiersParameters. + + + :param from_date: The from_date of this OaiListIdentifiersParameters. # noqa: E501 + :type: datetime + """ + + self._from_date = from_date + + @property + def until_date(self): + """Gets the until_date of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The until_date of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: datetime + """ + return self._until_date + + @until_date.setter + def until_date(self, until_date): + """Sets the until_date of this OaiListIdentifiersParameters. + + + :param until_date: The until_date of this OaiListIdentifiersParameters. # noqa: E501 + :type: datetime + """ + + self._until_date = until_date + + @property + def parameters_string(self): + """Gets the parameters_string of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The parameters_string of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._parameters_string + + @parameters_string.setter + def parameters_string(self, parameters_string): + """Sets the parameters_string of this OaiListIdentifiersParameters. + + + :param parameters_string: The parameters_string of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._parameters_string = parameters_string + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OaiListIdentifiersParameters, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OaiListIdentifiersParameters): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/.jupyter/api_metadata/rest.py b/.jupyter/api_metadata/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..886644736010d4e652a34f9006bb2aa7249ca900 --- /dev/null +++ b/.jupyter/api_metadata/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = '{}' + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/.jupyter/api_query/models/database_dto.py b/.jupyter/api_query/models/database_dto.py index a6cbe93ef828694fc41e70f0dc370ee8fdd900f0..fb94bfb4d9045bb7ad5ff5789c279538827cdf25 100644 --- a/.jupyter/api_query/models/database_dto.py +++ b/.jupyter/api_query/models/database_dto.py @@ -28,322 +28,334 @@ class DatabaseDto(object): and the value is json key in definition. """ swagger_types = { - 'id': 'int', - 'name': 'str', - 'exchange': 'str', - 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', - 'description': 'str', - 'publisher': 'str', - 'contact': 'UserDto', + 'database_id': 'int', + 'database_name': 'str', + 'database_exchange': 'str', + 'database_creator': 'UserBriefDto', + 'database_subjects': 'list[str]', + 'database_language': 'str', + 'database_license': 'LicenseDto', + 'database_description': 'str', + 'database_publisher': 'str', + 'database_contact_person': 'UserDto', 'tables': 'list[TableBriefDto]', - 'image': 'ImageDto', + 'database_container_image': 'ImageDto', 'container': 'ContainerDto', - 'created': 'datetime', + 'database_creation_time': 'datetime', 'deleted': 'datetime', - 'internal_name': 'str', - 'publication_year': 'int', - 'is_public': 'bool' + 'database_internal_name': 'str', + 'database_publication_year': 'int', + 'database_publication_month': 'int', + 'database_publication_day': 'int', + 'database_public': 'bool' } attribute_map = { - 'id': 'id', - 'name': 'name', - 'exchange': 'exchange', - 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', - 'description': 'description', - 'publisher': 'publisher', - 'contact': 'contact', + 'database_id': 'database id', + 'database_name': 'database name', + 'database_exchange': 'database exchange', + 'database_creator': 'database creator', + 'database_subjects': 'database subjects', + 'database_language': 'database language', + 'database_license': 'database license', + 'database_description': 'database description', + 'database_publisher': 'database publisher', + 'database_contact_person': 'database contact person', 'tables': 'tables', - 'image': 'image', + 'database_container_image': 'database container image', 'container': 'container', - 'created': 'created', + 'database_creation_time': 'database creation time', 'deleted': 'deleted', - 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'is_public': 'is_public' + 'database_internal_name': 'database internal name', + 'database_publication_year': 'database publication year', + 'database_publication_month': 'database publication month', + 'database_publication_day': 'database publication day', + 'database_public': 'database public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 + def __init__(self, database_id=None, database_name=None, database_exchange=None, database_creator=None, database_subjects=None, database_language=None, database_license=None, database_description=None, database_publisher=None, database_contact_person=None, tables=None, database_container_image=None, container=None, database_creation_time=None, deleted=None, database_internal_name=None, database_publication_year=None, database_publication_month=None, database_publication_day=None, database_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 - self._id = None - self._name = None - self._exchange = None - self._creator = None - self._subjects = None - self._language = None - self._license = None - self._description = None - self._publisher = None - self._contact = None + self._database_id = None + self._database_name = None + self._database_exchange = None + self._database_creator = None + self._database_subjects = None + self._database_language = None + self._database_license = None + self._database_description = None + self._database_publisher = None + self._database_contact_person = None self._tables = None - self._image = None + self._database_container_image = None self._container = None - self._created = None + self._database_creation_time = None self._deleted = None - self._internal_name = None - self._publication_year = None - self._is_public = None + self._database_internal_name = None + self._database_publication_year = None + self._database_publication_month = None + self._database_publication_day = None + self._database_public = None self.discriminator = None - self.id = id - self.name = name - self.exchange = exchange - self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license - if description is not None: - self.description = description - if publisher is not None: - self.publisher = publisher - if contact is not None: - self.contact = contact + self.database_id = database_id + self.database_name = database_name + self.database_exchange = database_exchange + self.database_creator = database_creator + if database_subjects is not None: + self.database_subjects = database_subjects + if database_language is not None: + self.database_language = database_language + if database_license is not None: + self.database_license = database_license + self.database_description = database_description + if database_publisher is not None: + self.database_publisher = database_publisher + if database_contact_person is not None: + self.database_contact_person = database_contact_person if tables is not None: self.tables = tables - if image is not None: - self.image = image + if database_container_image is not None: + self.database_container_image = database_container_image if container is not None: self.container = container - if created is not None: - self.created = created + if database_creation_time is not None: + self.database_creation_time = database_creation_time if deleted is not None: self.deleted = deleted - self.internal_name = internal_name - self.publication_year = publication_year - if is_public is not None: - self.is_public = is_public + self.database_internal_name = database_internal_name + if database_publication_year is not None: + self.database_publication_year = database_publication_year + if database_publication_month is not None: + self.database_publication_month = database_publication_month + if database_publication_day is not None: + self.database_publication_day = database_publication_day + if database_public is not None: + self.database_public = database_public @property - def id(self): - """Gets the id of this DatabaseDto. # noqa: E501 + def database_id(self): + """Gets the database_id of this DatabaseDto. # noqa: E501 - :return: The id of this DatabaseDto. # noqa: E501 + :return: The database_id of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._id + return self._database_id - @id.setter - def id(self, id): - """Sets the id of this DatabaseDto. + @database_id.setter + def database_id(self, database_id): + """Sets the database_id of this DatabaseDto. - :param id: The id of this DatabaseDto. # noqa: E501 + :param database_id: The database_id of this DatabaseDto. # noqa: E501 :type: int """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + if database_id is None: + raise ValueError("Invalid value for `database_id`, must not be `None`") # noqa: E501 - self._id = id + self._database_id = database_id @property - def name(self): - """Gets the name of this DatabaseDto. # noqa: E501 + def database_name(self): + """Gets the database_name of this DatabaseDto. # noqa: E501 - :return: The name of this DatabaseDto. # noqa: E501 + :return: The database_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._name + return self._database_name - @name.setter - def name(self, name): - """Sets the name of this DatabaseDto. + @database_name.setter + def database_name(self, database_name): + """Sets the database_name of this DatabaseDto. - :param name: The name of this DatabaseDto. # noqa: E501 + :param database_name: The database_name of this DatabaseDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if database_name is None: + raise ValueError("Invalid value for `database_name`, must not be `None`") # noqa: E501 - self._name = name + self._database_name = database_name @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 + def database_exchange(self): + """Gets the database_exchange of this DatabaseDto. # noqa: E501 - :return: The exchange of this DatabaseDto. # noqa: E501 + :return: The database_exchange of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._exchange + return self._database_exchange - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. + @database_exchange.setter + def database_exchange(self, database_exchange): + """Sets the database_exchange of this DatabaseDto. - :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :param database_exchange: The database_exchange of this DatabaseDto. # noqa: E501 :type: str """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + if database_exchange is None: + raise ValueError("Invalid value for `database_exchange`, must not be `None`") # noqa: E501 - self._exchange = exchange + self._database_exchange = database_exchange @property - def creator(self): - """Gets the creator of this DatabaseDto. # noqa: E501 + def database_creator(self): + """Gets the database_creator of this DatabaseDto. # noqa: E501 - :return: The creator of this DatabaseDto. # noqa: E501 + :return: The database_creator of this DatabaseDto. # noqa: E501 :rtype: UserBriefDto """ - return self._creator + return self._database_creator - @creator.setter - def creator(self, creator): - """Sets the creator of this DatabaseDto. + @database_creator.setter + def database_creator(self, database_creator): + """Sets the database_creator of this DatabaseDto. - :param creator: The creator of this DatabaseDto. # noqa: E501 + :param database_creator: The database_creator of this DatabaseDto. # noqa: E501 :type: UserBriefDto """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + if database_creator is None: + raise ValueError("Invalid value for `database_creator`, must not be `None`") # noqa: E501 - self._creator = creator + self._database_creator = database_creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def database_subjects(self): + """Gets the database_subjects of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 + :return: The database_subjects of this DatabaseDto. # noqa: E501 :rtype: list[str] """ - return self._subjects + return self._database_subjects - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @database_subjects.setter + def database_subjects(self, database_subjects): + """Sets the database_subjects of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :param database_subjects: The database_subjects of this DatabaseDto. # noqa: E501 :type: list[str] """ - self._subjects = subjects + self._database_subjects = database_subjects @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 + def database_language(self): + """Gets the database_language of this DatabaseDto. # noqa: E501 - :return: The language of this DatabaseDto. # noqa: E501 + :return: The database_language of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._language + return self._database_language - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. + @database_language.setter + def database_language(self, database_language): + """Sets the database_language of this DatabaseDto. - :param language: The language of this DatabaseDto. # noqa: E501 + :param database_language: The database_language of this DatabaseDto. # noqa: E501 :type: str """ allowed_values = ["ab", "aa", "af", "ak", "sq", "am", "ar", "an", "hy", "as", "av", "ae", "ay", "az", "bm", "ba", "eu", "be", "bn", "bh", "bi", "bs", "br", "bg", "my", "ca", "km", "ch", "ce", "ny", "zh", "cu", "cv", "kw", "co", "cr", "hr", "cs", "da", "dv", "nl", "dz", "en", "eo", "et", "ee", "fo", "fj", "fi", "fr", "ff", "gd", "gl", "lg", "ka", "de", "ki", "el", "kl", "gn", "gu", "ht", "ha", "he", "hz", "hi", "ho", "hu", "is", "io", "ig", "id", "ia", "ie", "iu", "ik", "ga", "it", "ja", "jv", "kn", "kr", "ks", "kk", "rw", "kv", "kg", "ko", "kj", "ku", "ky", "lo", "la", "lv", "lb", "li", "ln", "lt", "lu", "mk", "mg", "ms", "ml", "mt", "gv", "mi", "mr", "mh", "ro", "mn", "na", "nv", "nd", "ng", "ne", "se", "no", "nb", "nn", "ii", "oc", "oj", "or", "om", "os", "pi", "pa", "ps", "fa", "pl", "pt", "qu", "rm", "rn", "ru", "sm", "sg", "sa", "sc", "sr", "sn", "sd", "si", "sk", "sl", "so", "st", "nr", "es", "su", "sw", "ss", "sv", "tl", "ty", "tg", "ta", "tt", "te", "th", "bo", "ti", "to", "ts", "tn", "tr", "tk", "tw", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "cy", "fy", "wo", "xh", "yi", "yo", "za", "zu"] # noqa: E501 - if language not in allowed_values: + if database_language not in allowed_values: raise ValueError( - "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 - .format(language, allowed_values) + "Invalid value for `database_language` ({0}), must be one of {1}" # noqa: E501 + .format(database_language, allowed_values) ) - self._language = language + self._database_language = database_language @property - def license(self): - """Gets the license of this DatabaseDto. # noqa: E501 + def database_license(self): + """Gets the database_license of this DatabaseDto. # noqa: E501 - :return: The license of this DatabaseDto. # noqa: E501 + :return: The database_license of this DatabaseDto. # noqa: E501 :rtype: LicenseDto """ - return self._license + return self._database_license - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. + @database_license.setter + def database_license(self, database_license): + """Sets the database_license of this DatabaseDto. - :param license: The license of this DatabaseDto. # noqa: E501 + :param database_license: The database_license of this DatabaseDto. # noqa: E501 :type: LicenseDto """ - self._license = license + self._database_license = database_license @property - def description(self): - """Gets the description of this DatabaseDto. # noqa: E501 + def database_description(self): + """Gets the database_description of this DatabaseDto. # noqa: E501 - :return: The description of this DatabaseDto. # noqa: E501 + :return: The database_description of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._description + return self._database_description - @description.setter - def description(self, description): - """Sets the description of this DatabaseDto. + @database_description.setter + def database_description(self, database_description): + """Sets the database_description of this DatabaseDto. - :param description: The description of this DatabaseDto. # noqa: E501 + :param database_description: The database_description of this DatabaseDto. # noqa: E501 :type: str """ + if database_description is None: + raise ValueError("Invalid value for `database_description`, must not be `None`") # noqa: E501 - self._description = description + self._database_description = database_description @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 + def database_publisher(self): + """Gets the database_publisher of this DatabaseDto. # noqa: E501 - :return: The publisher of this DatabaseDto. # noqa: E501 + :return: The database_publisher of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._publisher + return self._database_publisher - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. + @database_publisher.setter + def database_publisher(self, database_publisher): + """Sets the database_publisher of this DatabaseDto. - :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :param database_publisher: The database_publisher of this DatabaseDto. # noqa: E501 :type: str """ - self._publisher = publisher + self._database_publisher = database_publisher @property - def contact(self): - """Gets the contact of this DatabaseDto. # noqa: E501 + def database_contact_person(self): + """Gets the database_contact_person of this DatabaseDto. # noqa: E501 - :return: The contact of this DatabaseDto. # noqa: E501 + :return: The database_contact_person of this DatabaseDto. # noqa: E501 :rtype: UserDto """ - return self._contact + return self._database_contact_person - @contact.setter - def contact(self, contact): - """Sets the contact of this DatabaseDto. + @database_contact_person.setter + def database_contact_person(self, database_contact_person): + """Sets the database_contact_person of this DatabaseDto. - :param contact: The contact of this DatabaseDto. # noqa: E501 + :param database_contact_person: The database_contact_person of this DatabaseDto. # noqa: E501 :type: UserDto """ - self._contact = contact + self._database_contact_person = database_contact_person @property def tables(self): @@ -367,25 +379,25 @@ class DatabaseDto(object): self._tables = tables @property - def image(self): - """Gets the image of this DatabaseDto. # noqa: E501 + def database_container_image(self): + """Gets the database_container_image of this DatabaseDto. # noqa: E501 - :return: The image of this DatabaseDto. # noqa: E501 + :return: The database_container_image of this DatabaseDto. # noqa: E501 :rtype: ImageDto """ - return self._image + return self._database_container_image - @image.setter - def image(self, image): - """Sets the image of this DatabaseDto. + @database_container_image.setter + def database_container_image(self, database_container_image): + """Sets the database_container_image of this DatabaseDto. - :param image: The image of this DatabaseDto. # noqa: E501 + :param database_container_image: The database_container_image of this DatabaseDto. # noqa: E501 :type: ImageDto """ - self._image = image + self._database_container_image = database_container_image @property def container(self): @@ -409,25 +421,25 @@ class DatabaseDto(object): self._container = container @property - def created(self): - """Gets the created of this DatabaseDto. # noqa: E501 + def database_creation_time(self): + """Gets the database_creation_time of this DatabaseDto. # noqa: E501 - :return: The created of this DatabaseDto. # noqa: E501 + :return: The database_creation_time of this DatabaseDto. # noqa: E501 :rtype: datetime """ - return self._created + return self._database_creation_time - @created.setter - def created(self, created): - """Sets the created of this DatabaseDto. + @database_creation_time.setter + def database_creation_time(self, database_creation_time): + """Sets the database_creation_time of this DatabaseDto. - :param created: The created of this DatabaseDto. # noqa: E501 + :param database_creation_time: The database_creation_time of this DatabaseDto. # noqa: E501 :type: datetime """ - self._created = created + self._database_creation_time = database_creation_time @property def deleted(self): @@ -451,71 +463,111 @@ class DatabaseDto(object): self._deleted = deleted @property - def internal_name(self): - """Gets the internal_name of this DatabaseDto. # noqa: E501 + def database_internal_name(self): + """Gets the database_internal_name of this DatabaseDto. # noqa: E501 - :return: The internal_name of this DatabaseDto. # noqa: E501 + :return: The database_internal_name of this DatabaseDto. # noqa: E501 :rtype: str """ - return self._internal_name + return self._database_internal_name - @internal_name.setter - def internal_name(self, internal_name): - """Sets the internal_name of this DatabaseDto. + @database_internal_name.setter + def database_internal_name(self, database_internal_name): + """Sets the database_internal_name of this DatabaseDto. - :param internal_name: The internal_name of this DatabaseDto. # noqa: E501 + :param database_internal_name: The database_internal_name of this DatabaseDto. # noqa: E501 :type: str """ - if internal_name is None: - raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + if database_internal_name is None: + raise ValueError("Invalid value for `database_internal_name`, must not be `None`") # noqa: E501 - self._internal_name = internal_name + self._database_internal_name = database_internal_name @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 + def database_publication_year(self): + """Gets the database_publication_year of this DatabaseDto. # noqa: E501 - :return: The publication_year of this DatabaseDto. # noqa: E501 + :return: The database_publication_year of this DatabaseDto. # noqa: E501 :rtype: int """ - return self._publication_year + return self._database_publication_year - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. + @database_publication_year.setter + def database_publication_year(self, database_publication_year): + """Sets the database_publication_year of this DatabaseDto. - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :param database_publication_year: The database_publication_year of this DatabaseDto. # noqa: E501 :type: int """ - if publication_year is None: - raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - self._publication_year = publication_year + self._database_publication_year = database_publication_year @property - def is_public(self): - """Gets the is_public of this DatabaseDto. # noqa: E501 + def database_publication_month(self): + """Gets the database_publication_month of this DatabaseDto. # noqa: E501 - :return: The is_public of this DatabaseDto. # noqa: E501 + :return: The database_publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_month + + @database_publication_month.setter + def database_publication_month(self, database_publication_month): + """Sets the database_publication_month of this DatabaseDto. + + + :param database_publication_month: The database_publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_month = database_publication_month + + @property + def database_publication_day(self): + """Gets the database_publication_day of this DatabaseDto. # noqa: E501 + + + :return: The database_publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._database_publication_day + + @database_publication_day.setter + def database_publication_day(self, database_publication_day): + """Sets the database_publication_day of this DatabaseDto. + + + :param database_publication_day: The database_publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._database_publication_day = database_publication_day + + @property + def database_public(self): + """Gets the database_public of this DatabaseDto. # noqa: E501 + + + :return: The database_public of this DatabaseDto. # noqa: E501 :rtype: bool """ - return self._is_public + return self._database_public - @is_public.setter - def is_public(self, is_public): - """Sets the is_public of this DatabaseDto. + @database_public.setter + def database_public(self, database_public): + """Sets the database_public of this DatabaseDto. - :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :param database_public: The database_public of this DatabaseDto. # noqa: E501 :type: bool """ - self._is_public = is_public + self._database_public = database_public def to_dict(self): """Returns the model properties as a dict""" diff --git a/.jupyter/load_test.py b/.jupyter/load_test.py index 1336060476a256866612399cfa3030cbfb236a82..dcb161e82d01899b2538cbd0184d1af8f8345003 100755 --- a/.jupyter/load_test.py +++ b/.jupyter/load_test.py @@ -93,7 +93,6 @@ def start_container(container_id): def create_database(container_id, is_public=True): response = database.create({ "name": "Airquality " + str(uuid.uuid1()), - "description": "Hourly measurements in Zürich, Switzerland", "is_public": is_public }, container_id) print("created database with id %d" % response.id) @@ -106,7 +105,7 @@ def find_database(container_id, database_id): return response -def update_database(container_id, database_id, is_public=True): +def update_database(container_id, database_id): response = database.update({ "description": "This dataset includes daily values from 1983 to the current day, divided into annual files. This includes the maximum hourly average and the number of times the hourly average limit value for ozone was exceeded and the daily averages for sulfur dioxide (SO2), carbon monoxide (CO), nitrogen oxide (NOx), nitrogen monoxide (NO), nitrogen dioxide (NO2), particulate matter (PM10 and PM2.5). ) and particle number (PN), provided that they are of sufficient quality. The values of the completed day for the current year are updated every 30 minutes after midnight (UTC+1).", "publisher": "Technical University of Vienna", @@ -115,7 +114,6 @@ def update_database(container_id, database_id, is_public=True): "uri": "https://creativecommons.org/publicdomain/zero/1.0/legalcode" }, "language": "en", - "is_public": is_public, "publication_year": 2022 }, container_id, database_id) print("updated database with id %d" % response.id) @@ -211,6 +209,7 @@ def create_identifier(container_id, database_id, query_id, visibility="everyone" "qid": query_id, "title": "Airquality", "description": "Subset used for a scientific article", + "publisher": "TU Wien", "visibility": visibility, "creators": [{ "name": "Weise, Martin", diff --git a/fda-gateway-service/gateway/src/main/java/at/tuwien/config/GatewayConfig.java b/fda-gateway-service/gateway/src/main/java/at/tuwien/config/GatewayConfig.java index ec82ec861bbdb88d359573c9b719785322d9b03b..658f3f99d43804837b4ef4faf7358496f728d9a0 100644 --- a/fda-gateway-service/gateway/src/main/java/at/tuwien/config/GatewayConfig.java +++ b/fda-gateway-service/gateway/src/main/java/at/tuwien/config/GatewayConfig.java @@ -27,6 +27,11 @@ public class GatewayConfig { .method("POST", "GET", "PUT", "DELETE") .and() .uri("lb://analyse-service")) + .route("metadata-service", r -> r.path("/api/oai/**") + .and() + .method("POST", "GET", "PUT", "DELETE") + .and() + .uri("lb://metadata-service")) .route("identifier-service", r -> r.path("/api/pid/**", "/api/container/**/database/**/identifier/**") .and() diff --git a/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierCreateDto.java b/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierCreateDto.java index a35fc8b47abbe504c0806179541afacdacd18149..e1aceddb7741c754e2d00735ae6147e8fd27fd6e 100644 --- a/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierCreateDto.java +++ b/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierCreateDto.java @@ -47,6 +47,9 @@ public class IdentifierCreateDto { @Parameter(name = "publication month") private Integer publicationMonth; + @Parameter(name = "publisher", example = "TU Wien") + private String publisher; + @NotNull @JsonProperty("publication_year") @Parameter(name = "publication year") diff --git a/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierDto.java b/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierDto.java index 42763f8c31387a81466b732792a3c1ef30a6f269..56313a703e5df1d4c7a9576222607c9bad5ab957 100644 --- a/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierDto.java +++ b/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierDto.java @@ -82,6 +82,9 @@ public class IdentifierDto { @Parameter(name = "doi", example = "Digital Object Identifier") private String doi; + @Parameter(name = "publisher", example = "TU Wien") + private String publisher; + @NotNull @Parameter(name = "database creator") private UserDto creator; diff --git a/fda-metadata-db/entities/src/main/java/at/tuwien/entities/identifier/Identifier.java b/fda-metadata-db/entities/src/main/java/at/tuwien/entities/identifier/Identifier.java index d60289f8c4e5c0423947dc7a03125f13d4d25333..0853f1fb62eaa968690665ef31e4c2633662fef7 100644 --- a/fda-metadata-db/entities/src/main/java/at/tuwien/entities/identifier/Identifier.java +++ b/fda-metadata-db/entities/src/main/java/at/tuwien/entities/identifier/Identifier.java @@ -61,6 +61,9 @@ public class Identifier { @Column(nullable = false) private String description; + @Column(nullable = false) + private String publisher; + @Column(nullable = false) private String query; diff --git a/fda-metadata-db/oai/src/main/java/at/tuwien/OaiListIdentifiersParameters.java b/fda-metadata-db/oai/src/main/java/at/tuwien/OaiListIdentifiersParameters.java index 0b97f79e2e4ce4c04ef766b7e6668265d1b0ff06..0bb4b34d3b8a2fd2c31d41fb9daec0e47eef68c7 100644 --- a/fda-metadata-db/oai/src/main/java/at/tuwien/OaiListIdentifiersParameters.java +++ b/fda-metadata-db/oai/src/main/java/at/tuwien/OaiListIdentifiersParameters.java @@ -41,6 +41,7 @@ public class OaiListIdentifiersParameters extends RequestParameters { @Override public String getParametersString() { StringBuilder builder = new StringBuilder(); + appendIfNotEmpty(builder, "verb", "ListIdentifiers"); appendIfNotEmpty(builder, "metadataPrefix", this.getMetadataPrefix()); appendIfNotEmpty(builder, "from", this.getFrom()); appendIfNotEmpty(builder, "until", this.getUntil()); diff --git a/fda-metadata-db/oai/src/main/java/at/tuwien/OaiListRecordsParameters.java b/fda-metadata-db/oai/src/main/java/at/tuwien/OaiListRecordsParameters.java index 34f1a6d74a4db410854cbce778aeb6253ffea81c..90df3384c6fe3c6227fc13b44f383be6ef3acf13 100644 --- a/fda-metadata-db/oai/src/main/java/at/tuwien/OaiListRecordsParameters.java +++ b/fda-metadata-db/oai/src/main/java/at/tuwien/OaiListRecordsParameters.java @@ -41,6 +41,7 @@ public class OaiListRecordsParameters extends RequestParameters { @Override public String getParametersString() { StringBuilder builder = new StringBuilder(); + appendIfNotEmpty(builder, "verb", "ListRecords"); appendIfNotEmpty(builder, "metadataPrefix", this.getMetadataPrefix()); appendIfNotEmpty(builder, "from", this.getFrom()); appendIfNotEmpty(builder, "until", this.getUntil()); diff --git a/fda-metadata-db/oai/src/main/java/at/tuwien/OaiRecordParameters.java b/fda-metadata-db/oai/src/main/java/at/tuwien/OaiRecordParameters.java new file mode 100644 index 0000000000000000000000000000000000000000..6dcb5ec0d0d706907d049a34d7450551a588a607 --- /dev/null +++ b/fda-metadata-db/oai/src/main/java/at/tuwien/OaiRecordParameters.java @@ -0,0 +1,31 @@ +package at.tuwien; + +import lombok.*; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateUtils; + +import java.text.ParseException; +import java.util.Date; + +@Getter +@Setter +@ToString +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class OaiRecordParameters extends RequestParameters { + + private String identifier; + private String metadataPrefix; + + @Override + public String getParametersString() { + StringBuilder builder = new StringBuilder(); + appendIfNotEmpty(builder, "verb", "GetRecord"); + appendIfNotEmpty(builder, "metadataPrefix", this.getMetadataPrefix()); + appendIfNotEmpty(builder, "identifier", this.getIdentifier()); + + return builder.toString(); + } + +} \ No newline at end of file diff --git a/fda-metadata-db/setup-schema.sql b/fda-metadata-db/setup-schema.sql index 5d3efce23f1eb315b9efc2bf6c9a8e5afe77b9ca..e7ae1b1aae1049913b230483007b5673f337229d 100644 --- a/fda-metadata-db/setup-schema.sql +++ b/fda-metadata-db/setup-schema.sql @@ -457,6 +457,7 @@ CREATE TABLE IF NOT EXISTS mdb_identifiers cid bigint NOT NULL, dbid bigint NOT NULL, qid bigint NOT NULL, + publisher VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, description TEXT NOT NULL, visibility VARCHAR(10) NOT NULL DEFAULT 'SELF', diff --git a/fda-metadata-service/README.md b/fda-metadata-service/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2b9e354befb0b72ab97925282256765224bef0f6 --- /dev/null +++ b/fda-metadata-service/README.md @@ -0,0 +1,34 @@ +# Metadata Service + +Conforms (partly) to OAI-PMH 2.0 + +THe exposed endpoint is `http://localhost:9098/api/oai` or at the gateway `http://localhost:9095/api/oai` + +## Implemented + +### Identify + +```console +$ curl -X GET http://localhost:9095/api/oai?verb=Identify +<?xml version='1.0' encoding='UTF-8'?> +<OAI-PMH xmlns='http://www.openarchives.org/OAI/2.0/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' + xsi:schemaLocation='http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd'> + <responseDate>2022-09-17T20:07:30Z</responseDate> + <request verb="Identify">https://metadata-service:9098/api/oai</request> + <Identify> + <repositoryName>Example Repository</repositoryName> + <baseURL>https://example.com</baseURL> + <protocolVersion>2.0</protocolVersion> + <adminEmail>noreply@example.com</adminEmail> + <earliestDatestamp>2022-09-17T18:23:00Z</earliestDatestamp> + <deletedRecord>persistent</deletedRecord> + <granularity>YYYY-MM-DDThh:mm:ssZ</granularity> +</Identify> +</OAI-PMH>( +``` + +### ListIdentifiers + +```console +$ curl -X GET http://localhost:9095/api/oai?verb=ListIdentifiers +``` \ No newline at end of file diff --git a/fda-metadata-service/rest-service/src/main/java/at/tuwien/endpoints/MetadataEndpoint.java b/fda-metadata-service/rest-service/src/main/java/at/tuwien/endpoints/MetadataEndpoint.java index 14a3572e59ea5bd982fd48c1f302cfe19e2ce7b4..38a13c878c59204cf8cba8567f9a3d0566f9ef72 100644 --- a/fda-metadata-service/rest-service/src/main/java/at/tuwien/endpoints/MetadataEndpoint.java +++ b/fda-metadata-service/rest-service/src/main/java/at/tuwien/endpoints/MetadataEndpoint.java @@ -2,18 +2,19 @@ package at.tuwien.endpoints; import at.tuwien.OaiErrorType; import at.tuwien.OaiListIdentifiersParameters; -import at.tuwien.OaiListRecordsParameters; +import at.tuwien.OaiRecordParameters; +import at.tuwien.exception.IdentifierNotFoundException; +import at.tuwien.service.IdentifierService; import at.tuwien.service.MetadataService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.ws.rs.core.Response; - @Log4j2 @CrossOrigin(origins = "*") @RestController @@ -21,10 +22,12 @@ import javax.ws.rs.core.Response; public class MetadataEndpoint extends AbstractEndpoint { private final MetadataService metadataService; + private final IdentifierService identifierService; @Autowired - public MetadataEndpoint(MetadataService metadataService) { + public MetadataEndpoint(MetadataService metadataService, IdentifierService identifierService) { this.metadataService = metadataService; + this.identifierService = identifierService; } @GetMapping(produces = "text/xml;charset=UTF-8") @@ -48,4 +51,31 @@ public class MetadataEndpoint extends AbstractEndpoint { return ResponseEntity.ok(metadataService.listIdentifiers(parameters)); } + @GetMapping(params = "verb=GetRecord", produces = "text/xml;charset=UTF-8") + @Operation(summary = "Get the record") + @Parameter(name = "verb", example = "GetRecord") + public ResponseEntity<?> getRecord(OaiRecordParameters parameters) { + if (!parameters.getMetadataPrefix().equals("oai_dc")) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST) + .body(metadataService.error(OaiErrorType.CANNOT_DISSEMINATE_FORMAT)); + } + if (parameters.getIdentifier() == null || !NumberUtils.isCreatable(parameters.getIdentifier())) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST) + .body(metadataService.error(OaiErrorType.NO_RECORDS_MATCH)); + } + try { + return ResponseEntity.ok(metadataService.getRecord(parameters)); + } catch (IdentifierNotFoundException e) { + return ResponseEntity.status(HttpStatus.NOT_FOUND) + .body(metadataService.error(OaiErrorType.ID_DOES_NOT_EXIST)); + } + } + + @GetMapping(params = "verb=ListMetadataFormats", produces = "text/xml;charset=UTF-8") + @Operation(summary = "List the metadata formats") + @Parameter(name = "verb", example = "ListMetadataFormats") + public ResponseEntity<?> listMetadataFormats() { + return ResponseEntity.ok(metadataService.listMetadataFormats()); + } + } diff --git a/fda-metadata-service/rest-service/src/main/resources/templates/identifier.xml b/fda-metadata-service/rest-service/src/main/resources/templates/identifier.xml new file mode 100644 index 0000000000000000000000000000000000000000..f00f782eddc68f8ed65093147688f483710b0c75 --- /dev/null +++ b/fda-metadata-service/rest-service/src/main/resources/templates/identifier.xml @@ -0,0 +1,4 @@ +<header> + <identifier>[[${identifier}]]</identifier> + <datestamp>[[${datestamp}]]</datestamp> +</header> \ No newline at end of file diff --git a/fda-metadata-service/rest-service/src/main/resources/templates/metadata-format.xml b/fda-metadata-service/rest-service/src/main/resources/templates/metadata-format.xml new file mode 100644 index 0000000000000000000000000000000000000000..24c5780b88de2b0496947b92862a11dd50445935 --- /dev/null +++ b/fda-metadata-service/rest-service/src/main/resources/templates/metadata-format.xml @@ -0,0 +1,5 @@ +<metadataFormat> + <metadataPrefix>oai_dc</metadataPrefix> + <schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema> + <metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace> +</metadataFormat> \ No newline at end of file diff --git a/fda-metadata-service/rest-service/src/main/resources/templates/record.xml b/fda-metadata-service/rest-service/src/main/resources/templates/record.xml index f00f782eddc68f8ed65093147688f483710b0c75..e05aad5df1357209bcdccef1ea827f6b3207ae3d 100644 --- a/fda-metadata-service/rest-service/src/main/resources/templates/record.xml +++ b/fda-metadata-service/rest-service/src/main/resources/templates/record.xml @@ -1,4 +1,17 @@ -<header> - <identifier>[[${identifier}]]</identifier> - <datestamp>[[${datestamp}]]</datestamp> -</header> \ No newline at end of file +<GetRecord> + <record> + <header> + <identifier>[[${identifier}]]</identifier> + <datestamp>[[${datestamp}]]</datestamp> + </header> + <metadata> + <oai_dc:dc xmlns="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> + <dc:identifier>[[${identifier}]]</dc:identifier> + <dc:title>[[${title}]]</dc:title> + <dc:publisher>[[${publisher}]]</dc:publisher> + <dc:description>[[${description}]]</dc:description> + [(${creators})] + </oai_dc:dc> + </metadata> + </record> +</GetRecord> \ No newline at end of file diff --git a/fda-metadata-service/services/src/main/java/at/tuwien/exception/IdentifierNotFoundException.java b/fda-metadata-service/services/src/main/java/at/tuwien/exception/IdentifierNotFoundException.java new file mode 100644 index 0000000000000000000000000000000000000000..9a844d7651439a897041f060709c242e3dbf9332 --- /dev/null +++ b/fda-metadata-service/services/src/main/java/at/tuwien/exception/IdentifierNotFoundException.java @@ -0,0 +1,20 @@ +package at.tuwien.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(code = HttpStatus.NOT_FOUND) +public class IdentifierNotFoundException extends Exception { + + public IdentifierNotFoundException(String msg) { + super(msg); + } + + public IdentifierNotFoundException(String msg, Throwable thr) { + super(msg, thr); + } + + public IdentifierNotFoundException(Throwable thr) { + super(thr); + } +} diff --git a/fda-metadata-service/services/src/main/java/at/tuwien/service/IdentifierService.java b/fda-metadata-service/services/src/main/java/at/tuwien/service/IdentifierService.java index db6bd737a16811aca36402ab419739ac78aaa007..896e04675f15c7f8574ba991211fd7fca289a460 100644 --- a/fda-metadata-service/services/src/main/java/at/tuwien/service/IdentifierService.java +++ b/fda-metadata-service/services/src/main/java/at/tuwien/service/IdentifierService.java @@ -1,9 +1,12 @@ package at.tuwien.service; import at.tuwien.entities.identifier.Identifier; +import at.tuwien.exception.IdentifierNotFoundException; import java.util.List; public interface IdentifierService { List<Identifier> findAll(); + + Identifier find(Long id) throws IdentifierNotFoundException; } diff --git a/fda-metadata-service/services/src/main/java/at/tuwien/service/MetadataService.java b/fda-metadata-service/services/src/main/java/at/tuwien/service/MetadataService.java index 0816eb56c0e2e6e068abb5081cfcb5152b56f55d..43c3d8dfb58aea177734605a8f45588db6421e2c 100644 --- a/fda-metadata-service/services/src/main/java/at/tuwien/service/MetadataService.java +++ b/fda-metadata-service/services/src/main/java/at/tuwien/service/MetadataService.java @@ -2,6 +2,8 @@ package at.tuwien.service; import at.tuwien.OaiErrorType; import at.tuwien.OaiListIdentifiersParameters; +import at.tuwien.OaiRecordParameters; +import at.tuwien.exception.IdentifierNotFoundException; public interface MetadataService { @@ -12,5 +14,9 @@ public interface MetadataService { String listIdentifiers(OaiListIdentifiersParameters parameters); + String getRecord(OaiRecordParameters parameters) throws IdentifierNotFoundException; + + String listMetadataFormats(); + String error(OaiErrorType type); } diff --git a/fda-metadata-service/services/src/main/java/at/tuwien/service/impl/IdentifierServiceImpl.java b/fda-metadata-service/services/src/main/java/at/tuwien/service/impl/IdentifierServiceImpl.java index 867c3768f4ff84462a470d4468722f717919d3c1..5b87576ad931e97454d02827d94d9b4b4f470856 100644 --- a/fda-metadata-service/services/src/main/java/at/tuwien/service/impl/IdentifierServiceImpl.java +++ b/fda-metadata-service/services/src/main/java/at/tuwien/service/impl/IdentifierServiceImpl.java @@ -1,13 +1,18 @@ package at.tuwien.service.impl; import at.tuwien.entities.identifier.Identifier; +import at.tuwien.exception.IdentifierNotFoundException; import at.tuwien.repository.jpa.IdentifierRepository; import at.tuwien.service.IdentifierService; +import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; +import java.util.Optional; +@Log4j2 @Service public class IdentifierServiceImpl implements IdentifierService { @@ -19,7 +24,19 @@ public class IdentifierServiceImpl implements IdentifierService { } @Override + @Transactional(readOnly = true) public List<Identifier> findAll() { return identifierRepository.findAll(); } + + @Override + @Transactional(readOnly = true) + public Identifier find(Long id) throws IdentifierNotFoundException { + final Optional<Identifier> optional = identifierRepository.findById(id); + if (optional.isEmpty()) { + log.error("Failed to find identifier with id {}", id); + throw new IdentifierNotFoundException("Failed to find identifier"); + } + return optional.get(); + } } diff --git a/fda-metadata-service/services/src/main/java/at/tuwien/service/impl/MetadataServiceImpl.java b/fda-metadata-service/services/src/main/java/at/tuwien/service/impl/MetadataServiceImpl.java index c9e09dc4dff03bb322afa8ccc71b502e7401300d..b14e2842d57375ca74d347f3ed7501de1643f9ac 100644 --- a/fda-metadata-service/services/src/main/java/at/tuwien/service/impl/MetadataServiceImpl.java +++ b/fda-metadata-service/services/src/main/java/at/tuwien/service/impl/MetadataServiceImpl.java @@ -2,13 +2,16 @@ package at.tuwien.service.impl; import at.tuwien.OaiErrorType; import at.tuwien.OaiListIdentifiersParameters; +import at.tuwien.OaiRecordParameters; import at.tuwien.config.MetadataConfig; import at.tuwien.entities.identifier.Identifier; +import at.tuwien.exception.IdentifierNotFoundException; import at.tuwien.mapper.MetadataMapper; import at.tuwien.service.IdentifierService; import at.tuwien.service.MetadataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.Context; @@ -47,6 +50,7 @@ public class MetadataServiceImpl implements MetadataService { } @Override + @Transactional(readOnly = true) public String listIdentifiers(OaiListIdentifiersParameters parameters) { final StringBuilder builder = new StringBuilder("<ListIdentifiers>"); final List<Identifier> identifiers = identifierService.findAll(); @@ -54,12 +58,40 @@ public class MetadataServiceImpl implements MetadataService { final Context context = new Context(); context.setVariable("identifier", metadataConfig.getPidBase() + identifier.getId()); context.setVariable("datestamp", metadataMapper.instantToDatestamp(identifier.getCreated())); - builder.append(templateEngine.process("record.xml", context)); + builder.append(templateEngine.process("identifier.xml", context)); }); builder.append("</ListIdentifiers>"); return parseResponse(parameters.getParametersString(), builder.toString()); } + @Override + @Transactional(readOnly = true) + public String getRecord(OaiRecordParameters parameters) throws IdentifierNotFoundException { + final Long id = Long.parseLong(parameters.getIdentifier()); + final Identifier identifier = identifierService.find(id); + final StringBuilder builder = new StringBuilder(); + final Context context = new Context(); + context.setVariable("identifier", identifier.getId()); + context.setVariable("datestamp", metadataMapper.instantToDatestamp(identifier.getCreated())); + context.setVariable("title", identifier.getTitle()); + context.setVariable("description", identifier.getDescription()); + context.setVariable("publisher", identifier.getPublisher()); + identifier.getCreators() + .forEach(c -> builder.append("<dc:creator>") + .append(c.getName()) + .append("</dc:creator>")); + context.setVariable("creators", builder.toString()); + return parseResponse(parameters.getParametersString(), templateEngine.process("record.xml", context)); + } + + @Override + public String listMetadataFormats() { + final StringBuilder builder = new StringBuilder("<ListMetadataFormats>"); + builder.append(templateEngine.process("metadata-format.xml", new Context())); + builder.append("</ListMetadataFormats>"); + return parseResponse("verb=\"ListMetadataFormats\"", builder.toString()); + } + @Override public String error(OaiErrorType type) { final Context context = new Context(); @@ -76,13 +108,17 @@ public class MetadataServiceImpl implements MetadataService { } private String parseResponse(String body) { - return parseResponse("", body); + return parseResponse(null, body); } private String parseResponse(String parameterString, String body) { final Context context = new Context(); context.setVariable("responseDate", metadataMapper.instantToDatestamp(Instant.now())); - context.setVariable("request", "<request" + (parameterString != null ? parameterString : "") + ">" + requestUrl() + "</request>"); + if (parameterString == null) { + context.setVariable("request", "<request>" + requestUrl() + "</request>"); + } else { + context.setVariable("request", "<request " + parameterString + ">" + requestUrl() + "</request>"); + } context.setVariable("body", body); return templateEngine.process("_header.xml", context); } diff --git a/fda-ui/components/dialogs/PersistQuery.vue b/fda-ui/components/dialogs/PersistQuery.vue index 3562ce7b47daafdf1b2bbc989dc82f7b2bc33109..2a0e5feba8cc77b2968c25e37efb612cfded7562 100644 --- a/fda-ui/components/dialogs/PersistQuery.vue +++ b/fda-ui/components/dialogs/PersistQuery.vue @@ -3,13 +3,13 @@ <v-card> <v-progress-linear v-if="loading" :color="loadingColor" :indeterminate="!error" /> <v-card-title> - Persist Query and Result + Persist Subset and Result </v-card-title> <v-card-text> <v-alert border="left" color="info"> - Choose an expressive query title and describe what result the query produces. + Choose an expressive subset title and describe what it produces. </v-alert> <v-form v-model="formValid" autocomplete="off"> <v-row dense> @@ -18,7 +18,7 @@ id="title" v-model="identifier.title" name="title" - label="Query Title *" + label="Subset Title *" :rules="[v => !!v || $t('Required')]" required /> <v-textarea @@ -31,6 +31,17 @@ required /> </v-col> </v-row> + <v-row dense> + <v-col> + <v-text-field + id="publisher" + v-model="identifier.publisher" + name="publisher" + label="Subset Publisher *" + :rules="[v => !!v || $t('Required')]" + required /> + </v-col> + </v-row> <v-row> <v-col cols="2"> <v-text-field @@ -254,6 +265,7 @@ export default { qid: parseInt(this.$route.params.query_id), title: null, description: null, + publisher: null, publication_year: formatYearUTC(Date.now()), publication_month: formatMonthUTC(Date.now()), publication_day: formatDayUTC(Date.now()), diff --git a/fda-ui/pages/container/_container_id/database/_database_id/query/_query_id/index.vue b/fda-ui/pages/container/_container_id/database/_database_id/query/_query_id/index.vue index 46753c5855698edd570cb6ce5e048a74c1d8ee91..5eddd3ff02c3fc4619588a9320f181fde56bd405 100644 --- a/fda-ui/pages/container/_container_id/database/_database_id/query/_query_id/index.vue +++ b/fda-ui/pages/container/_container_id/database/_database_id/query/_query_id/index.vue @@ -89,6 +89,12 @@ <v-list-item-content> {{ identifier.description }} </v-list-item-content> + <v-list-item-title class="mt-2"> + Publisher + </v-list-item-title> + <v-list-item-content> + {{ identifier.publisher }} + </v-list-item-content> <v-list-item-title class="mt-2"> Creators </v-list-item-title> @@ -276,6 +282,7 @@ export default { qid: null, title: null, description: null, + publisher: null, visibility: null, query: null, query_normalized: null,