diff --git a/swagger/api-query.yaml b/swagger/api-query.yaml index 718b3faa2ff50e4c49711a97ccbadfd8222289aa..b41ce8f4a3f9c06531209e7f725f76a5e6111ade 100644 --- a/swagger/api-query.yaml +++ b/swagger/api-query.yaml @@ -21,7 +21,7 @@ paths: tags: - table-history-endpoint summary: Find all history - operationId: getAll_1 + operationId: getAll parameters: - name: id in: path @@ -86,7 +86,7 @@ paths: tags: - table-history-endpoint summary: Find all history - operationId: getAll + operationId: getAll_1 parameters: - name: id in: path @@ -152,7 +152,7 @@ paths: tags: - table-data-endpoint summary: Find data - operationId: getAll_3 + operationId: getAll_2 parameters: - name: id in: path @@ -428,7 +428,7 @@ paths: tags: - table-data-endpoint summary: Find data - operationId: getAll_2 + operationId: getAll_3 parameters: - name: id in: path @@ -640,12 +640,12 @@ paths: $ref: '#/components/schemas/QueryResultDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/query/{queryId}: - get: + /api/container/{id}/database/{databaseId}/table/{tableId}/data/import: + post: tags: - - store-endpoint - summary: Find some query - operationId: find + - table-data-endpoint + summary: Insert data from csv + operationId: importCsv parameters: - name: id in: path @@ -659,12 +659,18 @@ paths: schema: type: integer format: int64 - - name: queryId + - name: tableId in: path required: true schema: type: integer format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImportDto' + required: true responses: "404": description: Not Found @@ -698,17 +704,14 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK - content: - '*/*': - schema: - $ref: '#/components/schemas/QueryDto' security: - bearerAuth: [] - put: + /api/container/{id}/database/{databaseId}/table/{tableId}/export: + get: tags: - - query-endpoint - summary: Re-execute some query - operationId: reExecute + - export-endpoint + summary: Export table + operationId: export parameters: - name: id in: path @@ -722,24 +725,18 @@ paths: schema: type: integer format: int64 - - name: queryId + - name: tableId in: path required: true schema: type: integer format: int64 - - name: page - in: query - required: false - schema: - type: integer - format: int64 - - name: size + - name: timestamp in: query required: false schema: - type: integer - format: int64 + type: string + format: date-time responses: "404": description: Not Found @@ -776,15 +773,16 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/QueryResultDto' + type: string + format: binary security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/table/{tableId}/data/import: - post: + /api/container/{id}/database/{databaseId}/query/{queryId}: + get: tags: - - table-data-endpoint - summary: Insert data from csv - operationId: importCsv + - store-endpoint + summary: Find some query + operationId: find parameters: - name: id in: path @@ -798,18 +796,12 @@ paths: schema: type: integer format: int64 - - name: tableId + - name: queryId in: path required: true schema: type: integer format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ImportDto' - required: true responses: "404": description: Not Found @@ -843,14 +835,18 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/QueryDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/table/{tableId}/export: + /api/container/{id}/database/{databaseId}/query/{queryId}/export: get: tags: - - export-endpoint - summary: Export table - operationId: export + - query-endpoint + summary: Exports some query + operationId: export_1 parameters: - name: id in: path @@ -864,18 +860,12 @@ paths: schema: type: integer format: int64 - - name: tableId + - name: queryId in: path required: true schema: type: integer format: int64 - - name: timestamp - in: query - required: false - schema: - type: string - format: date-time responses: "404": description: Not Found @@ -916,12 +906,12 @@ paths: format: binary security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/query/{queryId}/export: + /api/container/{id}/database/{databaseId}/query/{queryId}/data: get: tags: - query-endpoint - summary: Exports some query - operationId: export_1 + summary: Re-execute some query + operationId: reExecute parameters: - name: id in: path @@ -941,6 +931,18 @@ paths: schema: type: integer format: int64 + - name: page + in: query + required: false + schema: + type: integer + format: int64 + - name: size + in: query + required: false + schema: + type: integer + format: int64 responses: "404": description: Not Found @@ -977,8 +979,7 @@ paths: content: '*/*': schema: - type: string - format: binary + $ref: '#/components/schemas/QueryResultDto' security: - bearerAuth: [] components: diff --git a/swagger/api/__init__.py b/swagger/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/swagger/api/api_authentication/__init__.py b/swagger/api/api_authentication/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c20f434f5ee3610077bb2fd6ec91f8a21f5ca08a --- /dev/null +++ b/swagger/api/api_authentication/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi +from api_authentication.api.token_endpoint_api import TokenEndpointApi +from api_authentication.api.user_endpoint_api import UserEndpointApi +# import ApiClient +from api_authentication.api_client import ApiClient +from api_authentication.configuration import Configuration +# import models into sdk package +from api_authentication.models.api_error_dto import ApiErrorDto +from api_authentication.models.container_dto import ContainerDto +from api_authentication.models.database_dto import DatabaseDto +from api_authentication.models.granted_authority_dto import GrantedAuthorityDto +from api_authentication.models.image_brief_dto import ImageBriefDto +from api_authentication.models.image_date_dto import ImageDateDto +from api_authentication.models.image_dto import ImageDto +from api_authentication.models.image_env_item_dto import ImageEnvItemDto +from api_authentication.models.jwt_response_dto import JwtResponseDto +from api_authentication.models.license_dto import LicenseDto +from api_authentication.models.login_request_dto import LoginRequestDto +from api_authentication.models.signup_request_dto import SignupRequestDto +from api_authentication.models.table_brief_dto import TableBriefDto +from api_authentication.models.user_brief_dto import UserBriefDto +from api_authentication.models.user_dto import UserDto +from api_authentication.models.user_email_dto import UserEmailDto +from api_authentication.models.user_forgot_dto import UserForgotDto +from api_authentication.models.user_password_dto import UserPasswordDto +from api_authentication.models.user_reset_dto import UserResetDto +from api_authentication.models.user_roles_dto import UserRolesDto +from api_authentication.models.user_theme_set_dto import UserThemeSetDto +from api_authentication.models.user_update_dto import UserUpdateDto diff --git a/swagger/api/api_authentication/api/__init__.py b/swagger/api/api_authentication/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9643d433a897d442036202f72e292b7b4cf0c6d5 --- /dev/null +++ b/swagger/api/api_authentication/api/__init__.py @@ -0,0 +1,8 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi +from api_authentication.api.token_endpoint_api import TokenEndpointApi +from api_authentication.api.user_endpoint_api import UserEndpointApi diff --git a/swagger/api/api_authentication/api/authentication_endpoint_api.py b/swagger/api/api_authentication/api/authentication_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..93d09fe07770eca0410a7e84df665ee639805114 --- /dev/null +++ b/swagger/api/api_authentication/api/authentication_endpoint_api.py @@ -0,0 +1,300 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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_authentication.api_client import ApiClient + + +class AuthenticationEndpointApi(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 authenticate_user(self, **kwargs): # noqa: E501 + """Validate token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authenticate_user(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.authenticate_user_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.authenticate_user_with_http_info(**kwargs) # noqa: E501 + return data + + def authenticate_user_with_http_info(self, **kwargs): # noqa: E501 + """Validate token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authenticate_user_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # 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 authenticate_user" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/auth', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserDto', # 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 authenticate_user1(self, body, **kwargs): # noqa: E501 + """Create token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authenticate_user1(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param LoginRequestDto body: (required) + :return: JwtResponseDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.authenticate_user1_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.authenticate_user1_with_http_info(body, **kwargs) # noqa: E501 + return data + + def authenticate_user1_with_http_info(self, body, **kwargs): # noqa: E501 + """Create token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authenticate_user1_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param LoginRequestDto body: (required) + :return: JwtResponseDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 authenticate_user1" % 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 `authenticate_user1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/auth', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='JwtResponseDto', # 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 re_authenticate_user(self, **kwargs): # noqa: E501 + """Renew token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.re_authenticate_user(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: JwtResponseDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.re_authenticate_user_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.re_authenticate_user_with_http_info(**kwargs) # noqa: E501 + return data + + def re_authenticate_user_with_http_info(self, **kwargs): # noqa: E501 + """Renew token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.re_authenticate_user_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: JwtResponseDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # 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 re_authenticate_user" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/auth/renew', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='JwtResponseDto', # 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/swagger/api/api_authentication/api/token_endpoint_api.py b/swagger/api/api_authentication/api/token_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..d00b8ecc1bf1722274513f9978e69735c7901af0 --- /dev/null +++ b/swagger/api/api_authentication/api/token_endpoint_api.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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_authentication.api_client import ApiClient + + +class TokenEndpointApi(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 resend(self, body, **kwargs): # noqa: E501 + """resend user token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resend(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserForgotDto body: (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.resend_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.resend_with_http_info(body, **kwargs) # noqa: E501 + return data + + def resend_with_http_info(self, body, **kwargs): # noqa: E501 + """resend user token # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resend_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserForgotDto body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 resend" % 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 `resend`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/user/token/resend', 'POST', + 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) + + def verify_email(self, token, **kwargs): # noqa: E501 + """verify user email # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.verify_email(token, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str token: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.verify_email_with_http_info(token, **kwargs) # noqa: E501 + else: + (data) = self.verify_email_with_http_info(token, **kwargs) # noqa: E501 + return data + + def verify_email_with_http_info(self, token, **kwargs): # noqa: E501 + """verify user email # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.verify_email_with_http_info(token, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str token: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['token'] # 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 verify_email" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'token' is set + if ('token' not in params or + params['token'] is None): + raise ValueError("Missing the required parameter `token` when calling `verify_email`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'token' in params: + query_params.append(('token', params['token'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/user/token', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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/swagger/api/api_authentication/api/user_endpoint_api.py b/swagger/api/api_authentication/api/user_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..e6a913e11433557346ee7cab11c9632d90d8bdfd --- /dev/null +++ b/swagger/api/api_authentication/api/user_endpoint_api.py @@ -0,0 +1,1027 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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_authentication.api_client import ApiClient + + +class UserEndpointApi(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 find(self, id, **kwargs): # noqa: E501 + """Find some user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.find_with_http_info(id, **kwargs) # noqa: E501 + return data + + def find_with_http_info(self, id, **kwargs): # noqa: E501 + """Find some user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/user/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserDto', # 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 forgot(self, body, **kwargs): # noqa: E501 + """Forgot user information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.forgot(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserForgotDto body: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.forgot_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.forgot_with_http_info(body, **kwargs) # noqa: E501 + return data + + def forgot_with_http_info(self, body, **kwargs): # noqa: E501 + """Forgot user information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.forgot_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserForgotDto body: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 forgot" % 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 `forgot`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/user', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserDto', # 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 list(self, **kwargs): # noqa: E501 + """List users # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[UserBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_with_http_info(**kwargs) # noqa: E501 + return data + + def list_with_http_info(self, **kwargs): # noqa: E501 + """List users # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[UserBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # 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 list" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/user', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + 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'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def register(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.register(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SignupRequestDto body: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.register_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.register_with_http_info(body, **kwargs) # noqa: E501 + return data + + def register_with_http_info(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.register_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SignupRequestDto body: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 register" % 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 `register`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/user', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserDto', # 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 reset(self, body, **kwargs): # noqa: E501 + """Reset user information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.reset(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserResetDto body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.reset_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.reset_with_http_info(body, **kwargs) # noqa: E501 + return data + + def reset_with_http_info(self, body, **kwargs): # noqa: E501 + """Reset user information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.reset_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserResetDto body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 reset" % 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 `reset`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/user/reset', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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, **kwargs): # noqa: E501 + """Update user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserUpdateDto body: (required) + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def update_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Update user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserUpdateDto body: (required) + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 update" % 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 `update`") # 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 `update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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/user/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserDto', # 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_email(self, body, id, **kwargs): # noqa: E501 + """Update user email # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_email(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserEmailDto body: (required) + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_email_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.update_email_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def update_email_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Update user email # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_email_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserEmailDto body: (required) + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 update_email" % 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 `update_email`") # 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 `update_email`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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/user/{id}/email', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserDto', # 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_password(self, body, id, **kwargs): # noqa: E501 + """Update user password # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_password(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserPasswordDto body: (required) + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_password_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.update_password_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def update_password_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Update user password # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_password_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserPasswordDto body: (required) + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 update_password" % 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 `update_password`") # 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 `update_password`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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/user/{id}/password', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserDto', # 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_roles(self, body, id, **kwargs): # noqa: E501 + """Update user roles # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_roles(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserRolesDto body: (required) + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_roles_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.update_roles_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def update_roles_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Update user roles # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_roles_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserRolesDto body: (required) + :param int id: (required) + :return: UserDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 update_roles" % 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 `update_roles`") # 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 `update_roles`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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/user/{id}/roles', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserDto', # 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_theme(self, body, id, **kwargs): # noqa: E501 + """Update user theme # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_theme(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserThemeSetDto body: (required) + :param int id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_theme_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.update_theme_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def update_theme_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Update user theme # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_theme_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserThemeSetDto body: (required) + :param int id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 update_theme" % 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 `update_theme`") # 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 `update_theme`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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/user/{id}/theme', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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/swagger/api/api_authentication/api_client.py b/swagger/api/api_authentication/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..de8d2dd6db1dc84a9044893e899af33dd63fda4a --- /dev/null +++ b/swagger/api/api_authentication/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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_authentication.configuration import Configuration +import api_authentication.models +from api_authentication 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_authentication.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/swagger/api/api_authentication/configuration.py b/swagger/api/api_authentication/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..2638b5e36f20bba23c9228abf90fd54e7d31fd14 --- /dev/null +++ b/swagger/api/api_authentication/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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_authentication") + 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/swagger/api/api_authentication/models/__init__.py b/swagger/api/api_authentication/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fc192aa3f48fc29eb41b993849da77e1a52b8001 --- /dev/null +++ b/swagger/api/api_authentication/models/__init__.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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_authentication.models.api_error_dto import ApiErrorDto +from api_authentication.models.container_dto import ContainerDto +from api_authentication.models.database_dto import DatabaseDto +from api_authentication.models.granted_authority_dto import GrantedAuthorityDto +from api_authentication.models.image_brief_dto import ImageBriefDto +from api_authentication.models.image_date_dto import ImageDateDto +from api_authentication.models.image_dto import ImageDto +from api_authentication.models.image_env_item_dto import ImageEnvItemDto +from api_authentication.models.jwt_response_dto import JwtResponseDto +from api_authentication.models.license_dto import LicenseDto +from api_authentication.models.login_request_dto import LoginRequestDto +from api_authentication.models.signup_request_dto import SignupRequestDto +from api_authentication.models.table_brief_dto import TableBriefDto +from api_authentication.models.user_brief_dto import UserBriefDto +from api_authentication.models.user_dto import UserDto +from api_authentication.models.user_email_dto import UserEmailDto +from api_authentication.models.user_forgot_dto import UserForgotDto +from api_authentication.models.user_password_dto import UserPasswordDto +from api_authentication.models.user_reset_dto import UserResetDto +from api_authentication.models.user_roles_dto import UserRolesDto +from api_authentication.models.user_theme_set_dto import UserThemeSetDto +from api_authentication.models.user_update_dto import UserUpdateDto diff --git a/swagger/api/api_authentication/models/api_error_dto.py b/swagger/api/api_authentication/models/api_error_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ec3987847430c4d71f515142d6ed2dcf1678e3c2 --- /dev/null +++ b/swagger/api/api_authentication/models/api_error_dto.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 ApiErrorDto(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 = { + 'status': 'str', + 'message': 'str', + 'code': 'str' + } + + attribute_map = { + 'status': 'status', + 'message': 'message', + 'code': 'code' + } + + def __init__(self, status=None, message=None, code=None): # noqa: E501 + """ApiErrorDto - a model defined in Swagger""" # noqa: E501 + self._status = None + self._message = None + self._code = None + self.discriminator = None + self.status = status + self.message = message + self.code = code + + @property + def status(self): + """Gets the status of this ApiErrorDto. # noqa: E501 + + + :return: The status of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ApiErrorDto. + + + :param status: The status of this ApiErrorDto. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["100 CONTINUE", "101 SWITCHING_PROTOCOLS", "102 PROCESSING", "103 CHECKPOINT", "200 OK", "201 CREATED", "202 ACCEPTED", "203 NON_AUTHORITATIVE_INFORMATION", "204 NO_CONTENT", "205 RESET_CONTENT", "206 PARTIAL_CONTENT", "207 MULTI_STATUS", "208 ALREADY_REPORTED", "226 IM_USED", "300 MULTIPLE_CHOICES", "301 MOVED_PERMANENTLY", "302 FOUND", "302 MOVED_TEMPORARILY", "303 SEE_OTHER", "304 NOT_MODIFIED", "305 USE_PROXY", "307 TEMPORARY_REDIRECT", "308 PERMANENT_REDIRECT", "400 BAD_REQUEST", "401 UNAUTHORIZED", "402 PAYMENT_REQUIRED", "403 FORBIDDEN", "404 NOT_FOUND", "405 METHOD_NOT_ALLOWED", "406 NOT_ACCEPTABLE", "407 PROXY_AUTHENTICATION_REQUIRED", "408 REQUEST_TIMEOUT", "409 CONFLICT", "410 GONE", "411 LENGTH_REQUIRED", "412 PRECONDITION_FAILED", "413 PAYLOAD_TOO_LARGE", "413 REQUEST_ENTITY_TOO_LARGE", "414 URI_TOO_LONG", "414 REQUEST_URI_TOO_LONG", "415 UNSUPPORTED_MEDIA_TYPE", "416 REQUESTED_RANGE_NOT_SATISFIABLE", "417 EXPECTATION_FAILED", "418 I_AM_A_TEAPOT", "419 INSUFFICIENT_SPACE_ON_RESOURCE", "420 METHOD_FAILURE", "421 DESTINATION_LOCKED", "422 UNPROCESSABLE_ENTITY", "423 LOCKED", "424 FAILED_DEPENDENCY", "425 TOO_EARLY", "426 UPGRADE_REQUIRED", "428 PRECONDITION_REQUIRED", "429 TOO_MANY_REQUESTS", "431 REQUEST_HEADER_FIELDS_TOO_LARGE", "451 UNAVAILABLE_FOR_LEGAL_REASONS", "500 INTERNAL_SERVER_ERROR", "501 NOT_IMPLEMENTED", "502 BAD_GATEWAY", "503 SERVICE_UNAVAILABLE", "504 GATEWAY_TIMEOUT", "505 HTTP_VERSION_NOT_SUPPORTED", "506 VARIANT_ALSO_NEGOTIATES", "507 INSUFFICIENT_STORAGE", "508 LOOP_DETECTED", "509 BANDWIDTH_LIMIT_EXCEEDED", "510 NOT_EXTENDED", "511 NETWORK_AUTHENTICATION_REQUIRED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def message(self): + """Gets the message of this ApiErrorDto. # noqa: E501 + + + :return: The message of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiErrorDto. + + + :param message: The message of this ApiErrorDto. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def code(self): + """Gets the code of this ApiErrorDto. # noqa: E501 + + + :return: The code of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiErrorDto. + + + :param code: The code of this ApiErrorDto. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + 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(ApiErrorDto, 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, ApiErrorDto): + 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/swagger/api/api_authentication/models/container_dto.py b/swagger/api/api_authentication/models/container_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..2ee63baa6c5eb205fd79c108439fdf048c487371 --- /dev/null +++ b/swagger/api/api_authentication/models/container_dto.py @@ -0,0 +1,355 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 ContainerDto(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 = { + 'id': 'int', + 'hash': 'str', + 'name': 'str', + 'state': 'str', + 'databases': 'list[DatabaseDto]', + 'image': 'ImageBriefDto', + 'port': 'int', + 'created': 'datetime', + 'internal_name': 'str', + 'ip_address': 'str' + } + + attribute_map = { + 'id': 'id', + 'hash': 'hash', + 'name': 'name', + 'state': 'state', + 'databases': 'databases', + 'image': 'image', + 'port': 'port', + 'created': 'created', + 'internal_name': 'internal_name', + 'ip_address': 'ip_address' + } + + def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + """ContainerDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._hash = None + self._name = None + self._state = None + self._databases = None + self._image = None + self._port = None + self._created = None + self._internal_name = None + self._ip_address = None + self.discriminator = None + self.id = id + self.hash = hash + self.name = name + if state is not None: + self.state = state + if databases is not None: + self.databases = databases + if image is not None: + self.image = image + if port is not None: + self.port = port + self.created = created + self.internal_name = internal_name + if ip_address is not None: + self.ip_address = ip_address + + @property + def id(self): + """Gets the id of this ContainerDto. # noqa: E501 + + + :return: The id of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContainerDto. + + + :param id: The id of this ContainerDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def hash(self): + """Gets the hash of this ContainerDto. # noqa: E501 + + + :return: The hash of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ContainerDto. + + + :param hash: The hash of this ContainerDto. # noqa: E501 + :type: str + """ + if hash is None: + raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501 + + self._hash = hash + + @property + def name(self): + """Gets the name of this ContainerDto. # noqa: E501 + + + :return: The name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerDto. + + + :param name: The name of this ContainerDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def state(self): + """Gets the state of this ContainerDto. # noqa: E501 + + + :return: The state of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this ContainerDto. + + + :param state: The state of this ContainerDto. # noqa: E501 + :type: str + """ + allowed_values = ["created", "restarting", "running", "paused", "exited", "dead"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def databases(self): + """Gets the databases of this ContainerDto. # noqa: E501 + + + :return: The databases of this ContainerDto. # noqa: E501 + :rtype: list[DatabaseDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this ContainerDto. + + + :param databases: The databases of this ContainerDto. # noqa: E501 + :type: list[DatabaseDto] + """ + + self._databases = databases + + @property + def image(self): + """Gets the image of this ContainerDto. # noqa: E501 + + + :return: The image of this ContainerDto. # noqa: E501 + :rtype: ImageBriefDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this ContainerDto. + + + :param image: The image of this ContainerDto. # noqa: E501 + :type: ImageBriefDto + """ + + self._image = image + + @property + def port(self): + """Gets the port of this ContainerDto. # noqa: E501 + + + :return: The port of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this ContainerDto. + + + :param port: The port of this ContainerDto. # noqa: E501 + :type: int + """ + + self._port = port + + @property + def created(self): + """Gets the created of this ContainerDto. # noqa: E501 + + + :return: The created of this ContainerDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ContainerDto. + + + :param created: The created of this ContainerDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def internal_name(self): + """Gets the internal_name of this ContainerDto. # noqa: E501 + + + :return: The internal_name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ContainerDto. + + + :param internal_name: The internal_name of this ContainerDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + @property + def ip_address(self): + """Gets the ip_address of this ContainerDto. # noqa: E501 + + + :return: The ip_address of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """Sets the ip_address of this ContainerDto. + + + :param ip_address: The ip_address of this ContainerDto. # noqa: E501 + :type: str + """ + + self._ip_address = ip_address + + 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(ContainerDto, 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, ContainerDto): + 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/swagger/api/api_authentication/models/database_dto.py b/swagger/api/api_authentication/models/database_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..a8a3fed0801cf9c5b07e2fe15631578e93913f72 --- /dev/null +++ b/swagger/api/api_authentication/models/database_dto.py @@ -0,0 +1,589 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 DatabaseDto(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 = { + 'id': 'int', + 'name': 'str', + 'exchange': 'str', + 'creator': 'UserBriefDto', + 'subjects': 'list[str]', + 'language': 'str', + 'license': 'LicenseDto', + 'description': 'str', + 'publisher': 'str', + 'tables': 'list[TableBriefDto]', + 'image': 'ImageDto', + 'container': 'ContainerDto', + 'created': 'datetime', + 'deleted': 'datetime', + 'internal_name': 'str', + 'publication_year': 'int', + 'publication_month': 'int', + 'publication_day': 'int', + 'is_public': 'bool' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'exchange': 'exchange', + 'creator': 'creator', + 'subjects': 'subjects', + 'language': 'language', + 'license': 'license', + 'description': 'description', + 'publisher': 'publisher', + 'tables': 'tables', + 'image': 'image', + 'container': 'container', + 'created': 'created', + 'deleted': 'deleted', + 'internal_name': 'internal_name', + 'publication_year': 'publication_year', + 'publication_month': 'publication_month', + 'publication_day': 'publication_day', + 'is_public': 'is_public' + } + + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_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._tables = None + self._image = None + self._container = None + self._created = None + self._deleted = None + self._internal_name = None + self._publication_year = None + self._publication_month = None + self._publication_day = None + self._is_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 tables is not None: + self.tables = tables + if image is not None: + self.image = image + if container is not None: + self.container = container + if created is not None: + self.created = created + if deleted is not None: + self.deleted = deleted + self.internal_name = internal_name + if publication_year is not None: + self.publication_year = 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 is_public is not None: + self.is_public = is_public + + @property + def id(self): + """Gets the id of this DatabaseDto. # noqa: E501 + + + :return: The id of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DatabaseDto. + + + :param id: The id of this DatabaseDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this DatabaseDto. # noqa: E501 + + + :return: The name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DatabaseDto. + + + :param name: The name of this DatabaseDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def exchange(self): + """Gets the exchange of this DatabaseDto. # noqa: E501 + + + :return: The exchange of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this DatabaseDto. + + + :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :type: str + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def creator(self): + """Gets the creator of this DatabaseDto. # noqa: E501 + + + :return: The creator of this DatabaseDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this DatabaseDto. + + + :param creator: The creator of this DatabaseDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def subjects(self): + """Gets the subjects of this DatabaseDto. # noqa: E501 + + + :return: The subjects of this DatabaseDto. # noqa: E501 + :rtype: list[str] + """ + return self._subjects + + @subjects.setter + def subjects(self, subjects): + """Sets the subjects of this DatabaseDto. + + + :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :type: list[str] + """ + + self._subjects = subjects + + @property + def language(self): + """Gets the language of this DatabaseDto. # noqa: E501 + + + :return: The language of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this DatabaseDto. + + + :param language: The 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: + raise ValueError( + "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 + .format(language, allowed_values) + ) + + self._language = language + + @property + def license(self): + """Gets the license of this DatabaseDto. # noqa: E501 + + + :return: The license of this DatabaseDto. # noqa: E501 + :rtype: LicenseDto + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this DatabaseDto. + + + :param license: The license of this DatabaseDto. # noqa: E501 + :type: LicenseDto + """ + + self._license = license + + @property + def description(self): + """Gets the description of this DatabaseDto. # noqa: E501 + + + :return: The description of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this DatabaseDto. + + + :param description: The description of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def publisher(self): + """Gets the publisher of this DatabaseDto. # noqa: E501 + + + :return: The publisher of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this DatabaseDto. + + + :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._publisher = publisher + + @property + def tables(self): + """Gets the tables of this DatabaseDto. # noqa: E501 + + + :return: The tables of this DatabaseDto. # noqa: E501 + :rtype: list[TableBriefDto] + """ + return self._tables + + @tables.setter + def tables(self, tables): + """Sets the tables of this DatabaseDto. + + + :param tables: The tables of this DatabaseDto. # noqa: E501 + :type: list[TableBriefDto] + """ + + self._tables = tables + + @property + def image(self): + """Gets the image of this DatabaseDto. # noqa: E501 + + + :return: The image of this DatabaseDto. # noqa: E501 + :rtype: ImageDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this DatabaseDto. + + + :param image: The image of this DatabaseDto. # noqa: E501 + :type: ImageDto + """ + + self._image = image + + @property + def container(self): + """Gets the container of this DatabaseDto. # noqa: E501 + + + :return: The container of this DatabaseDto. # noqa: E501 + :rtype: ContainerDto + """ + return self._container + + @container.setter + def container(self, container): + """Sets the container of this DatabaseDto. + + + :param container: The container of this DatabaseDto. # noqa: E501 + :type: ContainerDto + """ + + self._container = container + + @property + def created(self): + """Gets the created of this DatabaseDto. # noqa: E501 + + + :return: The created of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseDto. + + + :param created: The created of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def deleted(self): + """Gets the deleted of this DatabaseDto. # noqa: E501 + + + :return: The deleted of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this DatabaseDto. + + + :param deleted: The deleted of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._deleted = deleted + + @property + def internal_name(self): + """Gets the internal_name of this DatabaseDto. # noqa: E501 + + + :return: The internal_name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this DatabaseDto. + + + :param internal_name: The 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 + + self._internal_name = internal_name + + @property + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 + + + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. + + + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_year = publication_year + + @property + def publication_month(self): + """Gets the publication_month of this DatabaseDto. # noqa: E501 + + + :return: The publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this DatabaseDto. + + + :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_day(self): + """Gets the publication_day of this DatabaseDto. # noqa: E501 + + + :return: The publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this DatabaseDto. + + + :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def is_public(self): + """Gets the is_public of this DatabaseDto. # noqa: E501 + + + :return: The is_public of this DatabaseDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseDto. + + + :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :type: bool + """ + + 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(DatabaseDto, 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, DatabaseDto): + 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/swagger/api/api_authentication/models/granted_authority_dto.py b/swagger/api/api_authentication/models/granted_authority_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..27fb59540a7ea4ac0bd308116678bf19638a94f1 --- /dev/null +++ b/swagger/api/api_authentication/models/granted_authority_dto.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 GrantedAuthorityDto(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 = { + 'authority': 'str' + } + + attribute_map = { + 'authority': 'authority' + } + + def __init__(self, authority=None): # noqa: E501 + """GrantedAuthorityDto - a model defined in Swagger""" # noqa: E501 + self._authority = None + self.discriminator = None + if authority is not None: + self.authority = authority + + @property + def authority(self): + """Gets the authority of this GrantedAuthorityDto. # noqa: E501 + + + :return: The authority of this GrantedAuthorityDto. # noqa: E501 + :rtype: str + """ + return self._authority + + @authority.setter + def authority(self, authority): + """Sets the authority of this GrantedAuthorityDto. + + + :param authority: The authority of this GrantedAuthorityDto. # noqa: E501 + :type: str + """ + + self._authority = authority + + 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(GrantedAuthorityDto, 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, GrantedAuthorityDto): + 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/swagger/api/api_authentication/models/image_brief_dto.py b/swagger/api/api_authentication/models/image_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..3e8c04a8f94e0f9cd7d77ac343616e335116850a --- /dev/null +++ b/swagger/api/api_authentication/models/image_brief_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 ImageBriefDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag' + } + + def __init__(self, id=None, repository=None, tag=None): # noqa: E501 + """ImageBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + + @property + def id(self): + """Gets the id of this ImageBriefDto. # noqa: E501 + + + :return: The id of this ImageBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageBriefDto. + + + :param id: The id of this ImageBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageBriefDto. # noqa: E501 + + + :return: The repository of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageBriefDto. + + + :param repository: The repository of this ImageBriefDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageBriefDto. # noqa: E501 + + + :return: The tag of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageBriefDto. + + + :param tag: The tag of this ImageBriefDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + 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(ImageBriefDto, 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, ImageBriefDto): + 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/swagger/api/api_authentication/models/image_date_dto.py b/swagger/api/api_authentication/models/image_date_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..b8f379e2acac1198492fcad960a9961f27566b04 --- /dev/null +++ b/swagger/api/api_authentication/models/image_date_dto.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 ImageDateDto(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 = { + 'id': 'int', + 'example': 'str', + 'database_format': 'str', + 'unix_format': 'str', + 'has_time': 'bool', + 'created_at': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'example': 'example', + 'database_format': 'database_format', + 'unix_format': 'unix_format', + 'has_time': 'has_time', + 'created_at': 'created_at' + } + + def __init__(self, id=None, example=None, database_format=None, unix_format=None, has_time=None, created_at=None): # noqa: E501 + """ImageDateDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._example = None + self._database_format = None + self._unix_format = None + self._has_time = None + self._created_at = None + self.discriminator = None + self.id = id + self.example = example + self.database_format = database_format + self.unix_format = unix_format + self.has_time = has_time + if created_at is not None: + self.created_at = created_at + + @property + def id(self): + """Gets the id of this ImageDateDto. # noqa: E501 + + + :return: The id of this ImageDateDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDateDto. + + + :param id: The id of this ImageDateDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def example(self): + """Gets the example of this ImageDateDto. # noqa: E501 + + + :return: The example of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._example + + @example.setter + def example(self, example): + """Sets the example of this ImageDateDto. + + + :param example: The example of this ImageDateDto. # noqa: E501 + :type: str + """ + if example is None: + raise ValueError("Invalid value for `example`, must not be `None`") # noqa: E501 + + self._example = example + + @property + def database_format(self): + """Gets the database_format of this ImageDateDto. # noqa: E501 + + + :return: The database_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._database_format + + @database_format.setter + def database_format(self, database_format): + """Sets the database_format of this ImageDateDto. + + + :param database_format: The database_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if database_format is None: + raise ValueError("Invalid value for `database_format`, must not be `None`") # noqa: E501 + + self._database_format = database_format + + @property + def unix_format(self): + """Gets the unix_format of this ImageDateDto. # noqa: E501 + + + :return: The unix_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._unix_format + + @unix_format.setter + def unix_format(self, unix_format): + """Sets the unix_format of this ImageDateDto. + + + :param unix_format: The unix_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if unix_format is None: + raise ValueError("Invalid value for `unix_format`, must not be `None`") # noqa: E501 + + self._unix_format = unix_format + + @property + def has_time(self): + """Gets the has_time of this ImageDateDto. # noqa: E501 + + + :return: The has_time of this ImageDateDto. # noqa: E501 + :rtype: bool + """ + return self._has_time + + @has_time.setter + def has_time(self, has_time): + """Sets the has_time of this ImageDateDto. + + + :param has_time: The has_time of this ImageDateDto. # noqa: E501 + :type: bool + """ + if has_time is None: + raise ValueError("Invalid value for `has_time`, must not be `None`") # noqa: E501 + + self._has_time = has_time + + @property + def created_at(self): + """Gets the created_at of this ImageDateDto. # noqa: E501 + + + :return: The created_at of this ImageDateDto. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ImageDateDto. + + + :param created_at: The created_at of this ImageDateDto. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + 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(ImageDateDto, 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, ImageDateDto): + 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/swagger/api/api_authentication/models/image_dto.py b/swagger/api/api_authentication/models/image_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..25e5ad1ebce7468da464c057dd93a4de391042bf --- /dev/null +++ b/swagger/api/api_authentication/models/image_dto.py @@ -0,0 +1,404 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 ImageDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str', + 'dialect': 'str', + 'hash': 'str', + 'compiled': 'datetime', + 'size': 'int', + 'environment': 'list[ImageEnvItemDto]', + 'driver_class': 'str', + 'date_formats': 'list[ImageDateDto]', + 'jdbc_method': 'str', + 'default_port': 'int' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag', + 'dialect': 'dialect', + 'hash': 'hash', + 'compiled': 'compiled', + 'size': 'size', + 'environment': 'environment', + 'driver_class': 'driver_class', + 'date_formats': 'date_formats', + 'jdbc_method': 'jdbc_method', + 'default_port': 'default_port' + } + + def __init__(self, id=None, repository=None, tag=None, dialect=None, hash=None, compiled=None, size=None, environment=None, driver_class=None, date_formats=None, jdbc_method=None, default_port=None): # noqa: E501 + """ImageDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self._dialect = None + self._hash = None + self._compiled = None + self._size = None + self._environment = None + self._driver_class = None + self._date_formats = None + self._jdbc_method = None + self._default_port = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + self.dialect = dialect + if hash is not None: + self.hash = hash + if compiled is not None: + self.compiled = compiled + if size is not None: + self.size = size + self.environment = environment + self.driver_class = driver_class + if date_formats is not None: + self.date_formats = date_formats + self.jdbc_method = jdbc_method + self.default_port = default_port + + @property + def id(self): + """Gets the id of this ImageDto. # noqa: E501 + + + :return: The id of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDto. + + + :param id: The id of this ImageDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageDto. # noqa: E501 + + + :return: The repository of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageDto. + + + :param repository: The repository of this ImageDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageDto. # noqa: E501 + + + :return: The tag of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageDto. + + + :param tag: The tag of this ImageDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + @property + def dialect(self): + """Gets the dialect of this ImageDto. # noqa: E501 + + + :return: The dialect of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._dialect + + @dialect.setter + def dialect(self, dialect): + """Sets the dialect of this ImageDto. + + + :param dialect: The dialect of this ImageDto. # noqa: E501 + :type: str + """ + if dialect is None: + raise ValueError("Invalid value for `dialect`, must not be `None`") # noqa: E501 + + self._dialect = dialect + + @property + def hash(self): + """Gets the hash of this ImageDto. # noqa: E501 + + + :return: The hash of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ImageDto. + + + :param hash: The hash of this ImageDto. # noqa: E501 + :type: str + """ + + self._hash = hash + + @property + def compiled(self): + """Gets the compiled of this ImageDto. # noqa: E501 + + + :return: The compiled of this ImageDto. # noqa: E501 + :rtype: datetime + """ + return self._compiled + + @compiled.setter + def compiled(self, compiled): + """Sets the compiled of this ImageDto. + + + :param compiled: The compiled of this ImageDto. # noqa: E501 + :type: datetime + """ + + self._compiled = compiled + + @property + def size(self): + """Gets the size of this ImageDto. # noqa: E501 + + + :return: The size of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this ImageDto. + + + :param size: The size of this ImageDto. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def environment(self): + """Gets the environment of this ImageDto. # noqa: E501 + + + :return: The environment of this ImageDto. # noqa: E501 + :rtype: list[ImageEnvItemDto] + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this ImageDto. + + + :param environment: The environment of this ImageDto. # noqa: E501 + :type: list[ImageEnvItemDto] + """ + if environment is None: + raise ValueError("Invalid value for `environment`, must not be `None`") # noqa: E501 + + self._environment = environment + + @property + def driver_class(self): + """Gets the driver_class of this ImageDto. # noqa: E501 + + + :return: The driver_class of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._driver_class + + @driver_class.setter + def driver_class(self, driver_class): + """Sets the driver_class of this ImageDto. + + + :param driver_class: The driver_class of this ImageDto. # noqa: E501 + :type: str + """ + if driver_class is None: + raise ValueError("Invalid value for `driver_class`, must not be `None`") # noqa: E501 + + self._driver_class = driver_class + + @property + def date_formats(self): + """Gets the date_formats of this ImageDto. # noqa: E501 + + + :return: The date_formats of this ImageDto. # noqa: E501 + :rtype: list[ImageDateDto] + """ + return self._date_formats + + @date_formats.setter + def date_formats(self, date_formats): + """Sets the date_formats of this ImageDto. + + + :param date_formats: The date_formats of this ImageDto. # noqa: E501 + :type: list[ImageDateDto] + """ + + self._date_formats = date_formats + + @property + def jdbc_method(self): + """Gets the jdbc_method of this ImageDto. # noqa: E501 + + + :return: The jdbc_method of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._jdbc_method + + @jdbc_method.setter + def jdbc_method(self, jdbc_method): + """Sets the jdbc_method of this ImageDto. + + + :param jdbc_method: The jdbc_method of this ImageDto. # noqa: E501 + :type: str + """ + if jdbc_method is None: + raise ValueError("Invalid value for `jdbc_method`, must not be `None`") # noqa: E501 + + self._jdbc_method = jdbc_method + + @property + def default_port(self): + """Gets the default_port of this ImageDto. # noqa: E501 + + + :return: The default_port of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._default_port + + @default_port.setter + def default_port(self, default_port): + """Sets the default_port of this ImageDto. + + + :param default_port: The default_port of this ImageDto. # noqa: E501 + :type: int + """ + if default_port is None: + raise ValueError("Invalid value for `default_port`, must not be `None`") # noqa: E501 + + self._default_port = default_port + + 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(ImageDto, 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, ImageDto): + 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/swagger/api/api_authentication/models/image_env_item_dto.py b/swagger/api/api_authentication/models/image_env_item_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..0a8089775eddf76cf0fc461d9cc94852246487ff --- /dev/null +++ b/swagger/api/api_authentication/models/image_env_item_dto.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 ImageEnvItemDto(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 = { + 'iid': 'int', + 'key': 'str', + 'value': 'str', + 'type': 'str' + } + + attribute_map = { + 'iid': 'iid', + 'key': 'key', + 'value': 'value', + 'type': 'type' + } + + def __init__(self, iid=None, key=None, value=None, type=None): # noqa: E501 + """ImageEnvItemDto - a model defined in Swagger""" # noqa: E501 + self._iid = None + self._key = None + self._value = None + self._type = None + self.discriminator = None + self.iid = iid + self.key = key + self.value = value + self.type = type + + @property + def iid(self): + """Gets the iid of this ImageEnvItemDto. # noqa: E501 + + + :return: The iid of this ImageEnvItemDto. # noqa: E501 + :rtype: int + """ + return self._iid + + @iid.setter + def iid(self, iid): + """Sets the iid of this ImageEnvItemDto. + + + :param iid: The iid of this ImageEnvItemDto. # noqa: E501 + :type: int + """ + if iid is None: + raise ValueError("Invalid value for `iid`, must not be `None`") # noqa: E501 + + self._iid = iid + + @property + def key(self): + """Gets the key of this ImageEnvItemDto. # noqa: E501 + + + :return: The key of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this ImageEnvItemDto. + + + :param key: The key of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if key is None: + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value(self): + """Gets the value of this ImageEnvItemDto. # noqa: E501 + + + :return: The value of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ImageEnvItemDto. + + + :param value: The value of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this ImageEnvItemDto. # noqa: E501 + + + :return: The type of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ImageEnvItemDto. + + + :param type: The type of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["username", "password", "privileged_username", "privileged_password"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + 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(ImageEnvItemDto, 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, ImageEnvItemDto): + 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/swagger/api/api_authentication/models/jwt_response_dto.py b/swagger/api/api_authentication/models/jwt_response_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..1ec439618bdd7247873e016e6e00e310e2d74e24 --- /dev/null +++ b/swagger/api/api_authentication/models/jwt_response_dto.py @@ -0,0 +1,241 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 JwtResponseDto(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 = { + 'token': 'str', + 'type': 'str', + 'id': 'int', + 'username': 'str', + 'email': 'str', + 'roles': 'list[str]' + } + + attribute_map = { + 'token': 'token', + 'type': 'type', + 'id': 'id', + 'username': 'username', + 'email': 'email', + 'roles': 'roles' + } + + def __init__(self, token=None, type=None, id=None, username=None, email=None, roles=None): # noqa: E501 + """JwtResponseDto - a model defined in Swagger""" # noqa: E501 + self._token = None + self._type = None + self._id = None + self._username = None + self._email = None + self._roles = None + self.discriminator = None + self.token = token + if type is not None: + self.type = type + if id is not None: + self.id = id + if username is not None: + self.username = username + if email is not None: + self.email = email + if roles is not None: + self.roles = roles + + @property + def token(self): + """Gets the token of this JwtResponseDto. # noqa: E501 + + + :return: The token of this JwtResponseDto. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this JwtResponseDto. + + + :param token: The token of this JwtResponseDto. # noqa: E501 + :type: str + """ + if token is None: + raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 + + self._token = token + + @property + def type(self): + """Gets the type of this JwtResponseDto. # noqa: E501 + + + :return: The type of this JwtResponseDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this JwtResponseDto. + + + :param type: The type of this JwtResponseDto. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def id(self): + """Gets the id of this JwtResponseDto. # noqa: E501 + + + :return: The id of this JwtResponseDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this JwtResponseDto. + + + :param id: The id of this JwtResponseDto. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def username(self): + """Gets the username of this JwtResponseDto. # noqa: E501 + + + :return: The username of this JwtResponseDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this JwtResponseDto. + + + :param username: The username of this JwtResponseDto. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def email(self): + """Gets the email of this JwtResponseDto. # noqa: E501 + + + :return: The email of this JwtResponseDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this JwtResponseDto. + + + :param email: The email of this JwtResponseDto. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def roles(self): + """Gets the roles of this JwtResponseDto. # noqa: E501 + + + :return: The roles of this JwtResponseDto. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this JwtResponseDto. + + + :param roles: The roles of this JwtResponseDto. # noqa: E501 + :type: list[str] + """ + + self._roles = roles + + 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(JwtResponseDto, 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, JwtResponseDto): + 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/swagger/api/api_authentication/models/license_dto.py b/swagger/api/api_authentication/models/license_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..37ac2e3598a3e1b61081b0c83eca129af89b4ce4 --- /dev/null +++ b/swagger/api/api_authentication/models/license_dto.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 LicenseDto(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 = { + 'identifier': 'str', + 'uri': 'str' + } + + attribute_map = { + 'identifier': 'identifier', + 'uri': 'uri' + } + + def __init__(self, identifier=None, uri=None): # noqa: E501 + """LicenseDto - a model defined in Swagger""" # noqa: E501 + self._identifier = None + self._uri = None + self.discriminator = None + self.identifier = identifier + self.uri = uri + + @property + def identifier(self): + """Gets the identifier of this LicenseDto. # noqa: E501 + + + :return: The identifier of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this LicenseDto. + + + :param identifier: The identifier of this LicenseDto. # noqa: E501 + :type: str + """ + if identifier is None: + raise ValueError("Invalid value for `identifier`, must not be `None`") # noqa: E501 + + self._identifier = identifier + + @property + def uri(self): + """Gets the uri of this LicenseDto. # noqa: E501 + + + :return: The uri of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this LicenseDto. + + + :param uri: The uri of this LicenseDto. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + 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(LicenseDto, 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, LicenseDto): + 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/swagger/api/api_authentication/models/login_request_dto.py b/swagger/api/api_authentication/models/login_request_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ffebe690dd07f94409efb3ecbf3e1a4a286b5323 --- /dev/null +++ b/swagger/api/api_authentication/models/login_request_dto.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 LoginRequestDto(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 = { + 'username': 'str', + 'password': 'str' + } + + attribute_map = { + 'username': 'username', + 'password': 'password' + } + + def __init__(self, username=None, password=None): # noqa: E501 + """LoginRequestDto - a model defined in Swagger""" # noqa: E501 + self._username = None + self._password = None + self.discriminator = None + self.username = username + self.password = password + + @property + def username(self): + """Gets the username of this LoginRequestDto. # noqa: E501 + + + :return: The username of this LoginRequestDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this LoginRequestDto. + + + :param username: The username of this LoginRequestDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def password(self): + """Gets the password of this LoginRequestDto. # noqa: E501 + + + :return: The password of this LoginRequestDto. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this LoginRequestDto. + + + :param password: The password of this LoginRequestDto. # noqa: E501 + :type: str + """ + if password is None: + raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 + + self._password = password + + 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(LoginRequestDto, 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, LoginRequestDto): + 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/swagger/api/api_authentication/models/signup_request_dto.py b/swagger/api/api_authentication/models/signup_request_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e4583703ccabdc602ba73297658b3b96dfe27948 --- /dev/null +++ b/swagger/api/api_authentication/models/signup_request_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 SignupRequestDto(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 = { + 'username': 'str', + 'email': 'str', + 'password': 'str' + } + + attribute_map = { + 'username': 'username', + 'email': 'email', + 'password': 'password' + } + + def __init__(self, username=None, email=None, password=None): # noqa: E501 + """SignupRequestDto - a model defined in Swagger""" # noqa: E501 + self._username = None + self._email = None + self._password = None + self.discriminator = None + self.username = username + self.email = email + self.password = password + + @property + def username(self): + """Gets the username of this SignupRequestDto. # noqa: E501 + + + :return: The username of this SignupRequestDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this SignupRequestDto. + + + :param username: The username of this SignupRequestDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def email(self): + """Gets the email of this SignupRequestDto. # noqa: E501 + + + :return: The email of this SignupRequestDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this SignupRequestDto. + + + :param email: The email of this SignupRequestDto. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def password(self): + """Gets the password of this SignupRequestDto. # noqa: E501 + + + :return: The password of this SignupRequestDto. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this SignupRequestDto. + + + :param password: The password of this SignupRequestDto. # noqa: E501 + :type: str + """ + if password is None: + raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 + + self._password = password + + 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(SignupRequestDto, 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, SignupRequestDto): + 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/swagger/api/api_authentication/models/table_brief_dto.py b/swagger/api/api_authentication/models/table_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..a20c8802164e2c36f9ad791c1cca72e26d659f8c --- /dev/null +++ b/swagger/api/api_authentication/models/table_brief_dto.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 TableBriefDto(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 = { + 'id': 'int', + 'name': 'str', + 'creator': 'UserBriefDto', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator': 'creator', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + """TableBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._creator = None + self._internal_name = None + self.discriminator = None + self.id = id + self.name = name + self.creator = creator + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this TableBriefDto. # noqa: E501 + + + :return: The id of this TableBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TableBriefDto. + + + :param id: The id of this TableBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this TableBriefDto. # noqa: E501 + + + :return: The name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TableBriefDto. + + + :param name: The name of this TableBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this TableBriefDto. # noqa: E501 + + + :return: The creator of this TableBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this TableBriefDto. + + + :param creator: The creator of this TableBriefDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def internal_name(self): + """Gets the internal_name of this TableBriefDto. # noqa: E501 + + + :return: The internal_name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this TableBriefDto. + + + :param internal_name: The internal_name of this TableBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(TableBriefDto, 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, TableBriefDto): + 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/swagger/api/api_authentication/models/user_brief_dto.py b/swagger/api/api_authentication/models/user_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..79fbd2db971a41b74fda65941dde1e04f6e81ebf --- /dev/null +++ b/swagger/api/api_authentication/models/user_brief_dto.py @@ -0,0 +1,350 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserBriefDto(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 = { + 'id': 'int', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserBriefDto. # noqa: E501 + + + :return: The id of this UserBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserBriefDto. + + + :param id: The id of this UserBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def username(self): + """Gets the username of this UserBriefDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserBriefDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserBriefDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserBriefDto. # noqa: E501 + + + :return: The firstname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserBriefDto. + + + :param firstname: The firstname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserBriefDto. # noqa: E501 + + + :return: The lastname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserBriefDto. + + + :param lastname: The lastname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserBriefDto. # noqa: E501 + + + :return: The affiliation of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserBriefDto. + + + :param affiliation: The affiliation of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserBriefDto. # noqa: E501 + + + :return: The orcid of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserBriefDto. + + + :param orcid: The orcid of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserBriefDto. # noqa: E501 + + + :return: The theme_dark of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserBriefDto. + + + :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserBriefDto. # noqa: E501 + + + :return: The email_verified of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserBriefDto. + + + :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserBriefDto, 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, UserBriefDto): + 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/swagger/api/api_authentication/models/user_dto.py b/swagger/api/api_authentication/models/user_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e5a3cf440293c565718006cd46962706ad260f6f --- /dev/null +++ b/swagger/api/api_authentication/models/user_dto.py @@ -0,0 +1,481 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserDto(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 = { + 'id': 'int', + 'authorities': 'list[GrantedAuthorityDto]', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'containers': 'list[ContainerDto]', + 'databases': 'list[ContainerDto]', + 'identifiers': 'list[ContainerDto]', + 'email': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'authorities': 'authorities', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'containers': 'containers', + 'databases': 'databases', + 'identifiers': 'identifiers', + 'email': 'email', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._authorities = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._containers = None + self._databases = None + self._identifiers = None + self._email = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + if authorities is not None: + self.authorities = authorities + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if containers is not None: + self.containers = containers + if databases is not None: + self.databases = databases + if identifiers is not None: + self.identifiers = identifiers + self.email = email + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserDto. # noqa: E501 + + + :return: The id of this UserDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserDto. + + + :param id: The id of this UserDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def authorities(self): + """Gets the authorities of this UserDto. # noqa: E501 + + + :return: The authorities of this UserDto. # noqa: E501 + :rtype: list[GrantedAuthorityDto] + """ + return self._authorities + + @authorities.setter + def authorities(self, authorities): + """Sets the authorities of this UserDto. + + + :param authorities: The authorities of this UserDto. # noqa: E501 + :type: list[GrantedAuthorityDto] + """ + + self._authorities = authorities + + @property + def username(self): + """Gets the username of this UserDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserDto. # noqa: E501 + + + :return: The firstname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserDto. + + + :param firstname: The firstname of this UserDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserDto. # noqa: E501 + + + :return: The lastname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserDto. + + + :param lastname: The lastname of this UserDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserDto. # noqa: E501 + + + :return: The affiliation of this UserDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserDto. + + + :param affiliation: The affiliation of this UserDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserDto. # noqa: E501 + + + :return: The orcid of this UserDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserDto. + + + :param orcid: The orcid of this UserDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def containers(self): + """Gets the containers of this UserDto. # noqa: E501 + + + :return: The containers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._containers + + @containers.setter + def containers(self, containers): + """Sets the containers of this UserDto. + + + :param containers: The containers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._containers = containers + + @property + def databases(self): + """Gets the databases of this UserDto. # noqa: E501 + + + :return: The databases of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this UserDto. + + + :param databases: The databases of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._databases = databases + + @property + def identifiers(self): + """Gets the identifiers of this UserDto. # noqa: E501 + + + :return: The identifiers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._identifiers + + @identifiers.setter + def identifiers(self, identifiers): + """Sets the identifiers of this UserDto. + + + :param identifiers: The identifiers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._identifiers = identifiers + + @property + def email(self): + """Gets the email of this UserDto. # noqa: E501 + + + :return: The email of this UserDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserDto. + + + :param email: The email of this UserDto. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def titles_before(self): + """Gets the titles_before of this UserDto. # noqa: E501 + + + :return: The titles_before of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserDto. + + + :param titles_before: The titles_before of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserDto. # noqa: E501 + + + :return: The titles_after of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserDto. + + + :param titles_after: The titles_after of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserDto. # noqa: E501 + + + :return: The theme_dark of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserDto. + + + :param theme_dark: The theme_dark of this UserDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserDto. # noqa: E501 + + + :return: The email_verified of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserDto. + + + :param email_verified: The email_verified of this UserDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserDto, 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, UserDto): + 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/swagger/api/api_authentication/models/user_email_dto.py b/swagger/api/api_authentication/models/user_email_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..9efba48a1014164d8dc3a89bfeaa6ae7b0152ac5 --- /dev/null +++ b/swagger/api/api_authentication/models/user_email_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserEmailDto(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 = { + 'email': 'str' + } + + attribute_map = { + 'email': 'email' + } + + def __init__(self, email=None): # noqa: E501 + """UserEmailDto - a model defined in Swagger""" # noqa: E501 + self._email = None + self.discriminator = None + self.email = email + + @property + def email(self): + """Gets the email of this UserEmailDto. # noqa: E501 + + + :return: The email of this UserEmailDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserEmailDto. + + + :param email: The email of this UserEmailDto. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + 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(UserEmailDto, 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, UserEmailDto): + 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/swagger/api/api_authentication/models/user_forgot_dto.py b/swagger/api/api_authentication/models/user_forgot_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..33eabd537729470bb50b8a580ee45be724ea7af0 --- /dev/null +++ b/swagger/api/api_authentication/models/user_forgot_dto.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserForgotDto(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 = { + 'username': 'str', + 'email': 'str' + } + + attribute_map = { + 'username': 'username', + 'email': 'email' + } + + def __init__(self, username=None, email=None): # noqa: E501 + """UserForgotDto - a model defined in Swagger""" # noqa: E501 + self._username = None + self._email = None + self.discriminator = None + if username is not None: + self.username = username + if email is not None: + self.email = email + + @property + def username(self): + """Gets the username of this UserForgotDto. # noqa: E501 + + + :return: The username of this UserForgotDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserForgotDto. + + + :param username: The username of this UserForgotDto. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def email(self): + """Gets the email of this UserForgotDto. # noqa: E501 + + + :return: The email of this UserForgotDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserForgotDto. + + + :param email: The email of this UserForgotDto. # noqa: E501 + :type: str + """ + + self._email = email + + 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(UserForgotDto, 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, UserForgotDto): + 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/swagger/api/api_authentication/models/user_password_dto.py b/swagger/api/api_authentication/models/user_password_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..1c501d6e8f0e45cc43df5ef1985dc7a5298e46eb --- /dev/null +++ b/swagger/api/api_authentication/models/user_password_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserPasswordDto(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 = { + 'password': 'str' + } + + attribute_map = { + 'password': 'password' + } + + def __init__(self, password=None): # noqa: E501 + """UserPasswordDto - a model defined in Swagger""" # noqa: E501 + self._password = None + self.discriminator = None + self.password = password + + @property + def password(self): + """Gets the password of this UserPasswordDto. # noqa: E501 + + + :return: The password of this UserPasswordDto. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this UserPasswordDto. + + + :param password: The password of this UserPasswordDto. # noqa: E501 + :type: str + """ + if password is None: + raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 + + self._password = password + + 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(UserPasswordDto, 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, UserPasswordDto): + 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/swagger/api/api_authentication/models/user_reset_dto.py b/swagger/api/api_authentication/models/user_reset_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..6eae81a67ed15dd60d3a5c8adc2ec51a570bcfbc --- /dev/null +++ b/swagger/api/api_authentication/models/user_reset_dto.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserResetDto(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 = { + 'password': 'str', + 'token': 'str' + } + + attribute_map = { + 'password': 'password', + 'token': 'token' + } + + def __init__(self, password=None, token=None): # noqa: E501 + """UserResetDto - a model defined in Swagger""" # noqa: E501 + self._password = None + self._token = None + self.discriminator = None + self.password = password + self.token = token + + @property + def password(self): + """Gets the password of this UserResetDto. # noqa: E501 + + + :return: The password of this UserResetDto. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this UserResetDto. + + + :param password: The password of this UserResetDto. # noqa: E501 + :type: str + """ + if password is None: + raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 + + self._password = password + + @property + def token(self): + """Gets the token of this UserResetDto. # noqa: E501 + + + :return: The token of this UserResetDto. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this UserResetDto. + + + :param token: The token of this UserResetDto. # noqa: E501 + :type: str + """ + if token is None: + raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 + + self._token = token + + 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(UserResetDto, 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, UserResetDto): + 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/swagger/api/api_authentication/models/user_roles_dto.py b/swagger/api/api_authentication/models/user_roles_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e3630ac9e655960726e318b2511a1f11889fd5c1 --- /dev/null +++ b/swagger/api/api_authentication/models/user_roles_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserRolesDto(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 = { + 'roles': 'list[str]' + } + + attribute_map = { + 'roles': 'roles' + } + + def __init__(self, roles=None): # noqa: E501 + """UserRolesDto - a model defined in Swagger""" # noqa: E501 + self._roles = None + self.discriminator = None + self.roles = roles + + @property + def roles(self): + """Gets the roles of this UserRolesDto. # noqa: E501 + + + :return: The roles of this UserRolesDto. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this UserRolesDto. + + + :param roles: The roles of this UserRolesDto. # noqa: E501 + :type: list[str] + """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 + + self._roles = roles + + 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(UserRolesDto, 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, UserRolesDto): + 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/swagger/api/api_authentication/models/user_theme_set_dto.py b/swagger/api/api_authentication/models/user_theme_set_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..3735201576f28934bc7f4ac2c87a3b1b61a778b0 --- /dev/null +++ b/swagger/api/api_authentication/models/user_theme_set_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserThemeSetDto(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 = { + 'theme_dark': 'bool' + } + + attribute_map = { + 'theme_dark': 'theme_dark' + } + + def __init__(self, theme_dark=None): # noqa: E501 + """UserThemeSetDto - a model defined in Swagger""" # noqa: E501 + self._theme_dark = None + self.discriminator = None + self.theme_dark = theme_dark + + @property + def theme_dark(self): + """Gets the theme_dark of this UserThemeSetDto. # noqa: E501 + + + :return: The theme_dark of this UserThemeSetDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserThemeSetDto. + + + :param theme_dark: The theme_dark of this UserThemeSetDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + 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(UserThemeSetDto, 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, UserThemeSetDto): + 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/swagger/api/api_authentication/models/user_update_dto.py b/swagger/api/api_authentication/models/user_update_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..24d66d8517df6bcb925bf669f6e2976a563472c5 --- /dev/null +++ b/swagger/api/api_authentication/models/user_update_dto.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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 UserUpdateDto(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 = { + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'titles_before': 'str', + 'titles_after': 'str' + } + + attribute_map = { + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after' + } + + def __init__(self, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None): # noqa: E501 + """UserUpdateDto - a model defined in Swagger""" # noqa: E501 + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._titles_before = None + self._titles_after = None + self.discriminator = None + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + + @property + def firstname(self): + """Gets the firstname of this UserUpdateDto. # noqa: E501 + + + :return: The firstname of this UserUpdateDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserUpdateDto. + + + :param firstname: The firstname of this UserUpdateDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserUpdateDto. # noqa: E501 + + + :return: The lastname of this UserUpdateDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserUpdateDto. + + + :param lastname: The lastname of this UserUpdateDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserUpdateDto. # noqa: E501 + + + :return: The affiliation of this UserUpdateDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserUpdateDto. + + + :param affiliation: The affiliation of this UserUpdateDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserUpdateDto. # noqa: E501 + + + :return: The orcid of this UserUpdateDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserUpdateDto. + + + :param orcid: The orcid of this UserUpdateDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def titles_before(self): + """Gets the titles_before of this UserUpdateDto. # noqa: E501 + + + :return: The titles_before of this UserUpdateDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserUpdateDto. + + + :param titles_before: The titles_before of this UserUpdateDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserUpdateDto. # noqa: E501 + + + :return: The titles_after of this UserUpdateDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserUpdateDto. + + + :param titles_after: The titles_after of this UserUpdateDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + 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(UserUpdateDto, 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, UserUpdateDto): + 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/swagger/api/api_authentication/rest.py b/swagger/api/api_authentication/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..fc46df7c0293982201996d273d0d234057f987f0 --- /dev/null +++ b/swagger/api/api_authentication/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # 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/swagger/api/api_broker/BrokerServiceClient.py b/swagger/api/api_broker/BrokerServiceClient.py new file mode 100644 index 0000000000000000000000000000000000000000..e7bfd582a87bb59a8f604cc3addd760e29f5413a --- /dev/null +++ b/swagger/api/api_broker/BrokerServiceClient.py @@ -0,0 +1,26 @@ +import json +from pika import BlockingConnection, ConnectionParameters +from pika.credentials import PlainCredentials + + +class BrokerServiceClient: + + def __init__(self, exchange, routing_key, host, username, password): + self.exchange = exchange + self.routing_key = routing_key + self.host = host + self.username = username + self.password = password + self.connection = BlockingConnection(ConnectionParameters(self.host, + credentials=PlainCredentials( + username=self.username, + password=self.password))) + + def send(self, message): + channel = self.connection.channel() + payload = json.dumps(message) + print("... sending tuple %s" % payload) + channel.basic_publish(exchange=self.exchange, routing_key=self.routing_key, + body=bytes(payload, encoding='utf8')) + print("... sent tuple") + channel.close() diff --git a/swagger/api/api_broker/__init__.py b/swagger/api/api_broker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/swagger/api/api_container/__init__.py b/swagger/api/api_container/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c37bd1a9543340cd1effa2d5e3de96fdf13f5375 --- /dev/null +++ b/swagger/api/api_container/__init__.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Container Service API + + Service that manages the containers # 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_container.api.container_endpoint_api import ContainerEndpointApi +from api_container.api.image_endpoint_api import ImageEndpointApi +# import ApiClient +from api_container.api_client import ApiClient +from api_container.configuration import Configuration +# import models into sdk package +from api_container.models.api_error_dto import ApiErrorDto +from api_container.models.container_brief_dto import ContainerBriefDto +from api_container.models.container_change_dto import ContainerChangeDto +from api_container.models.container_create_request_dto import ContainerCreateRequestDto +from api_container.models.container_dto import ContainerDto +from api_container.models.database_dto import DatabaseDto +from api_container.models.image_brief_dto import ImageBriefDto +from api_container.models.image_change_dto import ImageChangeDto +from api_container.models.image_create_dto import ImageCreateDto +from api_container.models.image_date_dto import ImageDateDto +from api_container.models.image_dto import ImageDto +from api_container.models.image_env_item_dto import ImageEnvItemDto +from api_container.models.license_dto import LicenseDto +from api_container.models.table_brief_dto import TableBriefDto +from api_container.models.user_brief_dto import UserBriefDto diff --git a/swagger/api/api_container/api/__init__.py b/swagger/api/api_container/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d903cb3dd5087e37881f6992daaea4d79590eef6 --- /dev/null +++ b/swagger/api/api_container/api/__init__.py @@ -0,0 +1,7 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_container.api.container_endpoint_api import ContainerEndpointApi +from api_container.api.image_endpoint_api import ImageEndpointApi diff --git a/swagger/api/api_container/api/container_endpoint_api.py b/swagger/api/api_container/api/container_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..07eabb2287cafb8bfa40752852399db22125ed23 --- /dev/null +++ b/swagger/api/api_container/api/container_endpoint_api.py @@ -0,0 +1,506 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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_container.api_client import ApiClient + + +class ContainerEndpointApi(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 create1(self, body, **kwargs): # noqa: E501 + """Create container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create1(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ContainerCreateRequestDto body: (required) + :return: ContainerBriefDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create1_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create1_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create1_with_http_info(self, body, **kwargs): # noqa: E501 + """Create container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create1_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ContainerCreateRequestDto body: (required) + :return: ContainerBriefDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 create1" % 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 `create1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ContainerBriefDto', # 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 delete1(self, id, **kwargs): # noqa: E501 + """Delete some container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete1(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (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.delete1_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete1_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete1_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete some container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete1_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 delete1" % key + ) + params[key] = val + del params['kwargs'] + # 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 `delete1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}', 'DELETE', + 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) + + def find_all1(self, **kwargs): # noqa: E501 + """Find all containers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all1(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ContainerBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all1_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.find_all1_with_http_info(**kwargs) # noqa: E501 + return data + + def find_all1_with_http_info(self, **kwargs): # noqa: E501 + """Find all containers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all1_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ContainerBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # 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 find_all1" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/container', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ContainerBriefDto]', # 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 find_by_id1(self, id, **kwargs): # noqa: E501 + """Find some container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_by_id1(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: ContainerDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_by_id1_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.find_by_id1_with_http_info(id, **kwargs) # noqa: E501 + return data + + def find_by_id1_with_http_info(self, id, **kwargs): # noqa: E501 + """Find some container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_by_id1_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: ContainerDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_by_id1" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_by_id1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ContainerDto', # 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 modify(self, body, id, **kwargs): # noqa: E501 + """Modify some container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.modify(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ContainerChangeDto body: (required) + :param int id: (required) + :return: ContainerBriefDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.modify_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.modify_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def modify_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Modify some container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.modify_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ContainerChangeDto body: (required) + :param int id: (required) + :return: ContainerBriefDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 modify" % 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 `modify`") # 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 `modify`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ContainerBriefDto', # 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/swagger/api/api_container/api/image_endpoint_api.py b/swagger/api/api_container/api/image_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..d85d81adc68c8a7c4a81de4732f59f0213112424 --- /dev/null +++ b/swagger/api/api_container/api/image_endpoint_api.py @@ -0,0 +1,506 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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_container.api_client import ApiClient + + +class ImageEndpointApi(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 create(self, body, **kwargs): # noqa: E501 + """Create image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ImageCreateDto body: (required) + :return: ImageDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create_with_http_info(self, body, **kwargs): # noqa: E501 + """Create image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ImageCreateDto body: (required) + :return: ImageDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 create" % 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 `create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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/image', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ImageDto', # 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 delete(self, id, **kwargs): # noqa: E501 + """Delete some image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (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.delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete some image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 delete" % key + ) + params[key] = val + del params['kwargs'] + # 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 `delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/image/{id}', 'DELETE', + 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) + + def find_all(self, **kwargs): # noqa: E501 + """Find all images # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ImageBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.find_all_with_http_info(**kwargs) # noqa: E501 + return data + + def find_all_with_http_info(self, **kwargs): # noqa: E501 + """Find all images # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[ImageBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # 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 find_all" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/image', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ImageBriefDto]', # 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 find_by_id(self, id, **kwargs): # noqa: E501 + """Find some image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_by_id(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: ImageDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_by_id_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.find_by_id_with_http_info(id, **kwargs) # noqa: E501 + return data + + def find_by_id_with_http_info(self, id, **kwargs): # noqa: E501 + """Find some image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_by_id_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: ImageDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_by_id" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/image/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ImageDto', # 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, **kwargs): # noqa: E501 + """Update some image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ImageChangeDto body: (required) + :param int id: (required) + :return: ImageDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def update_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Update some image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ImageChangeDto body: (required) + :param int id: (required) + :return: ImageDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 update" % 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 `update`") # 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 `update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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/image/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ImageDto', # 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/swagger/api/api_container/api_client.py b/swagger/api/api_container/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..9a90db60ab22d3cf8b2ec0ea953b9939b231fb6f --- /dev/null +++ b/swagger/api/api_container/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Container Service API + + Service that manages the containers # 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_container.configuration import Configuration +import api_container.models +from api_container 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_container.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/swagger/api/api_container/configuration.py b/swagger/api/api_container/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..23d21b83810a226c542b2172f81bcb8fc607ce8b --- /dev/null +++ b/swagger/api/api_container/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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_container") + 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/swagger/api/api_container/models/__init__.py b/swagger/api/api_container/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..32e6e340214faf439abb16a103fd75f4c0cec578 --- /dev/null +++ b/swagger/api/api_container/models/__init__.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Container Service API + + Service that manages the containers # 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_container.models.api_error_dto import ApiErrorDto +from api_container.models.container_brief_dto import ContainerBriefDto +from api_container.models.container_change_dto import ContainerChangeDto +from api_container.models.container_create_request_dto import ContainerCreateRequestDto +from api_container.models.container_dto import ContainerDto +from api_container.models.database_dto import DatabaseDto +from api_container.models.image_brief_dto import ImageBriefDto +from api_container.models.image_change_dto import ImageChangeDto +from api_container.models.image_create_dto import ImageCreateDto +from api_container.models.image_date_dto import ImageDateDto +from api_container.models.image_dto import ImageDto +from api_container.models.image_env_item_dto import ImageEnvItemDto +from api_container.models.license_dto import LicenseDto +from api_container.models.table_brief_dto import TableBriefDto +from api_container.models.user_brief_dto import UserBriefDto diff --git a/swagger/api/api_container/models/api_error_dto.py b/swagger/api/api_container/models/api_error_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..4f8067fdcbc2e833c0b9a5e769be8a09cf5a9ffa --- /dev/null +++ b/swagger/api/api_container/models/api_error_dto.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ApiErrorDto(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 = { + 'status': 'str', + 'message': 'str', + 'code': 'str' + } + + attribute_map = { + 'status': 'status', + 'message': 'message', + 'code': 'code' + } + + def __init__(self, status=None, message=None, code=None): # noqa: E501 + """ApiErrorDto - a model defined in Swagger""" # noqa: E501 + self._status = None + self._message = None + self._code = None + self.discriminator = None + self.status = status + self.message = message + self.code = code + + @property + def status(self): + """Gets the status of this ApiErrorDto. # noqa: E501 + + + :return: The status of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ApiErrorDto. + + + :param status: The status of this ApiErrorDto. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["100 CONTINUE", "101 SWITCHING_PROTOCOLS", "102 PROCESSING", "103 CHECKPOINT", "200 OK", "201 CREATED", "202 ACCEPTED", "203 NON_AUTHORITATIVE_INFORMATION", "204 NO_CONTENT", "205 RESET_CONTENT", "206 PARTIAL_CONTENT", "207 MULTI_STATUS", "208 ALREADY_REPORTED", "226 IM_USED", "300 MULTIPLE_CHOICES", "301 MOVED_PERMANENTLY", "302 FOUND", "302 MOVED_TEMPORARILY", "303 SEE_OTHER", "304 NOT_MODIFIED", "305 USE_PROXY", "307 TEMPORARY_REDIRECT", "308 PERMANENT_REDIRECT", "400 BAD_REQUEST", "401 UNAUTHORIZED", "402 PAYMENT_REQUIRED", "403 FORBIDDEN", "404 NOT_FOUND", "405 METHOD_NOT_ALLOWED", "406 NOT_ACCEPTABLE", "407 PROXY_AUTHENTICATION_REQUIRED", "408 REQUEST_TIMEOUT", "409 CONFLICT", "410 GONE", "411 LENGTH_REQUIRED", "412 PRECONDITION_FAILED", "413 PAYLOAD_TOO_LARGE", "413 REQUEST_ENTITY_TOO_LARGE", "414 URI_TOO_LONG", "414 REQUEST_URI_TOO_LONG", "415 UNSUPPORTED_MEDIA_TYPE", "416 REQUESTED_RANGE_NOT_SATISFIABLE", "417 EXPECTATION_FAILED", "418 I_AM_A_TEAPOT", "419 INSUFFICIENT_SPACE_ON_RESOURCE", "420 METHOD_FAILURE", "421 DESTINATION_LOCKED", "422 UNPROCESSABLE_ENTITY", "423 LOCKED", "424 FAILED_DEPENDENCY", "425 TOO_EARLY", "426 UPGRADE_REQUIRED", "428 PRECONDITION_REQUIRED", "429 TOO_MANY_REQUESTS", "431 REQUEST_HEADER_FIELDS_TOO_LARGE", "451 UNAVAILABLE_FOR_LEGAL_REASONS", "500 INTERNAL_SERVER_ERROR", "501 NOT_IMPLEMENTED", "502 BAD_GATEWAY", "503 SERVICE_UNAVAILABLE", "504 GATEWAY_TIMEOUT", "505 HTTP_VERSION_NOT_SUPPORTED", "506 VARIANT_ALSO_NEGOTIATES", "507 INSUFFICIENT_STORAGE", "508 LOOP_DETECTED", "509 BANDWIDTH_LIMIT_EXCEEDED", "510 NOT_EXTENDED", "511 NETWORK_AUTHENTICATION_REQUIRED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def message(self): + """Gets the message of this ApiErrorDto. # noqa: E501 + + + :return: The message of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiErrorDto. + + + :param message: The message of this ApiErrorDto. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def code(self): + """Gets the code of this ApiErrorDto. # noqa: E501 + + + :return: The code of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiErrorDto. + + + :param code: The code of this ApiErrorDto. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + 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(ApiErrorDto, 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, ApiErrorDto): + 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/swagger/api/api_container/models/container_brief_dto.py b/swagger/api/api_container/models/container_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..7f3ed360118ec874f2589ed149190f416fdc8216 --- /dev/null +++ b/swagger/api/api_container/models/container_brief_dto.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ContainerBriefDto(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 = { + 'id': 'int', + 'hash': 'str', + 'name': 'str', + 'creator': 'UserBriefDto', + 'created': 'datetime', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'hash': 'hash', + 'name': 'name', + 'creator': 'creator', + 'created': 'created', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, hash=None, name=None, creator=None, created=None, internal_name=None): # noqa: E501 + """ContainerBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._hash = None + self._name = None + self._creator = None + self._created = None + self._internal_name = None + self.discriminator = None + self.id = id + self.hash = hash + self.name = name + if creator is not None: + self.creator = creator + if created is not None: + self.created = created + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this ContainerBriefDto. # noqa: E501 + + + :return: The id of this ContainerBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContainerBriefDto. + + + :param id: The id of this ContainerBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def hash(self): + """Gets the hash of this ContainerBriefDto. # noqa: E501 + + + :return: The hash of this ContainerBriefDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ContainerBriefDto. + + + :param hash: The hash of this ContainerBriefDto. # noqa: E501 + :type: str + """ + if hash is None: + raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501 + + self._hash = hash + + @property + def name(self): + """Gets the name of this ContainerBriefDto. # noqa: E501 + + + :return: The name of this ContainerBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerBriefDto. + + + :param name: The name of this ContainerBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this ContainerBriefDto. # noqa: E501 + + + :return: The creator of this ContainerBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this ContainerBriefDto. + + + :param creator: The creator of this ContainerBriefDto. # noqa: E501 + :type: UserBriefDto + """ + + self._creator = creator + + @property + def created(self): + """Gets the created of this ContainerBriefDto. # noqa: E501 + + + :return: The created of this ContainerBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ContainerBriefDto. + + + :param created: The created of this ContainerBriefDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def internal_name(self): + """Gets the internal_name of this ContainerBriefDto. # noqa: E501 + + + :return: The internal_name of this ContainerBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ContainerBriefDto. + + + :param internal_name: The internal_name of this ContainerBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(ContainerBriefDto, 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, ContainerBriefDto): + 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/swagger/api/api_container/models/container_change_dto.py b/swagger/api/api_container/models/container_change_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..53972bef23d532a251b205821058e9a1dc73cb15 --- /dev/null +++ b/swagger/api/api_container/models/container_change_dto.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ContainerChangeDto(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 = { + 'action': 'str' + } + + attribute_map = { + 'action': 'action' + } + + def __init__(self, action=None): # noqa: E501 + """ContainerChangeDto - a model defined in Swagger""" # noqa: E501 + self._action = None + self.discriminator = None + self.action = action + + @property + def action(self): + """Gets the action of this ContainerChangeDto. # noqa: E501 + + + :return: The action of this ContainerChangeDto. # noqa: E501 + :rtype: str + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this ContainerChangeDto. + + + :param action: The action of this ContainerChangeDto. # noqa: E501 + :type: str + """ + if action is None: + raise ValueError("Invalid value for `action`, must not be `None`") # noqa: E501 + allowed_values = ["start", "stop"] # noqa: E501 + if action not in allowed_values: + raise ValueError( + "Invalid value for `action` ({0}), must be one of {1}" # noqa: E501 + .format(action, allowed_values) + ) + + self._action = action + + 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(ContainerChangeDto, 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, ContainerChangeDto): + 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/swagger/api/api_container/models/container_create_request_dto.py b/swagger/api/api_container/models/container_create_request_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..6ada3a3be16a350bddeed0e447b0d300ff0d0f3f --- /dev/null +++ b/swagger/api/api_container/models/container_create_request_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ContainerCreateRequestDto(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 = { + 'name': 'str', + 'repository': 'str', + 'tag': 'str' + } + + attribute_map = { + 'name': 'name', + 'repository': 'repository', + 'tag': 'tag' + } + + def __init__(self, name=None, repository=None, tag=None): # noqa: E501 + """ContainerCreateRequestDto - a model defined in Swagger""" # noqa: E501 + self._name = None + self._repository = None + self._tag = None + self.discriminator = None + self.name = name + self.repository = repository + self.tag = tag + + @property + def name(self): + """Gets the name of this ContainerCreateRequestDto. # noqa: E501 + + + :return: The name of this ContainerCreateRequestDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerCreateRequestDto. + + + :param name: The name of this ContainerCreateRequestDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def repository(self): + """Gets the repository of this ContainerCreateRequestDto. # noqa: E501 + + + :return: The repository of this ContainerCreateRequestDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ContainerCreateRequestDto. + + + :param repository: The repository of this ContainerCreateRequestDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ContainerCreateRequestDto. # noqa: E501 + + + :return: The tag of this ContainerCreateRequestDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ContainerCreateRequestDto. + + + :param tag: The tag of this ContainerCreateRequestDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + 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(ContainerCreateRequestDto, 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, ContainerCreateRequestDto): + 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/swagger/api/api_container/models/container_dto.py b/swagger/api/api_container/models/container_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..0be42d21d1d2692b65afe99388fb1eccd24a93cf --- /dev/null +++ b/swagger/api/api_container/models/container_dto.py @@ -0,0 +1,355 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ContainerDto(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 = { + 'id': 'int', + 'hash': 'str', + 'name': 'str', + 'state': 'str', + 'databases': 'list[DatabaseDto]', + 'image': 'ImageBriefDto', + 'port': 'int', + 'created': 'datetime', + 'internal_name': 'str', + 'ip_address': 'str' + } + + attribute_map = { + 'id': 'id', + 'hash': 'hash', + 'name': 'name', + 'state': 'state', + 'databases': 'databases', + 'image': 'image', + 'port': 'port', + 'created': 'created', + 'internal_name': 'internal_name', + 'ip_address': 'ip_address' + } + + def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + """ContainerDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._hash = None + self._name = None + self._state = None + self._databases = None + self._image = None + self._port = None + self._created = None + self._internal_name = None + self._ip_address = None + self.discriminator = None + self.id = id + self.hash = hash + self.name = name + if state is not None: + self.state = state + if databases is not None: + self.databases = databases + if image is not None: + self.image = image + if port is not None: + self.port = port + self.created = created + self.internal_name = internal_name + if ip_address is not None: + self.ip_address = ip_address + + @property + def id(self): + """Gets the id of this ContainerDto. # noqa: E501 + + + :return: The id of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContainerDto. + + + :param id: The id of this ContainerDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def hash(self): + """Gets the hash of this ContainerDto. # noqa: E501 + + + :return: The hash of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ContainerDto. + + + :param hash: The hash of this ContainerDto. # noqa: E501 + :type: str + """ + if hash is None: + raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501 + + self._hash = hash + + @property + def name(self): + """Gets the name of this ContainerDto. # noqa: E501 + + + :return: The name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerDto. + + + :param name: The name of this ContainerDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def state(self): + """Gets the state of this ContainerDto. # noqa: E501 + + + :return: The state of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this ContainerDto. + + + :param state: The state of this ContainerDto. # noqa: E501 + :type: str + """ + allowed_values = ["created", "restarting", "running", "paused", "exited", "dead"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def databases(self): + """Gets the databases of this ContainerDto. # noqa: E501 + + + :return: The databases of this ContainerDto. # noqa: E501 + :rtype: list[DatabaseDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this ContainerDto. + + + :param databases: The databases of this ContainerDto. # noqa: E501 + :type: list[DatabaseDto] + """ + + self._databases = databases + + @property + def image(self): + """Gets the image of this ContainerDto. # noqa: E501 + + + :return: The image of this ContainerDto. # noqa: E501 + :rtype: ImageBriefDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this ContainerDto. + + + :param image: The image of this ContainerDto. # noqa: E501 + :type: ImageBriefDto + """ + + self._image = image + + @property + def port(self): + """Gets the port of this ContainerDto. # noqa: E501 + + + :return: The port of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this ContainerDto. + + + :param port: The port of this ContainerDto. # noqa: E501 + :type: int + """ + + self._port = port + + @property + def created(self): + """Gets the created of this ContainerDto. # noqa: E501 + + + :return: The created of this ContainerDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ContainerDto. + + + :param created: The created of this ContainerDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def internal_name(self): + """Gets the internal_name of this ContainerDto. # noqa: E501 + + + :return: The internal_name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ContainerDto. + + + :param internal_name: The internal_name of this ContainerDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + @property + def ip_address(self): + """Gets the ip_address of this ContainerDto. # noqa: E501 + + + :return: The ip_address of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """Sets the ip_address of this ContainerDto. + + + :param ip_address: The ip_address of this ContainerDto. # noqa: E501 + :type: str + """ + + self._ip_address = ip_address + + 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(ContainerDto, 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, ContainerDto): + 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/swagger/api/api_container/models/database_dto.py b/swagger/api/api_container/models/database_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..4c1e4837496cdf9051cf1ee03fcb8e4882734298 --- /dev/null +++ b/swagger/api/api_container/models/database_dto.py @@ -0,0 +1,589 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 DatabaseDto(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 = { + 'id': 'int', + 'name': 'str', + 'exchange': 'str', + 'creator': 'UserBriefDto', + 'subjects': 'list[str]', + 'language': 'str', + 'license': 'LicenseDto', + 'description': 'str', + 'publisher': 'str', + 'tables': 'list[TableBriefDto]', + 'image': 'ImageDto', + 'container': 'ContainerDto', + 'created': 'datetime', + 'deleted': 'datetime', + 'internal_name': 'str', + 'publication_year': 'int', + 'publication_month': 'int', + 'publication_day': 'int', + 'is_public': 'bool' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'exchange': 'exchange', + 'creator': 'creator', + 'subjects': 'subjects', + 'language': 'language', + 'license': 'license', + 'description': 'description', + 'publisher': 'publisher', + 'tables': 'tables', + 'image': 'image', + 'container': 'container', + 'created': 'created', + 'deleted': 'deleted', + 'internal_name': 'internal_name', + 'publication_year': 'publication_year', + 'publication_month': 'publication_month', + 'publication_day': 'publication_day', + 'is_public': 'is_public' + } + + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_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._tables = None + self._image = None + self._container = None + self._created = None + self._deleted = None + self._internal_name = None + self._publication_year = None + self._publication_month = None + self._publication_day = None + self._is_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 tables is not None: + self.tables = tables + if image is not None: + self.image = image + if container is not None: + self.container = container + if created is not None: + self.created = created + if deleted is not None: + self.deleted = deleted + self.internal_name = internal_name + if publication_year is not None: + self.publication_year = 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 is_public is not None: + self.is_public = is_public + + @property + def id(self): + """Gets the id of this DatabaseDto. # noqa: E501 + + + :return: The id of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DatabaseDto. + + + :param id: The id of this DatabaseDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this DatabaseDto. # noqa: E501 + + + :return: The name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DatabaseDto. + + + :param name: The name of this DatabaseDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def exchange(self): + """Gets the exchange of this DatabaseDto. # noqa: E501 + + + :return: The exchange of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this DatabaseDto. + + + :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :type: str + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def creator(self): + """Gets the creator of this DatabaseDto. # noqa: E501 + + + :return: The creator of this DatabaseDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this DatabaseDto. + + + :param creator: The creator of this DatabaseDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def subjects(self): + """Gets the subjects of this DatabaseDto. # noqa: E501 + + + :return: The subjects of this DatabaseDto. # noqa: E501 + :rtype: list[str] + """ + return self._subjects + + @subjects.setter + def subjects(self, subjects): + """Sets the subjects of this DatabaseDto. + + + :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :type: list[str] + """ + + self._subjects = subjects + + @property + def language(self): + """Gets the language of this DatabaseDto. # noqa: E501 + + + :return: The language of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this DatabaseDto. + + + :param language: The 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: + raise ValueError( + "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 + .format(language, allowed_values) + ) + + self._language = language + + @property + def license(self): + """Gets the license of this DatabaseDto. # noqa: E501 + + + :return: The license of this DatabaseDto. # noqa: E501 + :rtype: LicenseDto + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this DatabaseDto. + + + :param license: The license of this DatabaseDto. # noqa: E501 + :type: LicenseDto + """ + + self._license = license + + @property + def description(self): + """Gets the description of this DatabaseDto. # noqa: E501 + + + :return: The description of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this DatabaseDto. + + + :param description: The description of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def publisher(self): + """Gets the publisher of this DatabaseDto. # noqa: E501 + + + :return: The publisher of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this DatabaseDto. + + + :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._publisher = publisher + + @property + def tables(self): + """Gets the tables of this DatabaseDto. # noqa: E501 + + + :return: The tables of this DatabaseDto. # noqa: E501 + :rtype: list[TableBriefDto] + """ + return self._tables + + @tables.setter + def tables(self, tables): + """Sets the tables of this DatabaseDto. + + + :param tables: The tables of this DatabaseDto. # noqa: E501 + :type: list[TableBriefDto] + """ + + self._tables = tables + + @property + def image(self): + """Gets the image of this DatabaseDto. # noqa: E501 + + + :return: The image of this DatabaseDto. # noqa: E501 + :rtype: ImageDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this DatabaseDto. + + + :param image: The image of this DatabaseDto. # noqa: E501 + :type: ImageDto + """ + + self._image = image + + @property + def container(self): + """Gets the container of this DatabaseDto. # noqa: E501 + + + :return: The container of this DatabaseDto. # noqa: E501 + :rtype: ContainerDto + """ + return self._container + + @container.setter + def container(self, container): + """Sets the container of this DatabaseDto. + + + :param container: The container of this DatabaseDto. # noqa: E501 + :type: ContainerDto + """ + + self._container = container + + @property + def created(self): + """Gets the created of this DatabaseDto. # noqa: E501 + + + :return: The created of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseDto. + + + :param created: The created of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def deleted(self): + """Gets the deleted of this DatabaseDto. # noqa: E501 + + + :return: The deleted of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this DatabaseDto. + + + :param deleted: The deleted of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._deleted = deleted + + @property + def internal_name(self): + """Gets the internal_name of this DatabaseDto. # noqa: E501 + + + :return: The internal_name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this DatabaseDto. + + + :param internal_name: The 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 + + self._internal_name = internal_name + + @property + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 + + + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. + + + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_year = publication_year + + @property + def publication_month(self): + """Gets the publication_month of this DatabaseDto. # noqa: E501 + + + :return: The publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this DatabaseDto. + + + :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_day(self): + """Gets the publication_day of this DatabaseDto. # noqa: E501 + + + :return: The publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this DatabaseDto. + + + :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def is_public(self): + """Gets the is_public of this DatabaseDto. # noqa: E501 + + + :return: The is_public of this DatabaseDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseDto. + + + :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :type: bool + """ + + 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(DatabaseDto, 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, DatabaseDto): + 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/swagger/api/api_container/models/granted_authority_dto.py b/swagger/api/api_container/models/granted_authority_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..90e4f275324e10027d0498536655ae32339007c0 --- /dev/null +++ b/swagger/api/api_container/models/granted_authority_dto.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 GrantedAuthorityDto(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 = { + 'authority': 'str' + } + + attribute_map = { + 'authority': 'authority' + } + + def __init__(self, authority=None): # noqa: E501 + """GrantedAuthorityDto - a model defined in Swagger""" # noqa: E501 + self._authority = None + self.discriminator = None + if authority is not None: + self.authority = authority + + @property + def authority(self): + """Gets the authority of this GrantedAuthorityDto. # noqa: E501 + + + :return: The authority of this GrantedAuthorityDto. # noqa: E501 + :rtype: str + """ + return self._authority + + @authority.setter + def authority(self, authority): + """Sets the authority of this GrantedAuthorityDto. + + + :param authority: The authority of this GrantedAuthorityDto. # noqa: E501 + :type: str + """ + + self._authority = authority + + 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(GrantedAuthorityDto, 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, GrantedAuthorityDto): + 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/swagger/api/api_container/models/image_brief_dto.py b/swagger/api/api_container/models/image_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..9b88ef6b4d7bf368e5af67dee1dbca0a49431379 --- /dev/null +++ b/swagger/api/api_container/models/image_brief_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ImageBriefDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag' + } + + def __init__(self, id=None, repository=None, tag=None): # noqa: E501 + """ImageBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + + @property + def id(self): + """Gets the id of this ImageBriefDto. # noqa: E501 + + + :return: The id of this ImageBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageBriefDto. + + + :param id: The id of this ImageBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageBriefDto. # noqa: E501 + + + :return: The repository of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageBriefDto. + + + :param repository: The repository of this ImageBriefDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageBriefDto. # noqa: E501 + + + :return: The tag of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageBriefDto. + + + :param tag: The tag of this ImageBriefDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + 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(ImageBriefDto, 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, ImageBriefDto): + 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/swagger/api/api_container/models/image_change_dto.py b/swagger/api/api_container/models/image_change_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ee455f431a8444c195db6dd5edaa74358624cdd9 --- /dev/null +++ b/swagger/api/api_container/models/image_change_dto.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ImageChangeDto(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 = { + 'default_port': 'int', + 'environment': 'list[ImageEnvItemDto]', + 'dialect': 'str', + 'driver_class': 'str', + 'jdbc_method': 'str' + } + + attribute_map = { + 'default_port': 'defaultPort', + 'environment': 'environment', + 'dialect': 'dialect', + 'driver_class': 'driver_class', + 'jdbc_method': 'jdbc_method' + } + + def __init__(self, default_port=None, environment=None, dialect=None, driver_class=None, jdbc_method=None): # noqa: E501 + """ImageChangeDto - a model defined in Swagger""" # noqa: E501 + self._default_port = None + self._environment = None + self._dialect = None + self._driver_class = None + self._jdbc_method = None + self.discriminator = None + if default_port is not None: + self.default_port = default_port + if environment is not None: + self.environment = environment + self.dialect = dialect + self.driver_class = driver_class + self.jdbc_method = jdbc_method + + @property + def default_port(self): + """Gets the default_port of this ImageChangeDto. # noqa: E501 + + + :return: The default_port of this ImageChangeDto. # noqa: E501 + :rtype: int + """ + return self._default_port + + @default_port.setter + def default_port(self, default_port): + """Sets the default_port of this ImageChangeDto. + + + :param default_port: The default_port of this ImageChangeDto. # noqa: E501 + :type: int + """ + + self._default_port = default_port + + @property + def environment(self): + """Gets the environment of this ImageChangeDto. # noqa: E501 + + + :return: The environment of this ImageChangeDto. # noqa: E501 + :rtype: list[ImageEnvItemDto] + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this ImageChangeDto. + + + :param environment: The environment of this ImageChangeDto. # noqa: E501 + :type: list[ImageEnvItemDto] + """ + + self._environment = environment + + @property + def dialect(self): + """Gets the dialect of this ImageChangeDto. # noqa: E501 + + + :return: The dialect of this ImageChangeDto. # noqa: E501 + :rtype: str + """ + return self._dialect + + @dialect.setter + def dialect(self, dialect): + """Sets the dialect of this ImageChangeDto. + + + :param dialect: The dialect of this ImageChangeDto. # noqa: E501 + :type: str + """ + if dialect is None: + raise ValueError("Invalid value for `dialect`, must not be `None`") # noqa: E501 + + self._dialect = dialect + + @property + def driver_class(self): + """Gets the driver_class of this ImageChangeDto. # noqa: E501 + + + :return: The driver_class of this ImageChangeDto. # noqa: E501 + :rtype: str + """ + return self._driver_class + + @driver_class.setter + def driver_class(self, driver_class): + """Sets the driver_class of this ImageChangeDto. + + + :param driver_class: The driver_class of this ImageChangeDto. # noqa: E501 + :type: str + """ + if driver_class is None: + raise ValueError("Invalid value for `driver_class`, must not be `None`") # noqa: E501 + + self._driver_class = driver_class + + @property + def jdbc_method(self): + """Gets the jdbc_method of this ImageChangeDto. # noqa: E501 + + + :return: The jdbc_method of this ImageChangeDto. # noqa: E501 + :rtype: str + """ + return self._jdbc_method + + @jdbc_method.setter + def jdbc_method(self, jdbc_method): + """Sets the jdbc_method of this ImageChangeDto. + + + :param jdbc_method: The jdbc_method of this ImageChangeDto. # noqa: E501 + :type: str + """ + if jdbc_method is None: + raise ValueError("Invalid value for `jdbc_method`, must not be `None`") # noqa: E501 + + self._jdbc_method = jdbc_method + + 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(ImageChangeDto, 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, ImageChangeDto): + 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/swagger/api/api_container/models/image_create_dto.py b/swagger/api/api_container/models/image_create_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..43bf86e8f014a28de06c5b073689837b52d9be85 --- /dev/null +++ b/swagger/api/api_container/models/image_create_dto.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ImageCreateDto(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 = { + 'repository': 'str', + 'tag': 'str', + 'dialect': 'str', + 'environment': 'list[ImageEnvItemDto]', + 'driver_class': 'str', + 'jdbc_method': 'str', + 'default_port': 'int' + } + + attribute_map = { + 'repository': 'repository', + 'tag': 'tag', + 'dialect': 'dialect', + 'environment': 'environment', + 'driver_class': 'driver_class', + 'jdbc_method': 'jdbc_method', + 'default_port': 'default_port' + } + + def __init__(self, repository=None, tag=None, dialect=None, environment=None, driver_class=None, jdbc_method=None, default_port=None): # noqa: E501 + """ImageCreateDto - a model defined in Swagger""" # noqa: E501 + self._repository = None + self._tag = None + self._dialect = None + self._environment = None + self._driver_class = None + self._jdbc_method = None + self._default_port = None + self.discriminator = None + self.repository = repository + self.tag = tag + self.dialect = dialect + if environment is not None: + self.environment = environment + self.driver_class = driver_class + self.jdbc_method = jdbc_method + self.default_port = default_port + + @property + def repository(self): + """Gets the repository of this ImageCreateDto. # noqa: E501 + + + :return: The repository of this ImageCreateDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageCreateDto. + + + :param repository: The repository of this ImageCreateDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageCreateDto. # noqa: E501 + + + :return: The tag of this ImageCreateDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageCreateDto. + + + :param tag: The tag of this ImageCreateDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + @property + def dialect(self): + """Gets the dialect of this ImageCreateDto. # noqa: E501 + + + :return: The dialect of this ImageCreateDto. # noqa: E501 + :rtype: str + """ + return self._dialect + + @dialect.setter + def dialect(self, dialect): + """Sets the dialect of this ImageCreateDto. + + + :param dialect: The dialect of this ImageCreateDto. # noqa: E501 + :type: str + """ + if dialect is None: + raise ValueError("Invalid value for `dialect`, must not be `None`") # noqa: E501 + + self._dialect = dialect + + @property + def environment(self): + """Gets the environment of this ImageCreateDto. # noqa: E501 + + + :return: The environment of this ImageCreateDto. # noqa: E501 + :rtype: list[ImageEnvItemDto] + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this ImageCreateDto. + + + :param environment: The environment of this ImageCreateDto. # noqa: E501 + :type: list[ImageEnvItemDto] + """ + + self._environment = environment + + @property + def driver_class(self): + """Gets the driver_class of this ImageCreateDto. # noqa: E501 + + + :return: The driver_class of this ImageCreateDto. # noqa: E501 + :rtype: str + """ + return self._driver_class + + @driver_class.setter + def driver_class(self, driver_class): + """Sets the driver_class of this ImageCreateDto. + + + :param driver_class: The driver_class of this ImageCreateDto. # noqa: E501 + :type: str + """ + if driver_class is None: + raise ValueError("Invalid value for `driver_class`, must not be `None`") # noqa: E501 + + self._driver_class = driver_class + + @property + def jdbc_method(self): + """Gets the jdbc_method of this ImageCreateDto. # noqa: E501 + + + :return: The jdbc_method of this ImageCreateDto. # noqa: E501 + :rtype: str + """ + return self._jdbc_method + + @jdbc_method.setter + def jdbc_method(self, jdbc_method): + """Sets the jdbc_method of this ImageCreateDto. + + + :param jdbc_method: The jdbc_method of this ImageCreateDto. # noqa: E501 + :type: str + """ + if jdbc_method is None: + raise ValueError("Invalid value for `jdbc_method`, must not be `None`") # noqa: E501 + + self._jdbc_method = jdbc_method + + @property + def default_port(self): + """Gets the default_port of this ImageCreateDto. # noqa: E501 + + + :return: The default_port of this ImageCreateDto. # noqa: E501 + :rtype: int + """ + return self._default_port + + @default_port.setter + def default_port(self, default_port): + """Sets the default_port of this ImageCreateDto. + + + :param default_port: The default_port of this ImageCreateDto. # noqa: E501 + :type: int + """ + if default_port is None: + raise ValueError("Invalid value for `default_port`, must not be `None`") # noqa: E501 + + self._default_port = default_port + + 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(ImageCreateDto, 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, ImageCreateDto): + 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/swagger/api/api_container/models/image_date_dto.py b/swagger/api/api_container/models/image_date_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..dfee1f2a7d933f03a4bf99fc0f168a95df944329 --- /dev/null +++ b/swagger/api/api_container/models/image_date_dto.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ImageDateDto(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 = { + 'id': 'int', + 'example': 'str', + 'database_format': 'str', + 'unix_format': 'str', + 'has_time': 'bool', + 'created_at': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'example': 'example', + 'database_format': 'database_format', + 'unix_format': 'unix_format', + 'has_time': 'has_time', + 'created_at': 'created_at' + } + + def __init__(self, id=None, example=None, database_format=None, unix_format=None, has_time=None, created_at=None): # noqa: E501 + """ImageDateDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._example = None + self._database_format = None + self._unix_format = None + self._has_time = None + self._created_at = None + self.discriminator = None + self.id = id + self.example = example + self.database_format = database_format + self.unix_format = unix_format + self.has_time = has_time + if created_at is not None: + self.created_at = created_at + + @property + def id(self): + """Gets the id of this ImageDateDto. # noqa: E501 + + + :return: The id of this ImageDateDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDateDto. + + + :param id: The id of this ImageDateDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def example(self): + """Gets the example of this ImageDateDto. # noqa: E501 + + + :return: The example of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._example + + @example.setter + def example(self, example): + """Sets the example of this ImageDateDto. + + + :param example: The example of this ImageDateDto. # noqa: E501 + :type: str + """ + if example is None: + raise ValueError("Invalid value for `example`, must not be `None`") # noqa: E501 + + self._example = example + + @property + def database_format(self): + """Gets the database_format of this ImageDateDto. # noqa: E501 + + + :return: The database_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._database_format + + @database_format.setter + def database_format(self, database_format): + """Sets the database_format of this ImageDateDto. + + + :param database_format: The database_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if database_format is None: + raise ValueError("Invalid value for `database_format`, must not be `None`") # noqa: E501 + + self._database_format = database_format + + @property + def unix_format(self): + """Gets the unix_format of this ImageDateDto. # noqa: E501 + + + :return: The unix_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._unix_format + + @unix_format.setter + def unix_format(self, unix_format): + """Sets the unix_format of this ImageDateDto. + + + :param unix_format: The unix_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if unix_format is None: + raise ValueError("Invalid value for `unix_format`, must not be `None`") # noqa: E501 + + self._unix_format = unix_format + + @property + def has_time(self): + """Gets the has_time of this ImageDateDto. # noqa: E501 + + + :return: The has_time of this ImageDateDto. # noqa: E501 + :rtype: bool + """ + return self._has_time + + @has_time.setter + def has_time(self, has_time): + """Sets the has_time of this ImageDateDto. + + + :param has_time: The has_time of this ImageDateDto. # noqa: E501 + :type: bool + """ + if has_time is None: + raise ValueError("Invalid value for `has_time`, must not be `None`") # noqa: E501 + + self._has_time = has_time + + @property + def created_at(self): + """Gets the created_at of this ImageDateDto. # noqa: E501 + + + :return: The created_at of this ImageDateDto. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ImageDateDto. + + + :param created_at: The created_at of this ImageDateDto. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + 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(ImageDateDto, 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, ImageDateDto): + 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/swagger/api/api_container/models/image_dto.py b/swagger/api/api_container/models/image_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..405fe0625622c2df139734e16d38f080d738becd --- /dev/null +++ b/swagger/api/api_container/models/image_dto.py @@ -0,0 +1,404 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ImageDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str', + 'dialect': 'str', + 'hash': 'str', + 'compiled': 'datetime', + 'size': 'int', + 'environment': 'list[ImageEnvItemDto]', + 'driver_class': 'str', + 'date_formats': 'list[ImageDateDto]', + 'jdbc_method': 'str', + 'default_port': 'int' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag', + 'dialect': 'dialect', + 'hash': 'hash', + 'compiled': 'compiled', + 'size': 'size', + 'environment': 'environment', + 'driver_class': 'driver_class', + 'date_formats': 'date_formats', + 'jdbc_method': 'jdbc_method', + 'default_port': 'default_port' + } + + def __init__(self, id=None, repository=None, tag=None, dialect=None, hash=None, compiled=None, size=None, environment=None, driver_class=None, date_formats=None, jdbc_method=None, default_port=None): # noqa: E501 + """ImageDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self._dialect = None + self._hash = None + self._compiled = None + self._size = None + self._environment = None + self._driver_class = None + self._date_formats = None + self._jdbc_method = None + self._default_port = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + self.dialect = dialect + if hash is not None: + self.hash = hash + if compiled is not None: + self.compiled = compiled + if size is not None: + self.size = size + self.environment = environment + self.driver_class = driver_class + if date_formats is not None: + self.date_formats = date_formats + self.jdbc_method = jdbc_method + self.default_port = default_port + + @property + def id(self): + """Gets the id of this ImageDto. # noqa: E501 + + + :return: The id of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDto. + + + :param id: The id of this ImageDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageDto. # noqa: E501 + + + :return: The repository of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageDto. + + + :param repository: The repository of this ImageDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageDto. # noqa: E501 + + + :return: The tag of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageDto. + + + :param tag: The tag of this ImageDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + @property + def dialect(self): + """Gets the dialect of this ImageDto. # noqa: E501 + + + :return: The dialect of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._dialect + + @dialect.setter + def dialect(self, dialect): + """Sets the dialect of this ImageDto. + + + :param dialect: The dialect of this ImageDto. # noqa: E501 + :type: str + """ + if dialect is None: + raise ValueError("Invalid value for `dialect`, must not be `None`") # noqa: E501 + + self._dialect = dialect + + @property + def hash(self): + """Gets the hash of this ImageDto. # noqa: E501 + + + :return: The hash of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ImageDto. + + + :param hash: The hash of this ImageDto. # noqa: E501 + :type: str + """ + + self._hash = hash + + @property + def compiled(self): + """Gets the compiled of this ImageDto. # noqa: E501 + + + :return: The compiled of this ImageDto. # noqa: E501 + :rtype: datetime + """ + return self._compiled + + @compiled.setter + def compiled(self, compiled): + """Sets the compiled of this ImageDto. + + + :param compiled: The compiled of this ImageDto. # noqa: E501 + :type: datetime + """ + + self._compiled = compiled + + @property + def size(self): + """Gets the size of this ImageDto. # noqa: E501 + + + :return: The size of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this ImageDto. + + + :param size: The size of this ImageDto. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def environment(self): + """Gets the environment of this ImageDto. # noqa: E501 + + + :return: The environment of this ImageDto. # noqa: E501 + :rtype: list[ImageEnvItemDto] + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this ImageDto. + + + :param environment: The environment of this ImageDto. # noqa: E501 + :type: list[ImageEnvItemDto] + """ + if environment is None: + raise ValueError("Invalid value for `environment`, must not be `None`") # noqa: E501 + + self._environment = environment + + @property + def driver_class(self): + """Gets the driver_class of this ImageDto. # noqa: E501 + + + :return: The driver_class of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._driver_class + + @driver_class.setter + def driver_class(self, driver_class): + """Sets the driver_class of this ImageDto. + + + :param driver_class: The driver_class of this ImageDto. # noqa: E501 + :type: str + """ + if driver_class is None: + raise ValueError("Invalid value for `driver_class`, must not be `None`") # noqa: E501 + + self._driver_class = driver_class + + @property + def date_formats(self): + """Gets the date_formats of this ImageDto. # noqa: E501 + + + :return: The date_formats of this ImageDto. # noqa: E501 + :rtype: list[ImageDateDto] + """ + return self._date_formats + + @date_formats.setter + def date_formats(self, date_formats): + """Sets the date_formats of this ImageDto. + + + :param date_formats: The date_formats of this ImageDto. # noqa: E501 + :type: list[ImageDateDto] + """ + + self._date_formats = date_formats + + @property + def jdbc_method(self): + """Gets the jdbc_method of this ImageDto. # noqa: E501 + + + :return: The jdbc_method of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._jdbc_method + + @jdbc_method.setter + def jdbc_method(self, jdbc_method): + """Sets the jdbc_method of this ImageDto. + + + :param jdbc_method: The jdbc_method of this ImageDto. # noqa: E501 + :type: str + """ + if jdbc_method is None: + raise ValueError("Invalid value for `jdbc_method`, must not be `None`") # noqa: E501 + + self._jdbc_method = jdbc_method + + @property + def default_port(self): + """Gets the default_port of this ImageDto. # noqa: E501 + + + :return: The default_port of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._default_port + + @default_port.setter + def default_port(self, default_port): + """Sets the default_port of this ImageDto. + + + :param default_port: The default_port of this ImageDto. # noqa: E501 + :type: int + """ + if default_port is None: + raise ValueError("Invalid value for `default_port`, must not be `None`") # noqa: E501 + + self._default_port = default_port + + 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(ImageDto, 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, ImageDto): + 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/swagger/api/api_container/models/image_env_item_dto.py b/swagger/api/api_container/models/image_env_item_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e414cf91202f219a15c36661940fe394e084a7da --- /dev/null +++ b/swagger/api/api_container/models/image_env_item_dto.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 ImageEnvItemDto(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 = { + 'iid': 'int', + 'key': 'str', + 'value': 'str', + 'type': 'str' + } + + attribute_map = { + 'iid': 'iid', + 'key': 'key', + 'value': 'value', + 'type': 'type' + } + + def __init__(self, iid=None, key=None, value=None, type=None): # noqa: E501 + """ImageEnvItemDto - a model defined in Swagger""" # noqa: E501 + self._iid = None + self._key = None + self._value = None + self._type = None + self.discriminator = None + self.iid = iid + self.key = key + self.value = value + self.type = type + + @property + def iid(self): + """Gets the iid of this ImageEnvItemDto. # noqa: E501 + + + :return: The iid of this ImageEnvItemDto. # noqa: E501 + :rtype: int + """ + return self._iid + + @iid.setter + def iid(self, iid): + """Sets the iid of this ImageEnvItemDto. + + + :param iid: The iid of this ImageEnvItemDto. # noqa: E501 + :type: int + """ + if iid is None: + raise ValueError("Invalid value for `iid`, must not be `None`") # noqa: E501 + + self._iid = iid + + @property + def key(self): + """Gets the key of this ImageEnvItemDto. # noqa: E501 + + + :return: The key of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this ImageEnvItemDto. + + + :param key: The key of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if key is None: + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value(self): + """Gets the value of this ImageEnvItemDto. # noqa: E501 + + + :return: The value of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ImageEnvItemDto. + + + :param value: The value of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this ImageEnvItemDto. # noqa: E501 + + + :return: The type of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ImageEnvItemDto. + + + :param type: The type of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["username", "password", "privileged_username", "privileged_password"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + 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(ImageEnvItemDto, 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, ImageEnvItemDto): + 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/swagger/api/api_container/models/license_dto.py b/swagger/api/api_container/models/license_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..deb3692f12245f38fb4e761a55c9922e7809d89f --- /dev/null +++ b/swagger/api/api_container/models/license_dto.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 LicenseDto(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 = { + 'identifier': 'str', + 'uri': 'str' + } + + attribute_map = { + 'identifier': 'identifier', + 'uri': 'uri' + } + + def __init__(self, identifier=None, uri=None): # noqa: E501 + """LicenseDto - a model defined in Swagger""" # noqa: E501 + self._identifier = None + self._uri = None + self.discriminator = None + self.identifier = identifier + self.uri = uri + + @property + def identifier(self): + """Gets the identifier of this LicenseDto. # noqa: E501 + + + :return: The identifier of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this LicenseDto. + + + :param identifier: The identifier of this LicenseDto. # noqa: E501 + :type: str + """ + if identifier is None: + raise ValueError("Invalid value for `identifier`, must not be `None`") # noqa: E501 + + self._identifier = identifier + + @property + def uri(self): + """Gets the uri of this LicenseDto. # noqa: E501 + + + :return: The uri of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this LicenseDto. + + + :param uri: The uri of this LicenseDto. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + 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(LicenseDto, 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, LicenseDto): + 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/swagger/api/api_container/models/table_brief_dto.py b/swagger/api/api_container/models/table_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..6aa1c9d655b5b342ed7ca3ec1f4a7ac58a2fcbf0 --- /dev/null +++ b/swagger/api/api_container/models/table_brief_dto.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 TableBriefDto(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 = { + 'id': 'int', + 'name': 'str', + 'creator': 'UserBriefDto', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator': 'creator', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + """TableBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._creator = None + self._internal_name = None + self.discriminator = None + self.id = id + self.name = name + self.creator = creator + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this TableBriefDto. # noqa: E501 + + + :return: The id of this TableBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TableBriefDto. + + + :param id: The id of this TableBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this TableBriefDto. # noqa: E501 + + + :return: The name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TableBriefDto. + + + :param name: The name of this TableBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this TableBriefDto. # noqa: E501 + + + :return: The creator of this TableBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this TableBriefDto. + + + :param creator: The creator of this TableBriefDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def internal_name(self): + """Gets the internal_name of this TableBriefDto. # noqa: E501 + + + :return: The internal_name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this TableBriefDto. + + + :param internal_name: The internal_name of this TableBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(TableBriefDto, 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, TableBriefDto): + 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/swagger/api/api_container/models/user_brief_dto.py b/swagger/api/api_container/models/user_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..15e5e217a9b1cc3b4ee91e65f422dc782a4c37ac --- /dev/null +++ b/swagger/api/api_container/models/user_brief_dto.py @@ -0,0 +1,350 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 UserBriefDto(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 = { + 'id': 'int', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserBriefDto. # noqa: E501 + + + :return: The id of this UserBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserBriefDto. + + + :param id: The id of this UserBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def username(self): + """Gets the username of this UserBriefDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserBriefDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserBriefDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserBriefDto. # noqa: E501 + + + :return: The firstname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserBriefDto. + + + :param firstname: The firstname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserBriefDto. # noqa: E501 + + + :return: The lastname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserBriefDto. + + + :param lastname: The lastname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserBriefDto. # noqa: E501 + + + :return: The affiliation of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserBriefDto. + + + :param affiliation: The affiliation of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserBriefDto. # noqa: E501 + + + :return: The orcid of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserBriefDto. + + + :param orcid: The orcid of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserBriefDto. # noqa: E501 + + + :return: The theme_dark of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserBriefDto. + + + :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserBriefDto. # noqa: E501 + + + :return: The email_verified of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserBriefDto. + + + :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserBriefDto, 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, UserBriefDto): + 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/swagger/api/api_container/models/user_dto.py b/swagger/api/api_container/models/user_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..1d4b0bbf7f7aa3c801b4b2ae734fac286b9a5a87 --- /dev/null +++ b/swagger/api/api_container/models/user_dto.py @@ -0,0 +1,479 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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 UserDto(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 = { + 'id': 'int', + 'authorities': 'list[GrantedAuthorityDto]', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'containers': 'list[ContainerDto]', + 'databases': 'list[ContainerDto]', + 'identifiers': 'list[ContainerDto]', + 'email': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'authorities': 'authorities', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'containers': 'containers', + 'databases': 'databases', + 'identifiers': 'identifiers', + 'email': 'email', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._authorities = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._containers = None + self._databases = None + self._identifiers = None + self._email = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + if authorities is not None: + self.authorities = authorities + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if containers is not None: + self.containers = containers + if databases is not None: + self.databases = databases + if identifiers is not None: + self.identifiers = identifiers + self.email = email + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserDto. # noqa: E501 + + + :return: The id of this UserDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserDto. + + + :param id: The id of this UserDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def authorities(self): + """Gets the authorities of this UserDto. # noqa: E501 + + + :return: The authorities of this UserDto. # noqa: E501 + :rtype: list[GrantedAuthorityDto] + """ + return self._authorities + + @authorities.setter + def authorities(self, authorities): + """Sets the authorities of this UserDto. + + + :param authorities: The authorities of this UserDto. # noqa: E501 + :type: list[GrantedAuthorityDto] + """ + + self._authorities = authorities + + @property + def username(self): + """Gets the username of this UserDto. # noqa: E501 + + + :return: The username of this UserDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserDto. + + + :param username: The username of this UserDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserDto. # noqa: E501 + + + :return: The firstname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserDto. + + + :param firstname: The firstname of this UserDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserDto. # noqa: E501 + + + :return: The lastname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserDto. + + + :param lastname: The lastname of this UserDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserDto. # noqa: E501 + + + :return: The affiliation of this UserDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserDto. + + + :param affiliation: The affiliation of this UserDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserDto. # noqa: E501 + + + :return: The orcid of this UserDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserDto. + + + :param orcid: The orcid of this UserDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def containers(self): + """Gets the containers of this UserDto. # noqa: E501 + + + :return: The containers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._containers + + @containers.setter + def containers(self, containers): + """Sets the containers of this UserDto. + + + :param containers: The containers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._containers = containers + + @property + def databases(self): + """Gets the databases of this UserDto. # noqa: E501 + + + :return: The databases of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this UserDto. + + + :param databases: The databases of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._databases = databases + + @property + def identifiers(self): + """Gets the identifiers of this UserDto. # noqa: E501 + + + :return: The identifiers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._identifiers + + @identifiers.setter + def identifiers(self, identifiers): + """Sets the identifiers of this UserDto. + + + :param identifiers: The identifiers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._identifiers = identifiers + + @property + def email(self): + """Gets the email of this UserDto. # noqa: E501 + + + :return: The email of this UserDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserDto. + + + :param email: The email of this UserDto. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def titles_before(self): + """Gets the titles_before of this UserDto. # noqa: E501 + + + :return: The titles_before of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserDto. + + + :param titles_before: The titles_before of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserDto. # noqa: E501 + + + :return: The titles_after of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserDto. + + + :param titles_after: The titles_after of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserDto. # noqa: E501 + + + :return: The theme_dark of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserDto. + + + :param theme_dark: The theme_dark of this UserDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserDto. # noqa: E501 + + + :return: The email_verified of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserDto. + + + :param email_verified: The email_verified of this UserDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserDto, 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, UserDto): + 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/swagger/api/api_container/rest.py b/swagger/api/api_container/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..0444029bd5e0e733a9b30a168bd55ccf63281f25 --- /dev/null +++ b/swagger/api/api_container/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # 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/swagger/api/api_database/__init__.py b/swagger/api/api_database/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40bd120d03f25022230c83d15792eb3afa2e9bb4 --- /dev/null +++ b/swagger/api/api_database/__init__.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +# flake8: noqa + +""" + 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 +""" + +from __future__ import absolute_import + +# import apis into sdk package +from api_database.api.database_endpoint_api import DatabaseEndpointApi +from api_database.api.license_endpoint_api import LicenseEndpointApi +# import ApiClient +from api_database.api_client import ApiClient +from api_database.configuration import Configuration +# import models into sdk package +from api_database.models.api_error_dto import ApiErrorDto +from api_database.models.container_brief_dto import ContainerBriefDto +from api_database.models.container_dto import ContainerDto +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.image_brief_dto import ImageBriefDto +from api_database.models.image_date_dto import ImageDateDto +from api_database.models.image_dto import ImageDto +from api_database.models.image_env_item_dto import ImageEnvItemDto +from api_database.models.license_dto import LicenseDto +from api_database.models.table_brief_dto import TableBriefDto +from api_database.models.user_brief_dto import UserBriefDto diff --git a/swagger/api/api_database/api/__init__.py b/swagger/api/api_database/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3b6a63f77fec6a8c865d232230262a4acf91671e --- /dev/null +++ b/swagger/api/api_database/api/__init__.py @@ -0,0 +1,7 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_database.api.database_endpoint_api import DatabaseEndpointApi +from api_database.api.license_endpoint_api import LicenseEndpointApi diff --git a/swagger/api/api_database/api/container_database_endpoint_api.py b/swagger/api/api_database/api/container_database_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..c05c11e8bbf51f594aa5736b1f4a5abed2d61e3f --- /dev/null +++ b/swagger/api/api_database/api/container_database_endpoint_api.py @@ -0,0 +1,659 @@ +# 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 +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_database.api_client import ApiClient + + +class ContainerDatabaseEndpointApi(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 create(self, body, id, **kwargs): # noqa: E501 + """Create 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.create(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseCreateDto body: (required) + :param int id: (required) + :return: DatabaseBriefDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.create_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def create_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Create 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.create_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseCreateDto body: (required) + :param int id: (required) + :return: DatabaseBriefDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 create" % 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 `create`") # 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 `create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DatabaseBriefDto', # 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 delete1(self, id, database_id, **kwargs): # noqa: E501 + """Delete some 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.delete1(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (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.delete1_with_http_info(id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.delete1_with_http_info(id, database_id, **kwargs) # noqa: E501 + return data + + def delete1_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Delete some 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.delete1_with_http_info(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 delete1" % key + ) + params[key] = val + del params['kwargs'] + # 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 `delete1`") # 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 `delete1`") # 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 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}', 'DELETE', + 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) + + def find_all(self, id, **kwargs): # noqa: E501 + """List databases # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: list[DatabaseBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.find_all_with_http_info(id, **kwargs) # noqa: E501 + return data + + def find_all_with_http_info(self, id, **kwargs): # noqa: E501 + """List databases # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: list[DatabaseBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_all" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_all`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[DatabaseBriefDto]', # 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 find_by_id(self, id, database_id, **kwargs): # noqa: E501 + """Find some 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.find_by_id(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :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.find_by_id_with_http_info(id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.find_by_id_with_http_info(id, database_id, **kwargs) # noqa: E501 + return data + + def find_by_id_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Find some 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.find_by_id_with_http_info(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: DatabaseDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_by_id" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_by_id`") # 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 `find_by_id`") # 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 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}', 'GET', + 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 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 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseModifyDto 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.update_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + return data + + def update_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.update_with_http_info(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseModifyDto 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 update" % 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 `update`") # 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 `update`") # 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 `update`") # 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}', '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) diff --git a/swagger/api/api_database/api/database_endpoint_api.py b/swagger/api/api_database/api/database_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..1ad3383e96e34ef610d182226910b5a5e2ef197f --- /dev/null +++ b/swagger/api/api_database/api/database_endpoint_api.py @@ -0,0 +1,659 @@ +# 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 +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_database.api_client import ApiClient + + +class DatabaseEndpointApi(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 create(self, body, id, **kwargs): # noqa: E501 + """Create 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.create(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseCreateDto body: (required) + :param int id: (required) + :return: DatabaseBriefDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.create_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def create_with_http_info(self, body, id, **kwargs): # noqa: E501 + """Create 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.create_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseCreateDto body: (required) + :param int id: (required) + :return: DatabaseBriefDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', '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 create" % 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 `create`") # 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 `create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['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', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DatabaseBriefDto', # 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 delete1(self, id, database_id, **kwargs): # noqa: E501 + """Delete some 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.delete1(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (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.delete1_with_http_info(id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.delete1_with_http_info(id, database_id, **kwargs) # noqa: E501 + return data + + def delete1_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Delete some 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.delete1_with_http_info(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 delete1" % key + ) + params[key] = val + del params['kwargs'] + # 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 `delete1`") # 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 `delete1`") # 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 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}', 'DELETE', + 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) + + def find_all(self, id, **kwargs): # noqa: E501 + """List databases # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: list[DatabaseBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.find_all_with_http_info(id, **kwargs) # noqa: E501 + return data + + def find_all_with_http_info(self, id, **kwargs): # noqa: E501 + """List databases # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: list[DatabaseBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_all" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_all`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[DatabaseBriefDto]', # 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 find_by_id(self, id, database_id, **kwargs): # noqa: E501 + """Find some 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.find_by_id(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :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.find_by_id_with_http_info(id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.find_by_id_with_http_info(id, database_id, **kwargs) # noqa: E501 + return data + + def find_by_id_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Find some 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.find_by_id_with_http_info(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: DatabaseDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_by_id" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_by_id`") # 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 `find_by_id`") # 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 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}', 'GET', + 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 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 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseModifyDto 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.update_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + return data + + def update_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.update_with_http_info(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DatabaseModifyDto 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 update" % 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 `update`") # 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 `update`") # 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 `update`") # 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}', '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) diff --git a/swagger/api/api_database/api/license_endpoint_api.py b/swagger/api/api_database/api/license_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..beedbc3d344d7f2edb4c89be9460dfe8cd1f0149 --- /dev/null +++ b/swagger/api/api_database/api/license_endpoint_api.py @@ -0,0 +1,126 @@ +# 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 +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_database.api_client import ApiClient + + +class LicenseEndpointApi(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 delete(self, id, **kwargs): # noqa: E501 + """Get all licenses # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: list[LicenseDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Get all licenses # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :return: list[LicenseDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 delete" % key + ) + params[key] = val + del params['kwargs'] + # 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 `delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/license', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[LicenseDto]', # 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/swagger/api/api_database/api_client.py b/swagger/api/api_database/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..448338ff3546155c87acbf85d007e2de41b1a7ae --- /dev/null +++ b/swagger/api/api_database/api_client.py @@ -0,0 +1,632 @@ +# 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 +""" +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_database.configuration import Configuration +import api_database.models +from api_database 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_database.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/swagger/api/api_database/configuration.py b/swagger/api/api_database/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..5ee4406b932b0def43900eedf1c962a85da65c16 --- /dev/null +++ b/swagger/api/api_database/configuration.py @@ -0,0 +1,244 @@ +# 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 +""" + +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_database") + 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/swagger/api/api_database/models/__init__.py b/swagger/api/api_database/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75d043704bb0625459042595af1e81904221060c --- /dev/null +++ b/swagger/api/api_database/models/__init__.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +# flake8: noqa +""" + 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 +""" + +from __future__ import absolute_import + +# import models into model package +from api_database.models.api_error_dto import ApiErrorDto +from api_database.models.container_brief_dto import ContainerBriefDto +from api_database.models.container_dto import ContainerDto +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.image_brief_dto import ImageBriefDto +from api_database.models.image_date_dto import ImageDateDto +from api_database.models.image_dto import ImageDto +from api_database.models.image_env_item_dto import ImageEnvItemDto +from api_database.models.license_dto import LicenseDto +from api_database.models.table_brief_dto import TableBriefDto +from api_database.models.user_brief_dto import UserBriefDto diff --git a/swagger/api/api_database/models/api_error_dto.py b/swagger/api/api_database/models/api_error_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..1805f0cb0f156c7b3e3d19abc6f72865a0554f55 --- /dev/null +++ b/swagger/api/api_database/models/api_error_dto.py @@ -0,0 +1,171 @@ +# 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 ApiErrorDto(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 = { + 'status': 'str', + 'message': 'str', + 'code': 'str' + } + + attribute_map = { + 'status': 'status', + 'message': 'message', + 'code': 'code' + } + + def __init__(self, status=None, message=None, code=None): # noqa: E501 + """ApiErrorDto - a model defined in Swagger""" # noqa: E501 + self._status = None + self._message = None + self._code = None + self.discriminator = None + self.status = status + self.message = message + self.code = code + + @property + def status(self): + """Gets the status of this ApiErrorDto. # noqa: E501 + + + :return: The status of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ApiErrorDto. + + + :param status: The status of this ApiErrorDto. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["100 CONTINUE", "101 SWITCHING_PROTOCOLS", "102 PROCESSING", "103 CHECKPOINT", "200 OK", "201 CREATED", "202 ACCEPTED", "203 NON_AUTHORITATIVE_INFORMATION", "204 NO_CONTENT", "205 RESET_CONTENT", "206 PARTIAL_CONTENT", "207 MULTI_STATUS", "208 ALREADY_REPORTED", "226 IM_USED", "300 MULTIPLE_CHOICES", "301 MOVED_PERMANENTLY", "302 FOUND", "302 MOVED_TEMPORARILY", "303 SEE_OTHER", "304 NOT_MODIFIED", "305 USE_PROXY", "307 TEMPORARY_REDIRECT", "308 PERMANENT_REDIRECT", "400 BAD_REQUEST", "401 UNAUTHORIZED", "402 PAYMENT_REQUIRED", "403 FORBIDDEN", "404 NOT_FOUND", "405 METHOD_NOT_ALLOWED", "406 NOT_ACCEPTABLE", "407 PROXY_AUTHENTICATION_REQUIRED", "408 REQUEST_TIMEOUT", "409 CONFLICT", "410 GONE", "411 LENGTH_REQUIRED", "412 PRECONDITION_FAILED", "413 PAYLOAD_TOO_LARGE", "413 REQUEST_ENTITY_TOO_LARGE", "414 URI_TOO_LONG", "414 REQUEST_URI_TOO_LONG", "415 UNSUPPORTED_MEDIA_TYPE", "416 REQUESTED_RANGE_NOT_SATISFIABLE", "417 EXPECTATION_FAILED", "418 I_AM_A_TEAPOT", "419 INSUFFICIENT_SPACE_ON_RESOURCE", "420 METHOD_FAILURE", "421 DESTINATION_LOCKED", "422 UNPROCESSABLE_ENTITY", "423 LOCKED", "424 FAILED_DEPENDENCY", "425 TOO_EARLY", "426 UPGRADE_REQUIRED", "428 PRECONDITION_REQUIRED", "429 TOO_MANY_REQUESTS", "431 REQUEST_HEADER_FIELDS_TOO_LARGE", "451 UNAVAILABLE_FOR_LEGAL_REASONS", "500 INTERNAL_SERVER_ERROR", "501 NOT_IMPLEMENTED", "502 BAD_GATEWAY", "503 SERVICE_UNAVAILABLE", "504 GATEWAY_TIMEOUT", "505 HTTP_VERSION_NOT_SUPPORTED", "506 VARIANT_ALSO_NEGOTIATES", "507 INSUFFICIENT_STORAGE", "508 LOOP_DETECTED", "509 BANDWIDTH_LIMIT_EXCEEDED", "510 NOT_EXTENDED", "511 NETWORK_AUTHENTICATION_REQUIRED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def message(self): + """Gets the message of this ApiErrorDto. # noqa: E501 + + + :return: The message of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiErrorDto. + + + :param message: The message of this ApiErrorDto. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def code(self): + """Gets the code of this ApiErrorDto. # noqa: E501 + + + :return: The code of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiErrorDto. + + + :param code: The code of this ApiErrorDto. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + 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(ApiErrorDto, 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, ApiErrorDto): + 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/swagger/api/api_database/models/container_brief_dto.py b/swagger/api/api_database/models/container_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..9ef9e28e3cd2d7733448f381947995b5d7a80b69 --- /dev/null +++ b/swagger/api/api_database/models/container_brief_dto.py @@ -0,0 +1,244 @@ +# 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 ContainerBriefDto(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 = { + 'id': 'int', + 'hash': 'str', + 'name': 'str', + 'creator': 'UserBriefDto', + 'created': 'datetime', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'hash': 'hash', + 'name': 'name', + 'creator': 'creator', + 'created': 'created', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, hash=None, name=None, creator=None, created=None, internal_name=None): # noqa: E501 + """ContainerBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._hash = None + self._name = None + self._creator = None + self._created = None + self._internal_name = None + self.discriminator = None + self.id = id + self.hash = hash + self.name = name + if creator is not None: + self.creator = creator + if created is not None: + self.created = created + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this ContainerBriefDto. # noqa: E501 + + + :return: The id of this ContainerBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContainerBriefDto. + + + :param id: The id of this ContainerBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def hash(self): + """Gets the hash of this ContainerBriefDto. # noqa: E501 + + + :return: The hash of this ContainerBriefDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ContainerBriefDto. + + + :param hash: The hash of this ContainerBriefDto. # noqa: E501 + :type: str + """ + if hash is None: + raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501 + + self._hash = hash + + @property + def name(self): + """Gets the name of this ContainerBriefDto. # noqa: E501 + + + :return: The name of this ContainerBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerBriefDto. + + + :param name: The name of this ContainerBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this ContainerBriefDto. # noqa: E501 + + + :return: The creator of this ContainerBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this ContainerBriefDto. + + + :param creator: The creator of this ContainerBriefDto. # noqa: E501 + :type: UserBriefDto + """ + + self._creator = creator + + @property + def created(self): + """Gets the created of this ContainerBriefDto. # noqa: E501 + + + :return: The created of this ContainerBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ContainerBriefDto. + + + :param created: The created of this ContainerBriefDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def internal_name(self): + """Gets the internal_name of this ContainerBriefDto. # noqa: E501 + + + :return: The internal_name of this ContainerBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ContainerBriefDto. + + + :param internal_name: The internal_name of this ContainerBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(ContainerBriefDto, 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, ContainerBriefDto): + 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/swagger/api/api_database/models/container_dto.py b/swagger/api/api_database/models/container_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..1ab9e4195efa179e64077d6c9a8e62938cd10c24 --- /dev/null +++ b/swagger/api/api_database/models/container_dto.py @@ -0,0 +1,355 @@ +# 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 ContainerDto(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 = { + 'id': 'int', + 'hash': 'str', + 'name': 'str', + 'state': 'str', + 'databases': 'list[DatabaseDto]', + 'image': 'ImageBriefDto', + 'port': 'int', + 'created': 'datetime', + 'internal_name': 'str', + 'ip_address': 'str' + } + + attribute_map = { + 'id': 'id', + 'hash': 'hash', + 'name': 'name', + 'state': 'state', + 'databases': 'databases', + 'image': 'image', + 'port': 'port', + 'created': 'created', + 'internal_name': 'internal_name', + 'ip_address': 'ip_address' + } + + def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + """ContainerDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._hash = None + self._name = None + self._state = None + self._databases = None + self._image = None + self._port = None + self._created = None + self._internal_name = None + self._ip_address = None + self.discriminator = None + self.id = id + self.hash = hash + self.name = name + if state is not None: + self.state = state + if databases is not None: + self.databases = databases + if image is not None: + self.image = image + if port is not None: + self.port = port + self.created = created + self.internal_name = internal_name + if ip_address is not None: + self.ip_address = ip_address + + @property + def id(self): + """Gets the id of this ContainerDto. # noqa: E501 + + + :return: The id of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContainerDto. + + + :param id: The id of this ContainerDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def hash(self): + """Gets the hash of this ContainerDto. # noqa: E501 + + + :return: The hash of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ContainerDto. + + + :param hash: The hash of this ContainerDto. # noqa: E501 + :type: str + """ + if hash is None: + raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501 + + self._hash = hash + + @property + def name(self): + """Gets the name of this ContainerDto. # noqa: E501 + + + :return: The name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerDto. + + + :param name: The name of this ContainerDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def state(self): + """Gets the state of this ContainerDto. # noqa: E501 + + + :return: The state of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this ContainerDto. + + + :param state: The state of this ContainerDto. # noqa: E501 + :type: str + """ + allowed_values = ["created", "restarting", "running", "paused", "exited", "dead"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def databases(self): + """Gets the databases of this ContainerDto. # noqa: E501 + + + :return: The databases of this ContainerDto. # noqa: E501 + :rtype: list[DatabaseDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this ContainerDto. + + + :param databases: The databases of this ContainerDto. # noqa: E501 + :type: list[DatabaseDto] + """ + + self._databases = databases + + @property + def image(self): + """Gets the image of this ContainerDto. # noqa: E501 + + + :return: The image of this ContainerDto. # noqa: E501 + :rtype: ImageBriefDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this ContainerDto. + + + :param image: The image of this ContainerDto. # noqa: E501 + :type: ImageBriefDto + """ + + self._image = image + + @property + def port(self): + """Gets the port of this ContainerDto. # noqa: E501 + + + :return: The port of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this ContainerDto. + + + :param port: The port of this ContainerDto. # noqa: E501 + :type: int + """ + + self._port = port + + @property + def created(self): + """Gets the created of this ContainerDto. # noqa: E501 + + + :return: The created of this ContainerDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ContainerDto. + + + :param created: The created of this ContainerDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def internal_name(self): + """Gets the internal_name of this ContainerDto. # noqa: E501 + + + :return: The internal_name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ContainerDto. + + + :param internal_name: The internal_name of this ContainerDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + @property + def ip_address(self): + """Gets the ip_address of this ContainerDto. # noqa: E501 + + + :return: The ip_address of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """Sets the ip_address of this ContainerDto. + + + :param ip_address: The ip_address of this ContainerDto. # noqa: E501 + :type: str + """ + + self._ip_address = ip_address + + 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(ContainerDto, 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, ContainerDto): + 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/swagger/api/api_database/models/database_brief_dto.py b/swagger/api/api_database/models/database_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..bf325afda796e5f97d25a0459deba58fefdbad9b --- /dev/null +++ b/swagger/api/api_database/models/database_brief_dto.py @@ -0,0 +1,294 @@ +# 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 DatabaseBriefDto(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 = { + 'id': 'int', + 'name': 'str', + 'description': 'str', + 'engine': 'str', + 'container': 'ContainerBriefDto', + 'creator': 'UserBriefDto', + 'created': 'datetime', + 'is_public': 'bool' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'description': 'description', + 'engine': 'engine', + 'container': 'container', + 'creator': 'creator', + 'created': 'created', + 'is_public': 'is_public' + } + + def __init__(self, id=None, name=None, description=None, engine=None, container=None, creator=None, created=None, is_public=None): # noqa: E501 + """DatabaseBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._description = None + self._engine = None + self._container = None + self._creator = None + self._created = None + self._is_public = None + self.discriminator = None + self.id = id + self.name = name + if description is not None: + self.description = description + if engine is not None: + self.engine = engine + if container is not None: + self.container = container + if creator is not None: + self.creator = creator + if created is not None: + self.created = created + if is_public is not None: + self.is_public = is_public + + @property + def id(self): + """Gets the id of this DatabaseBriefDto. # noqa: E501 + + + :return: The id of this DatabaseBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DatabaseBriefDto. + + + :param id: The id of this DatabaseBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this DatabaseBriefDto. # noqa: E501 + + + :return: The name of this DatabaseBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DatabaseBriefDto. + + + :param name: The name of this DatabaseBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def description(self): + """Gets the description of this DatabaseBriefDto. # noqa: E501 + + + :return: The description of this DatabaseBriefDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this DatabaseBriefDto. + + + :param description: The description of this DatabaseBriefDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def engine(self): + """Gets the engine of this DatabaseBriefDto. # noqa: E501 + + + :return: The engine of this DatabaseBriefDto. # noqa: E501 + :rtype: str + """ + return self._engine + + @engine.setter + def engine(self, engine): + """Sets the engine of this DatabaseBriefDto. + + + :param engine: The engine of this DatabaseBriefDto. # noqa: E501 + :type: str + """ + + self._engine = engine + + @property + def container(self): + """Gets the container of this DatabaseBriefDto. # noqa: E501 + + + :return: The container of this DatabaseBriefDto. # noqa: E501 + :rtype: ContainerBriefDto + """ + return self._container + + @container.setter + def container(self, container): + """Sets the container of this DatabaseBriefDto. + + + :param container: The container of this DatabaseBriefDto. # noqa: E501 + :type: ContainerBriefDto + """ + + self._container = container + + @property + def creator(self): + """Gets the creator of this DatabaseBriefDto. # noqa: E501 + + + :return: The creator of this DatabaseBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this DatabaseBriefDto. + + + :param creator: The creator of this DatabaseBriefDto. # noqa: E501 + :type: UserBriefDto + """ + + self._creator = creator + + @property + def created(self): + """Gets the created of this DatabaseBriefDto. # noqa: E501 + + + :return: The created of this DatabaseBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseBriefDto. + + + :param created: The created of this DatabaseBriefDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def is_public(self): + """Gets the is_public of this DatabaseBriefDto. # noqa: E501 + + + :return: The is_public of this DatabaseBriefDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseBriefDto. + + + :param is_public: The is_public of this DatabaseBriefDto. # noqa: E501 + :type: bool + """ + + 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(DatabaseBriefDto, 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, DatabaseBriefDto): + 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/swagger/api/api_database/models/database_create_dto.py b/swagger/api/api_database/models/database_create_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..abf98982263f239fb5eb2dbe828b874b5e6ef44a --- /dev/null +++ b/swagger/api/api_database/models/database_create_dto.py @@ -0,0 +1,138 @@ +# 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 DatabaseCreateDto(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 = { + 'name': 'str', + 'is_public': 'bool' + } + + attribute_map = { + 'name': 'name', + 'is_public': 'is_public' + } + + def __init__(self, name=None, is_public=None): # noqa: E501 + """DatabaseCreateDto - a model defined in Swagger""" # noqa: E501 + self._name = None + self._is_public = None + self.discriminator = None + self.name = name + self.is_public = is_public + + @property + def name(self): + """Gets the name of this DatabaseCreateDto. # noqa: E501 + + + :return: The name of this DatabaseCreateDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DatabaseCreateDto. + + + :param name: The name of this DatabaseCreateDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def is_public(self): + """Gets the is_public of this DatabaseCreateDto. # noqa: E501 + + + :return: The is_public of this DatabaseCreateDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseCreateDto. + + + :param is_public: The is_public of this DatabaseCreateDto. # 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(DatabaseCreateDto, 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, DatabaseCreateDto): + 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/swagger/api/api_database/models/database_dto.py b/swagger/api/api_database/models/database_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..2ac4839ac7fed4b29f04560ca8a73ae3e7795e70 --- /dev/null +++ b/swagger/api/api_database/models/database_dto.py @@ -0,0 +1,589 @@ +# 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 DatabaseDto(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 = { + 'id': 'int', + 'name': 'str', + 'exchange': 'str', + 'creator': 'UserBriefDto', + 'subjects': 'list[str]', + 'language': 'str', + 'license': 'LicenseDto', + 'description': 'str', + 'publisher': 'str', + 'tables': 'list[TableBriefDto]', + 'image': 'ImageDto', + 'container': 'ContainerDto', + 'created': 'datetime', + 'deleted': 'datetime', + 'internal_name': 'str', + 'publication_year': 'int', + 'publication_month': 'int', + 'publication_day': 'int', + 'is_public': 'bool' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'exchange': 'exchange', + 'creator': 'creator', + 'subjects': 'subjects', + 'language': 'language', + 'license': 'license', + 'description': 'description', + 'publisher': 'publisher', + 'tables': 'tables', + 'image': 'image', + 'container': 'container', + 'created': 'created', + 'deleted': 'deleted', + 'internal_name': 'internal_name', + 'publication_year': 'publication_year', + 'publication_month': 'publication_month', + 'publication_day': 'publication_day', + 'is_public': 'is_public' + } + + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_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._tables = None + self._image = None + self._container = None + self._created = None + self._deleted = None + self._internal_name = None + self._publication_year = None + self._publication_month = None + self._publication_day = None + self._is_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 tables is not None: + self.tables = tables + if image is not None: + self.image = image + if container is not None: + self.container = container + if created is not None: + self.created = created + if deleted is not None: + self.deleted = deleted + self.internal_name = internal_name + if publication_year is not None: + self.publication_year = 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 is_public is not None: + self.is_public = is_public + + @property + def id(self): + """Gets the id of this DatabaseDto. # noqa: E501 + + + :return: The id of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DatabaseDto. + + + :param id: The id of this DatabaseDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this DatabaseDto. # noqa: E501 + + + :return: The name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DatabaseDto. + + + :param name: The name of this DatabaseDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def exchange(self): + """Gets the exchange of this DatabaseDto. # noqa: E501 + + + :return: The exchange of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this DatabaseDto. + + + :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :type: str + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def creator(self): + """Gets the creator of this DatabaseDto. # noqa: E501 + + + :return: The creator of this DatabaseDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this DatabaseDto. + + + :param creator: The creator of this DatabaseDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def subjects(self): + """Gets the subjects of this DatabaseDto. # noqa: E501 + + + :return: The subjects of this DatabaseDto. # noqa: E501 + :rtype: list[str] + """ + return self._subjects + + @subjects.setter + def subjects(self, subjects): + """Sets the subjects of this DatabaseDto. + + + :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :type: list[str] + """ + + self._subjects = subjects + + @property + def language(self): + """Gets the language of this DatabaseDto. # noqa: E501 + + + :return: The language of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this DatabaseDto. + + + :param language: The 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: + raise ValueError( + "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 + .format(language, allowed_values) + ) + + self._language = language + + @property + def license(self): + """Gets the license of this DatabaseDto. # noqa: E501 + + + :return: The license of this DatabaseDto. # noqa: E501 + :rtype: LicenseDto + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this DatabaseDto. + + + :param license: The license of this DatabaseDto. # noqa: E501 + :type: LicenseDto + """ + + self._license = license + + @property + def description(self): + """Gets the description of this DatabaseDto. # noqa: E501 + + + :return: The description of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this DatabaseDto. + + + :param description: The description of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def publisher(self): + """Gets the publisher of this DatabaseDto. # noqa: E501 + + + :return: The publisher of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this DatabaseDto. + + + :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._publisher = publisher + + @property + def tables(self): + """Gets the tables of this DatabaseDto. # noqa: E501 + + + :return: The tables of this DatabaseDto. # noqa: E501 + :rtype: list[TableBriefDto] + """ + return self._tables + + @tables.setter + def tables(self, tables): + """Sets the tables of this DatabaseDto. + + + :param tables: The tables of this DatabaseDto. # noqa: E501 + :type: list[TableBriefDto] + """ + + self._tables = tables + + @property + def image(self): + """Gets the image of this DatabaseDto. # noqa: E501 + + + :return: The image of this DatabaseDto. # noqa: E501 + :rtype: ImageDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this DatabaseDto. + + + :param image: The image of this DatabaseDto. # noqa: E501 + :type: ImageDto + """ + + self._image = image + + @property + def container(self): + """Gets the container of this DatabaseDto. # noqa: E501 + + + :return: The container of this DatabaseDto. # noqa: E501 + :rtype: ContainerDto + """ + return self._container + + @container.setter + def container(self, container): + """Sets the container of this DatabaseDto. + + + :param container: The container of this DatabaseDto. # noqa: E501 + :type: ContainerDto + """ + + self._container = container + + @property + def created(self): + """Gets the created of this DatabaseDto. # noqa: E501 + + + :return: The created of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseDto. + + + :param created: The created of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def deleted(self): + """Gets the deleted of this DatabaseDto. # noqa: E501 + + + :return: The deleted of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this DatabaseDto. + + + :param deleted: The deleted of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._deleted = deleted + + @property + def internal_name(self): + """Gets the internal_name of this DatabaseDto. # noqa: E501 + + + :return: The internal_name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this DatabaseDto. + + + :param internal_name: The 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 + + self._internal_name = internal_name + + @property + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 + + + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. + + + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_year = publication_year + + @property + def publication_month(self): + """Gets the publication_month of this DatabaseDto. # noqa: E501 + + + :return: The publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this DatabaseDto. + + + :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_day(self): + """Gets the publication_day of this DatabaseDto. # noqa: E501 + + + :return: The publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this DatabaseDto. + + + :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def is_public(self): + """Gets the is_public of this DatabaseDto. # noqa: E501 + + + :return: The is_public of this DatabaseDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseDto. + + + :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :type: bool + """ + + 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(DatabaseDto, 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, DatabaseDto): + 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/swagger/api/api_database/models/database_modify_dto.py b/swagger/api/api_database/models/database_modify_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..5e06737345cf1408c32915c4c7f744635a08dc0b --- /dev/null +++ b/swagger/api/api_database/models/database_modify_dto.py @@ -0,0 +1,332 @@ +# 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 DatabaseModifyDto(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 = { + 'subjects': 'list[str]', + 'description': 'str', + 'publisher': 'str', + 'license': 'LicenseDto', + 'language': 'str', + 'publication_year': 'int', + 'publication_month': 'int', + 'publication_day': 'int', + 'contact_person': 'str' + } + + attribute_map = { + 'subjects': 'subjects', + 'description': 'description', + 'publisher': 'publisher', + 'license': 'license', + 'language': 'language', + 'publication_year': 'publication_year', + 'publication_month': 'publication_month', + 'publication_day': 'publication_day', + 'contact_person': 'contact_person' + } + + def __init__(self, subjects=None, description=None, publisher=None, license=None, language=None, publication_year=None, publication_month=None, publication_day=None, contact_person=None): # noqa: E501 + """DatabaseModifyDto - a model defined in Swagger""" # noqa: E501 + self._subjects = None + self._description = None + self._publisher = None + self._license = None + self._language = None + self._publication_year = None + self._publication_month = None + self._publication_day = None + self._contact_person = None + self.discriminator = None + if subjects is not None: + self.subjects = subjects + if description is not None: + self.description = description + self.publisher = publisher + if license is not None: + self.license = license + if language is not None: + self.language = language + self.publication_year = 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 subjects(self): + """Gets the subjects of this DatabaseModifyDto. # noqa: E501 + + + :return: The subjects of this DatabaseModifyDto. # noqa: E501 + :rtype: list[str] + """ + return self._subjects + + @subjects.setter + def subjects(self, subjects): + """Sets the subjects of this DatabaseModifyDto. + + + :param subjects: The subjects of this DatabaseModifyDto. # noqa: E501 + :type: list[str] + """ + + self._subjects = subjects + + @property + def description(self): + """Gets the description of this DatabaseModifyDto. # noqa: E501 + + + :return: The description of this DatabaseModifyDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this DatabaseModifyDto. + + + :param description: The description of this DatabaseModifyDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def publisher(self): + """Gets the publisher of this DatabaseModifyDto. # noqa: E501 + + + :return: The publisher of this DatabaseModifyDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this DatabaseModifyDto. + + + :param publisher: The publisher of this DatabaseModifyDto. # noqa: E501 + :type: str + """ + if publisher is None: + raise ValueError("Invalid value for `publisher`, must not be `None`") # noqa: E501 + + self._publisher = publisher + + @property + def license(self): + """Gets the license of this DatabaseModifyDto. # noqa: E501 + + + :return: The license of this DatabaseModifyDto. # noqa: E501 + :rtype: LicenseDto + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this DatabaseModifyDto. + + + :param license: The license of this DatabaseModifyDto. # noqa: E501 + :type: LicenseDto + """ + + self._license = license + + @property + def language(self): + """Gets the language of this DatabaseModifyDto. # noqa: E501 + + + :return: The language of this DatabaseModifyDto. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this DatabaseModifyDto. + + + :param language: The language of this DatabaseModifyDto. # 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: + raise ValueError( + "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 + .format(language, allowed_values) + ) + + self._language = language + + @property + def publication_year(self): + """Gets the publication_year of this DatabaseModifyDto. # noqa: E501 + + database publication year # noqa: E501 + + :return: The publication_year of this DatabaseModifyDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseModifyDto. + + database publication year # noqa: E501 + + :param publication_year: The publication_year 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 + + @property + def publication_month(self): + """Gets the publication_month of this DatabaseModifyDto. # noqa: E501 + + database publication month # noqa: E501 + + :return: The publication_month of this DatabaseModifyDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this DatabaseModifyDto. + + database publication month # noqa: E501 + + :param publication_month: The publication_month of this DatabaseModifyDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_day(self): + """Gets the publication_day of this DatabaseModifyDto. # noqa: E501 + + database publication day # noqa: E501 + + :return: The publication_day of this DatabaseModifyDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this DatabaseModifyDto. + + database publication day # noqa: E501 + + :param publication_day: The publication_day of this DatabaseModifyDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def contact_person(self): + """Gets the contact_person of this DatabaseModifyDto. # noqa: E501 + + + :return: The contact_person of this DatabaseModifyDto. # noqa: E501 + :rtype: str + """ + return self._contact_person + + @contact_person.setter + def contact_person(self, contact_person): + """Sets the contact_person of this DatabaseModifyDto. + + + :param contact_person: The contact_person of this DatabaseModifyDto. # noqa: E501 + :type: str + """ + + self._contact_person = contact_person + + 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(DatabaseModifyDto, 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, DatabaseModifyDto): + 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/swagger/api/api_database/models/database_transfer_dto.py b/swagger/api/api_database/models/database_transfer_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e17937171833a088ef6adc96eca121498f1198cf --- /dev/null +++ b/swagger/api/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/swagger/api/api_database/models/granted_authority_dto.py b/swagger/api/api_database/models/granted_authority_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..6cbbd98c6f6fa67dcc14b1774c293734496c4c87 --- /dev/null +++ b/swagger/api/api_database/models/granted_authority_dto.py @@ -0,0 +1,110 @@ +# 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 GrantedAuthorityDto(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 = { + 'authority': 'str' + } + + attribute_map = { + 'authority': 'authority' + } + + def __init__(self, authority=None): # noqa: E501 + """GrantedAuthorityDto - a model defined in Swagger""" # noqa: E501 + self._authority = None + self.discriminator = None + if authority is not None: + self.authority = authority + + @property + def authority(self): + """Gets the authority of this GrantedAuthorityDto. # noqa: E501 + + + :return: The authority of this GrantedAuthorityDto. # noqa: E501 + :rtype: str + """ + return self._authority + + @authority.setter + def authority(self, authority): + """Sets the authority of this GrantedAuthorityDto. + + + :param authority: The authority of this GrantedAuthorityDto. # noqa: E501 + :type: str + """ + + self._authority = authority + + 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(GrantedAuthorityDto, 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, GrantedAuthorityDto): + 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/swagger/api/api_database/models/image_brief_dto.py b/swagger/api/api_database/models/image_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..9536488958e8e7a8fedb4aed47a0460b6fe25454 --- /dev/null +++ b/swagger/api/api_database/models/image_brief_dto.py @@ -0,0 +1,165 @@ +# 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 ImageBriefDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag' + } + + def __init__(self, id=None, repository=None, tag=None): # noqa: E501 + """ImageBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + + @property + def id(self): + """Gets the id of this ImageBriefDto. # noqa: E501 + + + :return: The id of this ImageBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageBriefDto. + + + :param id: The id of this ImageBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageBriefDto. # noqa: E501 + + + :return: The repository of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageBriefDto. + + + :param repository: The repository of this ImageBriefDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageBriefDto. # noqa: E501 + + + :return: The tag of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageBriefDto. + + + :param tag: The tag of this ImageBriefDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + 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(ImageBriefDto, 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, ImageBriefDto): + 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/swagger/api/api_database/models/image_date_dto.py b/swagger/api/api_database/models/image_date_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..093b1c638dd0bfdf10aa3ba8947d5679148ca754 --- /dev/null +++ b/swagger/api/api_database/models/image_date_dto.py @@ -0,0 +1,245 @@ +# 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 ImageDateDto(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 = { + 'id': 'int', + 'example': 'str', + 'database_format': 'str', + 'unix_format': 'str', + 'has_time': 'bool', + 'created_at': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'example': 'example', + 'database_format': 'database_format', + 'unix_format': 'unix_format', + 'has_time': 'has_time', + 'created_at': 'created_at' + } + + def __init__(self, id=None, example=None, database_format=None, unix_format=None, has_time=None, created_at=None): # noqa: E501 + """ImageDateDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._example = None + self._database_format = None + self._unix_format = None + self._has_time = None + self._created_at = None + self.discriminator = None + self.id = id + self.example = example + self.database_format = database_format + self.unix_format = unix_format + self.has_time = has_time + if created_at is not None: + self.created_at = created_at + + @property + def id(self): + """Gets the id of this ImageDateDto. # noqa: E501 + + + :return: The id of this ImageDateDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDateDto. + + + :param id: The id of this ImageDateDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def example(self): + """Gets the example of this ImageDateDto. # noqa: E501 + + + :return: The example of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._example + + @example.setter + def example(self, example): + """Sets the example of this ImageDateDto. + + + :param example: The example of this ImageDateDto. # noqa: E501 + :type: str + """ + if example is None: + raise ValueError("Invalid value for `example`, must not be `None`") # noqa: E501 + + self._example = example + + @property + def database_format(self): + """Gets the database_format of this ImageDateDto. # noqa: E501 + + + :return: The database_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._database_format + + @database_format.setter + def database_format(self, database_format): + """Sets the database_format of this ImageDateDto. + + + :param database_format: The database_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if database_format is None: + raise ValueError("Invalid value for `database_format`, must not be `None`") # noqa: E501 + + self._database_format = database_format + + @property + def unix_format(self): + """Gets the unix_format of this ImageDateDto. # noqa: E501 + + + :return: The unix_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._unix_format + + @unix_format.setter + def unix_format(self, unix_format): + """Sets the unix_format of this ImageDateDto. + + + :param unix_format: The unix_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if unix_format is None: + raise ValueError("Invalid value for `unix_format`, must not be `None`") # noqa: E501 + + self._unix_format = unix_format + + @property + def has_time(self): + """Gets the has_time of this ImageDateDto. # noqa: E501 + + + :return: The has_time of this ImageDateDto. # noqa: E501 + :rtype: bool + """ + return self._has_time + + @has_time.setter + def has_time(self, has_time): + """Sets the has_time of this ImageDateDto. + + + :param has_time: The has_time of this ImageDateDto. # noqa: E501 + :type: bool + """ + if has_time is None: + raise ValueError("Invalid value for `has_time`, must not be `None`") # noqa: E501 + + self._has_time = has_time + + @property + def created_at(self): + """Gets the created_at of this ImageDateDto. # noqa: E501 + + + :return: The created_at of this ImageDateDto. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ImageDateDto. + + + :param created_at: The created_at of this ImageDateDto. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + 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(ImageDateDto, 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, ImageDateDto): + 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/swagger/api/api_database/models/image_dto.py b/swagger/api/api_database/models/image_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e067503c0eafaeba2441956475314662a3d946d3 --- /dev/null +++ b/swagger/api/api_database/models/image_dto.py @@ -0,0 +1,404 @@ +# 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 ImageDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str', + 'dialect': 'str', + 'hash': 'str', + 'compiled': 'datetime', + 'size': 'int', + 'environment': 'list[ImageEnvItemDto]', + 'driver_class': 'str', + 'date_formats': 'list[ImageDateDto]', + 'jdbc_method': 'str', + 'default_port': 'int' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag', + 'dialect': 'dialect', + 'hash': 'hash', + 'compiled': 'compiled', + 'size': 'size', + 'environment': 'environment', + 'driver_class': 'driver_class', + 'date_formats': 'date_formats', + 'jdbc_method': 'jdbc_method', + 'default_port': 'default_port' + } + + def __init__(self, id=None, repository=None, tag=None, dialect=None, hash=None, compiled=None, size=None, environment=None, driver_class=None, date_formats=None, jdbc_method=None, default_port=None): # noqa: E501 + """ImageDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self._dialect = None + self._hash = None + self._compiled = None + self._size = None + self._environment = None + self._driver_class = None + self._date_formats = None + self._jdbc_method = None + self._default_port = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + self.dialect = dialect + if hash is not None: + self.hash = hash + if compiled is not None: + self.compiled = compiled + if size is not None: + self.size = size + self.environment = environment + self.driver_class = driver_class + if date_formats is not None: + self.date_formats = date_formats + self.jdbc_method = jdbc_method + self.default_port = default_port + + @property + def id(self): + """Gets the id of this ImageDto. # noqa: E501 + + + :return: The id of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDto. + + + :param id: The id of this ImageDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageDto. # noqa: E501 + + + :return: The repository of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageDto. + + + :param repository: The repository of this ImageDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageDto. # noqa: E501 + + + :return: The tag of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageDto. + + + :param tag: The tag of this ImageDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + @property + def dialect(self): + """Gets the dialect of this ImageDto. # noqa: E501 + + + :return: The dialect of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._dialect + + @dialect.setter + def dialect(self, dialect): + """Sets the dialect of this ImageDto. + + + :param dialect: The dialect of this ImageDto. # noqa: E501 + :type: str + """ + if dialect is None: + raise ValueError("Invalid value for `dialect`, must not be `None`") # noqa: E501 + + self._dialect = dialect + + @property + def hash(self): + """Gets the hash of this ImageDto. # noqa: E501 + + + :return: The hash of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ImageDto. + + + :param hash: The hash of this ImageDto. # noqa: E501 + :type: str + """ + + self._hash = hash + + @property + def compiled(self): + """Gets the compiled of this ImageDto. # noqa: E501 + + + :return: The compiled of this ImageDto. # noqa: E501 + :rtype: datetime + """ + return self._compiled + + @compiled.setter + def compiled(self, compiled): + """Sets the compiled of this ImageDto. + + + :param compiled: The compiled of this ImageDto. # noqa: E501 + :type: datetime + """ + + self._compiled = compiled + + @property + def size(self): + """Gets the size of this ImageDto. # noqa: E501 + + + :return: The size of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this ImageDto. + + + :param size: The size of this ImageDto. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def environment(self): + """Gets the environment of this ImageDto. # noqa: E501 + + + :return: The environment of this ImageDto. # noqa: E501 + :rtype: list[ImageEnvItemDto] + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this ImageDto. + + + :param environment: The environment of this ImageDto. # noqa: E501 + :type: list[ImageEnvItemDto] + """ + if environment is None: + raise ValueError("Invalid value for `environment`, must not be `None`") # noqa: E501 + + self._environment = environment + + @property + def driver_class(self): + """Gets the driver_class of this ImageDto. # noqa: E501 + + + :return: The driver_class of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._driver_class + + @driver_class.setter + def driver_class(self, driver_class): + """Sets the driver_class of this ImageDto. + + + :param driver_class: The driver_class of this ImageDto. # noqa: E501 + :type: str + """ + if driver_class is None: + raise ValueError("Invalid value for `driver_class`, must not be `None`") # noqa: E501 + + self._driver_class = driver_class + + @property + def date_formats(self): + """Gets the date_formats of this ImageDto. # noqa: E501 + + + :return: The date_formats of this ImageDto. # noqa: E501 + :rtype: list[ImageDateDto] + """ + return self._date_formats + + @date_formats.setter + def date_formats(self, date_formats): + """Sets the date_formats of this ImageDto. + + + :param date_formats: The date_formats of this ImageDto. # noqa: E501 + :type: list[ImageDateDto] + """ + + self._date_formats = date_formats + + @property + def jdbc_method(self): + """Gets the jdbc_method of this ImageDto. # noqa: E501 + + + :return: The jdbc_method of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._jdbc_method + + @jdbc_method.setter + def jdbc_method(self, jdbc_method): + """Sets the jdbc_method of this ImageDto. + + + :param jdbc_method: The jdbc_method of this ImageDto. # noqa: E501 + :type: str + """ + if jdbc_method is None: + raise ValueError("Invalid value for `jdbc_method`, must not be `None`") # noqa: E501 + + self._jdbc_method = jdbc_method + + @property + def default_port(self): + """Gets the default_port of this ImageDto. # noqa: E501 + + + :return: The default_port of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._default_port + + @default_port.setter + def default_port(self, default_port): + """Sets the default_port of this ImageDto. + + + :param default_port: The default_port of this ImageDto. # noqa: E501 + :type: int + """ + if default_port is None: + raise ValueError("Invalid value for `default_port`, must not be `None`") # noqa: E501 + + self._default_port = default_port + + 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(ImageDto, 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, ImageDto): + 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/swagger/api/api_database/models/image_env_item_dto.py b/swagger/api/api_database/models/image_env_item_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..731f28ed827093c1414b766d4d07007f05ea67da --- /dev/null +++ b/swagger/api/api_database/models/image_env_item_dto.py @@ -0,0 +1,198 @@ +# 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 ImageEnvItemDto(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 = { + 'iid': 'int', + 'key': 'str', + 'value': 'str', + 'type': 'str' + } + + attribute_map = { + 'iid': 'iid', + 'key': 'key', + 'value': 'value', + 'type': 'type' + } + + def __init__(self, iid=None, key=None, value=None, type=None): # noqa: E501 + """ImageEnvItemDto - a model defined in Swagger""" # noqa: E501 + self._iid = None + self._key = None + self._value = None + self._type = None + self.discriminator = None + self.iid = iid + self.key = key + self.value = value + self.type = type + + @property + def iid(self): + """Gets the iid of this ImageEnvItemDto. # noqa: E501 + + + :return: The iid of this ImageEnvItemDto. # noqa: E501 + :rtype: int + """ + return self._iid + + @iid.setter + def iid(self, iid): + """Sets the iid of this ImageEnvItemDto. + + + :param iid: The iid of this ImageEnvItemDto. # noqa: E501 + :type: int + """ + if iid is None: + raise ValueError("Invalid value for `iid`, must not be `None`") # noqa: E501 + + self._iid = iid + + @property + def key(self): + """Gets the key of this ImageEnvItemDto. # noqa: E501 + + + :return: The key of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this ImageEnvItemDto. + + + :param key: The key of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if key is None: + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value(self): + """Gets the value of this ImageEnvItemDto. # noqa: E501 + + + :return: The value of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ImageEnvItemDto. + + + :param value: The value of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this ImageEnvItemDto. # noqa: E501 + + + :return: The type of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ImageEnvItemDto. + + + :param type: The type of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["username", "password", "privileged_username", "privileged_password"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + 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(ImageEnvItemDto, 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, ImageEnvItemDto): + 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/swagger/api/api_database/models/license_dto.py b/swagger/api/api_database/models/license_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..82deeda03133bd40eb478cc84f2efe6cb5ffb317 --- /dev/null +++ b/swagger/api/api_database/models/license_dto.py @@ -0,0 +1,138 @@ +# 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 LicenseDto(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 = { + 'identifier': 'str', + 'uri': 'str' + } + + attribute_map = { + 'identifier': 'identifier', + 'uri': 'uri' + } + + def __init__(self, identifier=None, uri=None): # noqa: E501 + """LicenseDto - a model defined in Swagger""" # noqa: E501 + self._identifier = None + self._uri = None + self.discriminator = None + self.identifier = identifier + self.uri = uri + + @property + def identifier(self): + """Gets the identifier of this LicenseDto. # noqa: E501 + + + :return: The identifier of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this LicenseDto. + + + :param identifier: The identifier of this LicenseDto. # noqa: E501 + :type: str + """ + if identifier is None: + raise ValueError("Invalid value for `identifier`, must not be `None`") # noqa: E501 + + self._identifier = identifier + + @property + def uri(self): + """Gets the uri of this LicenseDto. # noqa: E501 + + + :return: The uri of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this LicenseDto. + + + :param uri: The uri of this LicenseDto. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + 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(LicenseDto, 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, LicenseDto): + 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/swagger/api/api_database/models/table_brief_dto.py b/swagger/api/api_database/models/table_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..168f85b02f7b36375e25f3efa685455c010c72c4 --- /dev/null +++ b/swagger/api/api_database/models/table_brief_dto.py @@ -0,0 +1,192 @@ +# 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 TableBriefDto(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 = { + 'id': 'int', + 'name': 'str', + 'creator': 'UserBriefDto', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator': 'creator', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + """TableBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._creator = None + self._internal_name = None + self.discriminator = None + self.id = id + self.name = name + self.creator = creator + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this TableBriefDto. # noqa: E501 + + + :return: The id of this TableBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TableBriefDto. + + + :param id: The id of this TableBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this TableBriefDto. # noqa: E501 + + + :return: The name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TableBriefDto. + + + :param name: The name of this TableBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this TableBriefDto. # noqa: E501 + + + :return: The creator of this TableBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this TableBriefDto. + + + :param creator: The creator of this TableBriefDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def internal_name(self): + """Gets the internal_name of this TableBriefDto. # noqa: E501 + + + :return: The internal_name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this TableBriefDto. + + + :param internal_name: The internal_name of this TableBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(TableBriefDto, 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, TableBriefDto): + 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/swagger/api/api_database/models/user_brief_dto.py b/swagger/api/api_database/models/user_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..8803ecc7bd620090e37f9ede772206c9e2d9b35c --- /dev/null +++ b/swagger/api/api_database/models/user_brief_dto.py @@ -0,0 +1,350 @@ +# 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 UserBriefDto(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 = { + 'id': 'int', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserBriefDto. # noqa: E501 + + + :return: The id of this UserBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserBriefDto. + + + :param id: The id of this UserBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def username(self): + """Gets the username of this UserBriefDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserBriefDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserBriefDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserBriefDto. # noqa: E501 + + + :return: The firstname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserBriefDto. + + + :param firstname: The firstname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserBriefDto. # noqa: E501 + + + :return: The lastname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserBriefDto. + + + :param lastname: The lastname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserBriefDto. # noqa: E501 + + + :return: The affiliation of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserBriefDto. + + + :param affiliation: The affiliation of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserBriefDto. # noqa: E501 + + + :return: The orcid of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserBriefDto. + + + :param orcid: The orcid of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserBriefDto. # noqa: E501 + + + :return: The theme_dark of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserBriefDto. + + + :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserBriefDto. # noqa: E501 + + + :return: The email_verified of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserBriefDto. + + + :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserBriefDto, 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, UserBriefDto): + 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/swagger/api/api_database/models/user_dto.py b/swagger/api/api_database/models/user_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..fef246bbae7e509d86e14142176a3fb235fa5d89 --- /dev/null +++ b/swagger/api/api_database/models/user_dto.py @@ -0,0 +1,479 @@ +# 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 UserDto(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 = { + 'id': 'int', + 'authorities': 'list[GrantedAuthorityDto]', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'containers': 'list[ContainerDto]', + 'databases': 'list[ContainerDto]', + 'identifiers': 'list[ContainerDto]', + 'email': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'authorities': 'authorities', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'containers': 'containers', + 'databases': 'databases', + 'identifiers': 'identifiers', + 'email': 'email', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._authorities = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._containers = None + self._databases = None + self._identifiers = None + self._email = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + if authorities is not None: + self.authorities = authorities + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if containers is not None: + self.containers = containers + if databases is not None: + self.databases = databases + if identifiers is not None: + self.identifiers = identifiers + self.email = email + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserDto. # noqa: E501 + + + :return: The id of this UserDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserDto. + + + :param id: The id of this UserDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def authorities(self): + """Gets the authorities of this UserDto. # noqa: E501 + + + :return: The authorities of this UserDto. # noqa: E501 + :rtype: list[GrantedAuthorityDto] + """ + return self._authorities + + @authorities.setter + def authorities(self, authorities): + """Sets the authorities of this UserDto. + + + :param authorities: The authorities of this UserDto. # noqa: E501 + :type: list[GrantedAuthorityDto] + """ + + self._authorities = authorities + + @property + def username(self): + """Gets the username of this UserDto. # noqa: E501 + + + :return: The username of this UserDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserDto. + + + :param username: The username of this UserDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserDto. # noqa: E501 + + + :return: The firstname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserDto. + + + :param firstname: The firstname of this UserDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserDto. # noqa: E501 + + + :return: The lastname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserDto. + + + :param lastname: The lastname of this UserDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserDto. # noqa: E501 + + + :return: The affiliation of this UserDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserDto. + + + :param affiliation: The affiliation of this UserDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserDto. # noqa: E501 + + + :return: The orcid of this UserDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserDto. + + + :param orcid: The orcid of this UserDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def containers(self): + """Gets the containers of this UserDto. # noqa: E501 + + + :return: The containers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._containers + + @containers.setter + def containers(self, containers): + """Sets the containers of this UserDto. + + + :param containers: The containers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._containers = containers + + @property + def databases(self): + """Gets the databases of this UserDto. # noqa: E501 + + + :return: The databases of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this UserDto. + + + :param databases: The databases of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._databases = databases + + @property + def identifiers(self): + """Gets the identifiers of this UserDto. # noqa: E501 + + + :return: The identifiers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._identifiers + + @identifiers.setter + def identifiers(self, identifiers): + """Sets the identifiers of this UserDto. + + + :param identifiers: The identifiers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._identifiers = identifiers + + @property + def email(self): + """Gets the email of this UserDto. # noqa: E501 + + + :return: The email of this UserDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserDto. + + + :param email: The email of this UserDto. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def titles_before(self): + """Gets the titles_before of this UserDto. # noqa: E501 + + + :return: The titles_before of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserDto. + + + :param titles_before: The titles_before of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserDto. # noqa: E501 + + + :return: The titles_after of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserDto. + + + :param titles_after: The titles_after of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserDto. # noqa: E501 + + + :return: The theme_dark of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserDto. + + + :param theme_dark: The theme_dark of this UserDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserDto. # noqa: E501 + + + :return: The email_verified of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserDto. + + + :param email_verified: The email_verified of this UserDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserDto, 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, UserDto): + 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/swagger/api/api_database/rest.py b/swagger/api/api_database/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..b0660ec0a57a3bb1d61c28f5f2fd0f00aefbe03c --- /dev/null +++ b/swagger/api/api_database/rest.py @@ -0,0 +1,317 @@ +# 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 +""" + +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/swagger/api/api_identifier/__init__.py b/swagger/api/api_identifier/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..004d1c92b4090d4278f7b889ddf19bcceed7077e --- /dev/null +++ b/swagger/api/api_identifier/__init__.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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_identifier.api.identifier_endpoint_api import IdentifierEndpointApi +from api_identifier.api.persistence_endpoint_api import PersistenceEndpointApi +# import ApiClient +from api_identifier.api_client import ApiClient +from api_identifier.configuration import Configuration +# import models into sdk package +from api_identifier.models.api_error_dto import ApiErrorDto +from api_identifier.models.container_dto import ContainerDto +from api_identifier.models.creator_create_dto import CreatorCreateDto +from api_identifier.models.creator_dto import CreatorDto +from api_identifier.models.database_dto import DatabaseDto +from api_identifier.models.granted_authority_dto import GrantedAuthorityDto +from api_identifier.models.identifier_create_dto import IdentifierCreateDto +from api_identifier.models.identifier_dto import IdentifierDto +from api_identifier.models.image_brief_dto import ImageBriefDto +from api_identifier.models.image_date_dto import ImageDateDto +from api_identifier.models.image_dto import ImageDto +from api_identifier.models.image_env_item_dto import ImageEnvItemDto +from api_identifier.models.license_dto import LicenseDto +from api_identifier.models.related_identifier_create_dto import RelatedIdentifierCreateDto +from api_identifier.models.related_identifier_dto import RelatedIdentifierDto +from api_identifier.models.table_brief_dto import TableBriefDto +from api_identifier.models.user_brief_dto import UserBriefDto +from api_identifier.models.user_dto import UserDto diff --git a/swagger/api/api_identifier/api/__init__.py b/swagger/api/api_identifier/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dcdac13945c7190cfdf82721a20e61bf43f9112d --- /dev/null +++ b/swagger/api/api_identifier/api/__init__.py @@ -0,0 +1,7 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_identifier.api.identifier_endpoint_api import IdentifierEndpointApi +from api_identifier.api.persistence_endpoint_api import PersistenceEndpointApi diff --git a/swagger/api/api_identifier/api/identifier_endpoint_api.py b/swagger/api/api_identifier/api/identifier_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..c481c9ff454520d489156ea4d9e1c2ba6840c353 --- /dev/null +++ b/swagger/api/api_identifier/api/identifier_endpoint_api.py @@ -0,0 +1,598 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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_identifier.api_client import ApiClient + + +class IdentifierEndpointApi(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 create(self, body, authorization, id, database_id, **kwargs): # noqa: E501 + """Create identifier # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create(body, authorization, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IdentifierCreateDto body: (required) + :param str authorization: (required) + :param int id: (required) + :param int database_id: (required) + :return: IdentifierDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_with_http_info(body, authorization, id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.create_with_http_info(body, authorization, id, database_id, **kwargs) # noqa: E501 + return data + + def create_with_http_info(self, body, authorization, id, database_id, **kwargs): # noqa: E501 + """Create identifier # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_with_http_info(body, authorization, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IdentifierCreateDto body: (required) + :param str authorization: (required) + :param int id: (required) + :param int database_id: (required) + :return: IdentifierDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'authorization', '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 create" % 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 `create`") # noqa: E501 + # verify the required parameter 'authorization' is set + if ('authorization' not in params or + params['authorization'] is None): + raise ValueError("Missing the required parameter `authorization` when calling `create`") # 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 `create`") # 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 `create`") # 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 = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + + 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}/identifier', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IdentifierDto', # 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 delete(self, id, database_id, identifer_id, **kwargs): # noqa: E501 + """Delete some identifer # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete(id, database_id, identifer_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int identifer_id: (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.delete_with_http_info(id, database_id, identifer_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_with_http_info(id, database_id, identifer_id, **kwargs) # noqa: E501 + return data + + def delete_with_http_info(self, id, database_id, identifer_id, **kwargs): # noqa: E501 + """Delete some identifer # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_with_http_info(id, database_id, identifer_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int identifer_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'identifer_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 delete" % key + ) + params[key] = val + del params['kwargs'] + # 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 `delete`") # 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 `delete`") # noqa: E501 + # verify the required parameter 'identifer_id' is set + if ('identifer_id' not in params or + params['identifer_id'] is None): + raise ValueError("Missing the required parameter `identifer_id` when calling `delete`") # 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 = [] + if 'identifer_id' in params: + query_params.append(('identiferId', params['identifer_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/identifier/{identiferId}', 'DELETE', + 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) + + def export(self, id, database_id, identifier_id, **kwargs): # noqa: E501 + """Export some identifier metadata # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.export(id, database_id, identifier_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int identifier_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.export_with_http_info(id, database_id, identifier_id, **kwargs) # noqa: E501 + else: + (data) = self.export_with_http_info(id, database_id, identifier_id, **kwargs) # noqa: E501 + return data + + def export_with_http_info(self, id, database_id, identifier_id, **kwargs): # noqa: E501 + """Export some identifier metadata # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.export_with_http_info(id, database_id, identifier_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int identifier_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'identifier_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 export" % key + ) + params[key] = val + del params['kwargs'] + # 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 `export`") # 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 `export`") # noqa: E501 + # verify the required parameter 'identifier_id' is set + if ('identifier_id' not in params or + params['identifier_id'] is None): + raise ValueError("Missing the required parameter `identifier_id` when calling `export`") # 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 + if 'identifier_id' in params: + path_params['identifierId'] = params['identifier_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/identifier/{identifierId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # 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 find_all(self, id, database_id, **kwargs): # noqa: E501 + """Find identifiers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int qid: + :return: list[IdentifierDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + return data + + def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Find identifiers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all_with_http_info(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int qid: + :return: list[IdentifierDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'qid'] # 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 find_all" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_all`") # 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 `find_all`") # 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 = [] + if 'qid' in params: + query_params.append(('qid', params['qid'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/identifier', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[IdentifierDto]', # 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, identifer_id, id, database_id, **kwargs): # noqa: E501 + """Update some identifier # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(body, identifer_id, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IdentifierDto body: (required) + :param int identifer_id: (required) + :param int id: (required) + :param int database_id: (required) + :return: IdentifierDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_with_http_info(body, identifer_id, id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(body, identifer_id, id, database_id, **kwargs) # noqa: E501 + return data + + def update_with_http_info(self, body, identifer_id, id, database_id, **kwargs): # noqa: E501 + """Update some identifier # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_with_http_info(body, identifer_id, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IdentifierDto body: (required) + :param int identifer_id: (required) + :param int id: (required) + :param int database_id: (required) + :return: IdentifierDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'identifer_id', '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 update" % 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 `update`") # noqa: E501 + # verify the required parameter 'identifer_id' is set + if ('identifer_id' not in params or + params['identifer_id'] is None): + raise ValueError("Missing the required parameter `identifer_id` when calling `update`") # 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 `update`") # 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 `update`") # 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 = [] + if 'identifer_id' in params: + query_params.append(('identiferId', params['identifer_id'])) # noqa: E501 + + 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}/identifier/{identiferId}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IdentifierDto', # 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/swagger/api/api_identifier/api/persistence_endpoint_api.py b/swagger/api/api_identifier/api/persistence_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..46af546da5338e05cc0aeaf948762e7794efb1fe --- /dev/null +++ b/swagger/api/api_identifier/api/persistence_endpoint_api.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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_identifier.api_client import ApiClient + + +class PersistenceEndpointApi(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 find(self, pid, **kwargs): # noqa: E501 + """Find some identifier # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find(pid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pid: (required) + :return: IdentifierDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_with_http_info(pid, **kwargs) # noqa: E501 + else: + (data) = self.find_with_http_info(pid, **kwargs) # noqa: E501 + return data + + def find_with_http_info(self, pid, **kwargs): # noqa: E501 + """Find some identifier # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_with_http_info(pid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pid: (required) + :return: IdentifierDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pid'] # 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 find" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pid' is set + if ('pid' not in params or + params['pid'] is None): + raise ValueError("Missing the required parameter `pid` when calling `find`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pid' in params: + path_params['pid'] = params['pid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/pid/{pid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IdentifierDto', # 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/swagger/api/api_identifier/api_client.py b/swagger/api/api_identifier/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..9328e6c1eaecabf1c81a968202b2e2d0588b0795 --- /dev/null +++ b/swagger/api/api_identifier/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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_identifier.configuration import Configuration +import api_identifier.models +from api_identifier 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_identifier.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/swagger/api/api_identifier/configuration.py b/swagger/api/api_identifier/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..28b5cf87552aa2b12278480c89b594d8332d847b --- /dev/null +++ b/swagger/api/api_identifier/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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_identifier") + 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/swagger/api/api_identifier/models/__init__.py b/swagger/api/api_identifier/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..10de3f2d883f13ef5e5b73c543d8a8c8b770850d --- /dev/null +++ b/swagger/api/api_identifier/models/__init__.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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_identifier.models.api_error_dto import ApiErrorDto +from api_identifier.models.container_dto import ContainerDto +from api_identifier.models.creator_create_dto import CreatorCreateDto +from api_identifier.models.creator_dto import CreatorDto +from api_identifier.models.database_dto import DatabaseDto +from api_identifier.models.granted_authority_dto import GrantedAuthorityDto +from api_identifier.models.identifier_create_dto import IdentifierCreateDto +from api_identifier.models.identifier_dto import IdentifierDto +from api_identifier.models.image_brief_dto import ImageBriefDto +from api_identifier.models.image_date_dto import ImageDateDto +from api_identifier.models.image_dto import ImageDto +from api_identifier.models.image_env_item_dto import ImageEnvItemDto +from api_identifier.models.license_dto import LicenseDto +from api_identifier.models.related_identifier_create_dto import RelatedIdentifierCreateDto +from api_identifier.models.related_identifier_dto import RelatedIdentifierDto +from api_identifier.models.table_brief_dto import TableBriefDto +from api_identifier.models.user_brief_dto import UserBriefDto +from api_identifier.models.user_dto import UserDto diff --git a/swagger/api/api_identifier/models/api_error_dto.py b/swagger/api/api_identifier/models/api_error_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..cf63fab43ba16f5318d3bd685a1d3ca140e7e673 --- /dev/null +++ b/swagger/api/api_identifier/models/api_error_dto.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 ApiErrorDto(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 = { + 'status': 'str', + 'message': 'str', + 'code': 'str' + } + + attribute_map = { + 'status': 'status', + 'message': 'message', + 'code': 'code' + } + + def __init__(self, status=None, message=None, code=None): # noqa: E501 + """ApiErrorDto - a model defined in Swagger""" # noqa: E501 + self._status = None + self._message = None + self._code = None + self.discriminator = None + self.status = status + self.message = message + self.code = code + + @property + def status(self): + """Gets the status of this ApiErrorDto. # noqa: E501 + + + :return: The status of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ApiErrorDto. + + + :param status: The status of this ApiErrorDto. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["100 CONTINUE", "101 SWITCHING_PROTOCOLS", "102 PROCESSING", "103 CHECKPOINT", "200 OK", "201 CREATED", "202 ACCEPTED", "203 NON_AUTHORITATIVE_INFORMATION", "204 NO_CONTENT", "205 RESET_CONTENT", "206 PARTIAL_CONTENT", "207 MULTI_STATUS", "208 ALREADY_REPORTED", "226 IM_USED", "300 MULTIPLE_CHOICES", "301 MOVED_PERMANENTLY", "302 FOUND", "302 MOVED_TEMPORARILY", "303 SEE_OTHER", "304 NOT_MODIFIED", "305 USE_PROXY", "307 TEMPORARY_REDIRECT", "308 PERMANENT_REDIRECT", "400 BAD_REQUEST", "401 UNAUTHORIZED", "402 PAYMENT_REQUIRED", "403 FORBIDDEN", "404 NOT_FOUND", "405 METHOD_NOT_ALLOWED", "406 NOT_ACCEPTABLE", "407 PROXY_AUTHENTICATION_REQUIRED", "408 REQUEST_TIMEOUT", "409 CONFLICT", "410 GONE", "411 LENGTH_REQUIRED", "412 PRECONDITION_FAILED", "413 PAYLOAD_TOO_LARGE", "413 REQUEST_ENTITY_TOO_LARGE", "414 URI_TOO_LONG", "414 REQUEST_URI_TOO_LONG", "415 UNSUPPORTED_MEDIA_TYPE", "416 REQUESTED_RANGE_NOT_SATISFIABLE", "417 EXPECTATION_FAILED", "418 I_AM_A_TEAPOT", "419 INSUFFICIENT_SPACE_ON_RESOURCE", "420 METHOD_FAILURE", "421 DESTINATION_LOCKED", "422 UNPROCESSABLE_ENTITY", "423 LOCKED", "424 FAILED_DEPENDENCY", "425 TOO_EARLY", "426 UPGRADE_REQUIRED", "428 PRECONDITION_REQUIRED", "429 TOO_MANY_REQUESTS", "431 REQUEST_HEADER_FIELDS_TOO_LARGE", "451 UNAVAILABLE_FOR_LEGAL_REASONS", "500 INTERNAL_SERVER_ERROR", "501 NOT_IMPLEMENTED", "502 BAD_GATEWAY", "503 SERVICE_UNAVAILABLE", "504 GATEWAY_TIMEOUT", "505 HTTP_VERSION_NOT_SUPPORTED", "506 VARIANT_ALSO_NEGOTIATES", "507 INSUFFICIENT_STORAGE", "508 LOOP_DETECTED", "509 BANDWIDTH_LIMIT_EXCEEDED", "510 NOT_EXTENDED", "511 NETWORK_AUTHENTICATION_REQUIRED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def message(self): + """Gets the message of this ApiErrorDto. # noqa: E501 + + + :return: The message of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiErrorDto. + + + :param message: The message of this ApiErrorDto. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def code(self): + """Gets the code of this ApiErrorDto. # noqa: E501 + + + :return: The code of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiErrorDto. + + + :param code: The code of this ApiErrorDto. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + 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(ApiErrorDto, 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, ApiErrorDto): + 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/swagger/api/api_identifier/models/container_dto.py b/swagger/api/api_identifier/models/container_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..693e708bb79270f8205e19a3d28bdff9960c24eb --- /dev/null +++ b/swagger/api/api_identifier/models/container_dto.py @@ -0,0 +1,355 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 ContainerDto(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 = { + 'id': 'int', + 'hash': 'str', + 'name': 'str', + 'state': 'str', + 'databases': 'list[DatabaseDto]', + 'image': 'ImageBriefDto', + 'port': 'int', + 'created': 'datetime', + 'internal_name': 'str', + 'ip_address': 'str' + } + + attribute_map = { + 'id': 'id', + 'hash': 'hash', + 'name': 'name', + 'state': 'state', + 'databases': 'databases', + 'image': 'image', + 'port': 'port', + 'created': 'created', + 'internal_name': 'internal_name', + 'ip_address': 'ip_address' + } + + def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + """ContainerDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._hash = None + self._name = None + self._state = None + self._databases = None + self._image = None + self._port = None + self._created = None + self._internal_name = None + self._ip_address = None + self.discriminator = None + self.id = id + self.hash = hash + self.name = name + if state is not None: + self.state = state + if databases is not None: + self.databases = databases + if image is not None: + self.image = image + if port is not None: + self.port = port + self.created = created + self.internal_name = internal_name + if ip_address is not None: + self.ip_address = ip_address + + @property + def id(self): + """Gets the id of this ContainerDto. # noqa: E501 + + + :return: The id of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContainerDto. + + + :param id: The id of this ContainerDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def hash(self): + """Gets the hash of this ContainerDto. # noqa: E501 + + + :return: The hash of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ContainerDto. + + + :param hash: The hash of this ContainerDto. # noqa: E501 + :type: str + """ + if hash is None: + raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501 + + self._hash = hash + + @property + def name(self): + """Gets the name of this ContainerDto. # noqa: E501 + + + :return: The name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerDto. + + + :param name: The name of this ContainerDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def state(self): + """Gets the state of this ContainerDto. # noqa: E501 + + + :return: The state of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this ContainerDto. + + + :param state: The state of this ContainerDto. # noqa: E501 + :type: str + """ + allowed_values = ["created", "restarting", "running", "paused", "exited", "dead"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def databases(self): + """Gets the databases of this ContainerDto. # noqa: E501 + + + :return: The databases of this ContainerDto. # noqa: E501 + :rtype: list[DatabaseDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this ContainerDto. + + + :param databases: The databases of this ContainerDto. # noqa: E501 + :type: list[DatabaseDto] + """ + + self._databases = databases + + @property + def image(self): + """Gets the image of this ContainerDto. # noqa: E501 + + + :return: The image of this ContainerDto. # noqa: E501 + :rtype: ImageBriefDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this ContainerDto. + + + :param image: The image of this ContainerDto. # noqa: E501 + :type: ImageBriefDto + """ + + self._image = image + + @property + def port(self): + """Gets the port of this ContainerDto. # noqa: E501 + + + :return: The port of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this ContainerDto. + + + :param port: The port of this ContainerDto. # noqa: E501 + :type: int + """ + + self._port = port + + @property + def created(self): + """Gets the created of this ContainerDto. # noqa: E501 + + + :return: The created of this ContainerDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ContainerDto. + + + :param created: The created of this ContainerDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def internal_name(self): + """Gets the internal_name of this ContainerDto. # noqa: E501 + + + :return: The internal_name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ContainerDto. + + + :param internal_name: The internal_name of this ContainerDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + @property + def ip_address(self): + """Gets the ip_address of this ContainerDto. # noqa: E501 + + + :return: The ip_address of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """Sets the ip_address of this ContainerDto. + + + :param ip_address: The ip_address of this ContainerDto. # noqa: E501 + :type: str + """ + + self._ip_address = ip_address + + 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(ContainerDto, 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, ContainerDto): + 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/swagger/api/api_identifier/models/creator_create_dto.py b/swagger/api/api_identifier/models/creator_create_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ff3331393ff708e809b5a21c25ccc0fa6edfa9e8 --- /dev/null +++ b/swagger/api/api_identifier/models/creator_create_dto.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 CreatorCreateDto(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 = { + 'name': 'str', + 'affiliation': 'str', + 'orcid': 'str' + } + + attribute_map = { + 'name': 'name', + 'affiliation': 'affiliation', + 'orcid': 'orcid' + } + + def __init__(self, name=None, affiliation=None, orcid=None): # noqa: E501 + """CreatorCreateDto - a model defined in Swagger""" # noqa: E501 + self._name = None + self._affiliation = None + self._orcid = None + self.discriminator = None + self.name = name + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + + @property + def name(self): + """Gets the name of this CreatorCreateDto. # noqa: E501 + + + :return: The name of this CreatorCreateDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreatorCreateDto. + + + :param name: The name of this CreatorCreateDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def affiliation(self): + """Gets the affiliation of this CreatorCreateDto. # noqa: E501 + + + :return: The affiliation of this CreatorCreateDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this CreatorCreateDto. + + + :param affiliation: The affiliation of this CreatorCreateDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this CreatorCreateDto. # noqa: E501 + + + :return: The orcid of this CreatorCreateDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this CreatorCreateDto. + + + :param orcid: The orcid of this CreatorCreateDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + 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(CreatorCreateDto, 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, CreatorCreateDto): + 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/swagger/api/api_identifier/models/creator_dto.py b/swagger/api/api_identifier/models/creator_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ebe85cc6c7b14cdb49c10b1b711a06d148ab9095 --- /dev/null +++ b/swagger/api/api_identifier/models/creator_dto.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 CreatorDto(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 = { + 'id': 'int', + 'name': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'created': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'created': 'created', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, name=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 + """CreatorDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._affiliation = None + self._orcid = None + self._created = None + self._last_modified = None + self.discriminator = None + self.id = id + self.name = name + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + self.created = created + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this CreatorDto. # noqa: E501 + + + :return: The id of this CreatorDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreatorDto. + + + :param id: The id of this CreatorDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this CreatorDto. # noqa: E501 + + + :return: The name of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreatorDto. + + + :param name: The name of this CreatorDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def affiliation(self): + """Gets the affiliation of this CreatorDto. # noqa: E501 + + + :return: The affiliation of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this CreatorDto. + + + :param affiliation: The affiliation of this CreatorDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this CreatorDto. # noqa: E501 + + + :return: The orcid of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this CreatorDto. + + + :param orcid: The orcid of this CreatorDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def created(self): + """Gets the created of this CreatorDto. # noqa: E501 + + + :return: The created of this CreatorDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this CreatorDto. + + + :param created: The created of this CreatorDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def last_modified(self): + """Gets the last_modified of this CreatorDto. # noqa: E501 + + + :return: The last_modified of this CreatorDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this CreatorDto. + + + :param last_modified: The last_modified of this CreatorDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + 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(CreatorDto, 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, CreatorDto): + 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/swagger/api/api_identifier/models/database_dto.py b/swagger/api/api_identifier/models/database_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..8e46079b68f82175ab2c44a7932b08fe919322f2 --- /dev/null +++ b/swagger/api/api_identifier/models/database_dto.py @@ -0,0 +1,589 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 DatabaseDto(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 = { + 'id': 'int', + 'name': 'str', + 'exchange': 'str', + 'creator': 'UserBriefDto', + 'subjects': 'list[str]', + 'language': 'str', + 'license': 'LicenseDto', + 'description': 'str', + 'publisher': 'str', + 'tables': 'list[TableBriefDto]', + 'image': 'ImageDto', + 'container': 'ContainerDto', + 'created': 'datetime', + 'deleted': 'datetime', + 'internal_name': 'str', + 'publication_year': 'int', + 'publication_month': 'int', + 'publication_day': 'int', + 'is_public': 'bool' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'exchange': 'exchange', + 'creator': 'creator', + 'subjects': 'subjects', + 'language': 'language', + 'license': 'license', + 'description': 'description', + 'publisher': 'publisher', + 'tables': 'tables', + 'image': 'image', + 'container': 'container', + 'created': 'created', + 'deleted': 'deleted', + 'internal_name': 'internal_name', + 'publication_year': 'publication_year', + 'publication_month': 'publication_month', + 'publication_day': 'publication_day', + 'is_public': 'is_public' + } + + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_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._tables = None + self._image = None + self._container = None + self._created = None + self._deleted = None + self._internal_name = None + self._publication_year = None + self._publication_month = None + self._publication_day = None + self._is_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 tables is not None: + self.tables = tables + if image is not None: + self.image = image + if container is not None: + self.container = container + if created is not None: + self.created = created + if deleted is not None: + self.deleted = deleted + self.internal_name = internal_name + if publication_year is not None: + self.publication_year = 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 is_public is not None: + self.is_public = is_public + + @property + def id(self): + """Gets the id of this DatabaseDto. # noqa: E501 + + + :return: The id of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DatabaseDto. + + + :param id: The id of this DatabaseDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this DatabaseDto. # noqa: E501 + + + :return: The name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DatabaseDto. + + + :param name: The name of this DatabaseDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def exchange(self): + """Gets the exchange of this DatabaseDto. # noqa: E501 + + + :return: The exchange of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this DatabaseDto. + + + :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :type: str + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def creator(self): + """Gets the creator of this DatabaseDto. # noqa: E501 + + + :return: The creator of this DatabaseDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this DatabaseDto. + + + :param creator: The creator of this DatabaseDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def subjects(self): + """Gets the subjects of this DatabaseDto. # noqa: E501 + + + :return: The subjects of this DatabaseDto. # noqa: E501 + :rtype: list[str] + """ + return self._subjects + + @subjects.setter + def subjects(self, subjects): + """Sets the subjects of this DatabaseDto. + + + :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :type: list[str] + """ + + self._subjects = subjects + + @property + def language(self): + """Gets the language of this DatabaseDto. # noqa: E501 + + + :return: The language of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this DatabaseDto. + + + :param language: The 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: + raise ValueError( + "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 + .format(language, allowed_values) + ) + + self._language = language + + @property + def license(self): + """Gets the license of this DatabaseDto. # noqa: E501 + + + :return: The license of this DatabaseDto. # noqa: E501 + :rtype: LicenseDto + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this DatabaseDto. + + + :param license: The license of this DatabaseDto. # noqa: E501 + :type: LicenseDto + """ + + self._license = license + + @property + def description(self): + """Gets the description of this DatabaseDto. # noqa: E501 + + + :return: The description of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this DatabaseDto. + + + :param description: The description of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def publisher(self): + """Gets the publisher of this DatabaseDto. # noqa: E501 + + + :return: The publisher of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this DatabaseDto. + + + :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._publisher = publisher + + @property + def tables(self): + """Gets the tables of this DatabaseDto. # noqa: E501 + + + :return: The tables of this DatabaseDto. # noqa: E501 + :rtype: list[TableBriefDto] + """ + return self._tables + + @tables.setter + def tables(self, tables): + """Sets the tables of this DatabaseDto. + + + :param tables: The tables of this DatabaseDto. # noqa: E501 + :type: list[TableBriefDto] + """ + + self._tables = tables + + @property + def image(self): + """Gets the image of this DatabaseDto. # noqa: E501 + + + :return: The image of this DatabaseDto. # noqa: E501 + :rtype: ImageDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this DatabaseDto. + + + :param image: The image of this DatabaseDto. # noqa: E501 + :type: ImageDto + """ + + self._image = image + + @property + def container(self): + """Gets the container of this DatabaseDto. # noqa: E501 + + + :return: The container of this DatabaseDto. # noqa: E501 + :rtype: ContainerDto + """ + return self._container + + @container.setter + def container(self, container): + """Sets the container of this DatabaseDto. + + + :param container: The container of this DatabaseDto. # noqa: E501 + :type: ContainerDto + """ + + self._container = container + + @property + def created(self): + """Gets the created of this DatabaseDto. # noqa: E501 + + + :return: The created of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseDto. + + + :param created: The created of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def deleted(self): + """Gets the deleted of this DatabaseDto. # noqa: E501 + + + :return: The deleted of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this DatabaseDto. + + + :param deleted: The deleted of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._deleted = deleted + + @property + def internal_name(self): + """Gets the internal_name of this DatabaseDto. # noqa: E501 + + + :return: The internal_name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this DatabaseDto. + + + :param internal_name: The 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 + + self._internal_name = internal_name + + @property + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 + + + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. + + + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_year = publication_year + + @property + def publication_month(self): + """Gets the publication_month of this DatabaseDto. # noqa: E501 + + + :return: The publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this DatabaseDto. + + + :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_day(self): + """Gets the publication_day of this DatabaseDto. # noqa: E501 + + + :return: The publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this DatabaseDto. + + + :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def is_public(self): + """Gets the is_public of this DatabaseDto. # noqa: E501 + + + :return: The is_public of this DatabaseDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseDto. + + + :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :type: bool + """ + + 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(DatabaseDto, 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, DatabaseDto): + 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/swagger/api/api_identifier/models/granted_authority_dto.py b/swagger/api/api_identifier/models/granted_authority_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..40fd021878c0ce17aea607b5b87ee65c950440bf --- /dev/null +++ b/swagger/api/api_identifier/models/granted_authority_dto.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 GrantedAuthorityDto(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 = { + 'authority': 'str' + } + + attribute_map = { + 'authority': 'authority' + } + + def __init__(self, authority=None): # noqa: E501 + """GrantedAuthorityDto - a model defined in Swagger""" # noqa: E501 + self._authority = None + self.discriminator = None + if authority is not None: + self.authority = authority + + @property + def authority(self): + """Gets the authority of this GrantedAuthorityDto. # noqa: E501 + + + :return: The authority of this GrantedAuthorityDto. # noqa: E501 + :rtype: str + """ + return self._authority + + @authority.setter + def authority(self, authority): + """Sets the authority of this GrantedAuthorityDto. + + + :param authority: The authority of this GrantedAuthorityDto. # noqa: E501 + :type: str + """ + + self._authority = authority + + 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(GrantedAuthorityDto, 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, GrantedAuthorityDto): + 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/swagger/api/api_identifier/models/identifier_create_dto.py b/swagger/api/api_identifier/models/identifier_create_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..80c8790bdcde9549390fc471a5a7bf95228d940d --- /dev/null +++ b/swagger/api/api_identifier/models/identifier_create_dto.py @@ -0,0 +1,382 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 IdentifierCreateDto(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 = { + 'qid': 'int', + 'title': 'str', + 'description': 'str', + 'visibility': 'str', + 'doi': 'str', + 'publisher': 'str', + 'creators': 'list[CreatorCreateDto]', + 'publication_day': 'int', + 'publication_month': 'int', + 'publication_year': 'int', + 'related_identifiers': 'list[RelatedIdentifierCreateDto]' + } + + attribute_map = { + 'qid': 'qid', + 'title': 'title', + 'description': 'description', + 'visibility': 'visibility', + 'doi': 'doi', + 'publisher': 'publisher', + 'creators': 'creators', + 'publication_day': 'publication_day', + 'publication_month': 'publication_month', + 'publication_year': 'publication_year', + 'related_identifiers': 'related_identifiers' + } + + 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 + self._publication_year = None + self._related_identifiers = None + self.discriminator = None + self.qid = qid + self.title = title + self.description = description + 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 + if publication_month is not None: + self.publication_month = publication_month + self.publication_year = publication_year + if related_identifiers is not None: + self.related_identifiers = related_identifiers + + @property + def qid(self): + """Gets the qid of this IdentifierCreateDto. # noqa: E501 + + + :return: The qid of this IdentifierCreateDto. # noqa: E501 + :rtype: int + """ + return self._qid + + @qid.setter + def qid(self, qid): + """Sets the qid of this IdentifierCreateDto. + + + :param qid: The qid of this IdentifierCreateDto. # noqa: E501 + :type: int + """ + if qid is None: + raise ValueError("Invalid value for `qid`, must not be `None`") # noqa: E501 + + self._qid = qid + + @property + def title(self): + """Gets the title of this IdentifierCreateDto. # noqa: E501 + + + :return: The title of this IdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this IdentifierCreateDto. + + + :param title: The title of this IdentifierCreateDto. # noqa: E501 + :type: str + """ + if title is None: + raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501 + + self._title = title + + @property + def description(self): + """Gets the description of this IdentifierCreateDto. # noqa: E501 + + + :return: The description of this IdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IdentifierCreateDto. + + + :param description: The description of this IdentifierCreateDto. # 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 visibility(self): + """Gets the visibility of this IdentifierCreateDto. # noqa: E501 + + + :return: The visibility of this IdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._visibility + + @visibility.setter + def visibility(self, visibility): + """Sets the visibility of this IdentifierCreateDto. + + + :param visibility: The visibility of this IdentifierCreateDto. # noqa: E501 + :type: str + """ + if visibility is None: + raise ValueError("Invalid value for `visibility`, must not be `None`") # noqa: E501 + allowed_values = ["everyone", "trusted", "self"] # noqa: E501 + if visibility not in allowed_values: + raise ValueError( + "Invalid value for `visibility` ({0}), must be one of {1}" # noqa: E501 + .format(visibility, allowed_values) + ) + + self._visibility = visibility + + @property + def doi(self): + """Gets the doi of this IdentifierCreateDto. # noqa: E501 + + + :return: The doi of this IdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._doi + + @doi.setter + def doi(self, doi): + """Sets the doi of this IdentifierCreateDto. + + + :param doi: The doi of this IdentifierCreateDto. # noqa: E501 + :type: str + """ + + 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 + + + :return: The creators of this IdentifierCreateDto. # noqa: E501 + :rtype: list[CreatorCreateDto] + """ + return self._creators + + @creators.setter + def creators(self, creators): + """Sets the creators of this IdentifierCreateDto. + + + :param creators: The creators of this IdentifierCreateDto. # noqa: E501 + :type: list[CreatorCreateDto] + """ + if creators is None: + raise ValueError("Invalid value for `creators`, must not be `None`") # noqa: E501 + + self._creators = creators + + @property + def publication_day(self): + """Gets the publication_day of this IdentifierCreateDto. # noqa: E501 + + + :return: The publication_day of this IdentifierCreateDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this IdentifierCreateDto. + + + :param publication_day: The publication_day of this IdentifierCreateDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def publication_month(self): + """Gets the publication_month of this IdentifierCreateDto. # noqa: E501 + + + :return: The publication_month of this IdentifierCreateDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this IdentifierCreateDto. + + + :param publication_month: The publication_month of this IdentifierCreateDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_year(self): + """Gets the publication_year of this IdentifierCreateDto. # noqa: E501 + + + :return: The publication_year of this IdentifierCreateDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this IdentifierCreateDto. + + + :param publication_year: The publication_year of this IdentifierCreateDto. # 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 + + @property + def related_identifiers(self): + """Gets the related_identifiers of this IdentifierCreateDto. # noqa: E501 + + + :return: The related_identifiers of this IdentifierCreateDto. # noqa: E501 + :rtype: list[RelatedIdentifierCreateDto] + """ + return self._related_identifiers + + @related_identifiers.setter + def related_identifiers(self, related_identifiers): + """Sets the related_identifiers of this IdentifierCreateDto. + + + :param related_identifiers: The related_identifiers of this IdentifierCreateDto. # noqa: E501 + :type: list[RelatedIdentifierCreateDto] + """ + + self._related_identifiers = related_identifiers + + 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(IdentifierCreateDto, 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, IdentifierCreateDto): + 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/swagger/api/api_identifier/models/identifier_dto.py b/swagger/api/api_identifier/models/identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..5014eb258bb12393dd9a2431e1f8a9fa5d78bc86 --- /dev/null +++ b/swagger/api/api_identifier/models/identifier_dto.py @@ -0,0 +1,705 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 IdentifierDto(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 = { + 'id': 'int', + 'cid': 'int', + 'dbid': 'int', + 'qid': 'int', + 'title': 'str', + 'description': 'str', + 'query': 'str', + 'execution': 'datetime', + 'visibility': 'str', + 'doi': 'str', + 'publisher': 'str', + 'creator': 'UserDto', + 'creators': 'list[CreatorDto]', + 'created': 'datetime', + 'query_normalized': 'str', + 'related': 'list[RelatedIdentifierDto]', + 'query_hash': 'str', + 'result_hash': 'str', + 'result_number': 'int', + 'publication_day': 'int', + 'publication_month': 'int', + 'publication_year': 'int', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'cid': 'cid', + 'dbid': 'dbid', + 'qid': 'qid', + 'title': 'title', + 'description': 'description', + 'query': 'query', + 'execution': 'execution', + 'visibility': 'visibility', + 'doi': 'doi', + 'publisher': 'publisher', + 'creator': 'creator', + 'creators': 'creators', + 'created': 'created', + 'query_normalized': 'query_normalized', + 'related': 'related', + 'query_hash': 'query_hash', + 'result_hash': 'result_hash', + 'result_number': 'result_number', + 'publication_day': 'publication_day', + 'publication_month': 'publication_month', + 'publication_year': 'publication_year', + '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, 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 + self._dbid = None + self._qid = None + self._title = None + self._description = None + self._query = None + self._execution = None + self._visibility = None + self._doi = None + self._publisher = None + self._creator = None + self._creators = None + self._created = None + self._query_normalized = None + self._related = None + self._query_hash = None + self._result_hash = None + self._result_number = None + self._publication_day = None + self._publication_month = None + self._publication_year = None + self._last_modified = None + self.discriminator = None + if id is not None: + self.id = id + self.cid = cid + self.dbid = dbid + self.qid = qid + self.title = title + self.description = description + self.query = query + self.execution = execution + 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: + self.created = created + self.query_normalized = query_normalized + if related is not None: + self.related = related + self.query_hash = query_hash + self.result_hash = result_hash + self.result_number = result_number + if publication_day is not None: + self.publication_day = publication_day + if publication_month is not None: + self.publication_month = publication_month + self.publication_year = publication_year + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this IdentifierDto. # noqa: E501 + + + :return: The id of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this IdentifierDto. + + + :param id: The id of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def cid(self): + """Gets the cid of this IdentifierDto. # noqa: E501 + + + :return: The cid of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._cid + + @cid.setter + def cid(self, cid): + """Sets the cid of this IdentifierDto. + + + :param cid: The cid of this IdentifierDto. # noqa: E501 + :type: int + """ + if cid is None: + raise ValueError("Invalid value for `cid`, must not be `None`") # noqa: E501 + + self._cid = cid + + @property + def dbid(self): + """Gets the dbid of this IdentifierDto. # noqa: E501 + + + :return: The dbid of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._dbid + + @dbid.setter + def dbid(self, dbid): + """Sets the dbid of this IdentifierDto. + + + :param dbid: The dbid of this IdentifierDto. # noqa: E501 + :type: int + """ + if dbid is None: + raise ValueError("Invalid value for `dbid`, must not be `None`") # noqa: E501 + + self._dbid = dbid + + @property + def qid(self): + """Gets the qid of this IdentifierDto. # noqa: E501 + + + :return: The qid of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._qid + + @qid.setter + def qid(self, qid): + """Sets the qid of this IdentifierDto. + + + :param qid: The qid of this IdentifierDto. # noqa: E501 + :type: int + """ + if qid is None: + raise ValueError("Invalid value for `qid`, must not be `None`") # noqa: E501 + + self._qid = qid + + @property + def title(self): + """Gets the title of this IdentifierDto. # noqa: E501 + + + :return: The title of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this IdentifierDto. + + + :param title: The title of this IdentifierDto. # noqa: E501 + :type: str + """ + if title is None: + raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501 + + self._title = title + + @property + def description(self): + """Gets the description of this IdentifierDto. # noqa: E501 + + + :return: The description of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IdentifierDto. + + + :param description: The description of this IdentifierDto. # 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 query(self): + """Gets the query of this IdentifierDto. # noqa: E501 + + + :return: The query of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this IdentifierDto. + + + :param query: The query of this IdentifierDto. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def execution(self): + """Gets the execution of this IdentifierDto. # noqa: E501 + + + :return: The execution of this IdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._execution + + @execution.setter + def execution(self, execution): + """Sets the execution of this IdentifierDto. + + + :param execution: The execution of this IdentifierDto. # noqa: E501 + :type: datetime + """ + if execution is None: + raise ValueError("Invalid value for `execution`, must not be `None`") # noqa: E501 + + self._execution = execution + + @property + def visibility(self): + """Gets the visibility of this IdentifierDto. # noqa: E501 + + + :return: The visibility of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._visibility + + @visibility.setter + def visibility(self, visibility): + """Sets the visibility of this IdentifierDto. + + + :param visibility: The visibility of this IdentifierDto. # noqa: E501 + :type: str + """ + if visibility is None: + raise ValueError("Invalid value for `visibility`, must not be `None`") # noqa: E501 + allowed_values = ["everyone", "trusted", "self"] # noqa: E501 + if visibility not in allowed_values: + raise ValueError( + "Invalid value for `visibility` ({0}), must be one of {1}" # noqa: E501 + .format(visibility, allowed_values) + ) + + self._visibility = visibility + + @property + def doi(self): + """Gets the doi of this IdentifierDto. # noqa: E501 + + + :return: The doi of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._doi + + @doi.setter + def doi(self, doi): + """Sets the doi of this IdentifierDto. + + + :param doi: The doi of this IdentifierDto. # noqa: E501 + :type: str + """ + + 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 + + + :return: The creator of this IdentifierDto. # noqa: E501 + :rtype: UserDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this IdentifierDto. + + + :param creator: The creator of this IdentifierDto. # noqa: E501 + :type: UserDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def creators(self): + """Gets the creators of this IdentifierDto. # noqa: E501 + + + :return: The creators of this IdentifierDto. # noqa: E501 + :rtype: list[CreatorDto] + """ + return self._creators + + @creators.setter + def creators(self, creators): + """Sets the creators of this IdentifierDto. + + + :param creators: The creators of this IdentifierDto. # noqa: E501 + :type: list[CreatorDto] + """ + if creators is None: + raise ValueError("Invalid value for `creators`, must not be `None`") # noqa: E501 + + self._creators = creators + + @property + def created(self): + """Gets the created of this IdentifierDto. # noqa: E501 + + + :return: The created of this IdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this IdentifierDto. + + + :param created: The created of this IdentifierDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def query_normalized(self): + """Gets the query_normalized of this IdentifierDto. # noqa: E501 + + + :return: The query_normalized of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._query_normalized + + @query_normalized.setter + def query_normalized(self, query_normalized): + """Sets the query_normalized of this IdentifierDto. + + + :param query_normalized: The query_normalized of this IdentifierDto. # noqa: E501 + :type: str + """ + if query_normalized is None: + raise ValueError("Invalid value for `query_normalized`, must not be `None`") # noqa: E501 + + self._query_normalized = query_normalized + + @property + def related(self): + """Gets the related of this IdentifierDto. # noqa: E501 + + + :return: The related of this IdentifierDto. # noqa: E501 + :rtype: list[RelatedIdentifierDto] + """ + return self._related + + @related.setter + def related(self, related): + """Sets the related of this IdentifierDto. + + + :param related: The related of this IdentifierDto. # noqa: E501 + :type: list[RelatedIdentifierDto] + """ + + self._related = related + + @property + def query_hash(self): + """Gets the query_hash of this IdentifierDto. # noqa: E501 + + query hash in sha512 # noqa: E501 + + :return: The query_hash of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._query_hash + + @query_hash.setter + def query_hash(self, query_hash): + """Sets the query_hash of this IdentifierDto. + + query hash in sha512 # noqa: E501 + + :param query_hash: The query_hash of this IdentifierDto. # noqa: E501 + :type: str + """ + if query_hash is None: + raise ValueError("Invalid value for `query_hash`, must not be `None`") # noqa: E501 + + self._query_hash = query_hash + + @property + def result_hash(self): + """Gets the result_hash of this IdentifierDto. # noqa: E501 + + + :return: The result_hash of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._result_hash + + @result_hash.setter + def result_hash(self, result_hash): + """Sets the result_hash of this IdentifierDto. + + + :param result_hash: The result_hash of this IdentifierDto. # noqa: E501 + :type: str + """ + if result_hash is None: + raise ValueError("Invalid value for `result_hash`, must not be `None`") # noqa: E501 + + self._result_hash = result_hash + + @property + def result_number(self): + """Gets the result_number of this IdentifierDto. # noqa: E501 + + + :return: The result_number of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._result_number + + @result_number.setter + def result_number(self, result_number): + """Sets the result_number of this IdentifierDto. + + + :param result_number: The result_number of this IdentifierDto. # noqa: E501 + :type: int + """ + if result_number is None: + raise ValueError("Invalid value for `result_number`, must not be `None`") # noqa: E501 + + self._result_number = result_number + + @property + def publication_day(self): + """Gets the publication_day of this IdentifierDto. # noqa: E501 + + + :return: The publication_day of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this IdentifierDto. + + + :param publication_day: The publication_day of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def publication_month(self): + """Gets the publication_month of this IdentifierDto. # noqa: E501 + + + :return: The publication_month of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this IdentifierDto. + + + :param publication_month: The publication_month of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_year(self): + """Gets the publication_year of this IdentifierDto. # noqa: E501 + + + :return: The publication_year of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this IdentifierDto. + + + :param publication_year: The publication_year of this IdentifierDto. # 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 + + @property + def last_modified(self): + """Gets the last_modified of this IdentifierDto. # noqa: E501 + + + :return: The last_modified of this IdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this IdentifierDto. + + + :param last_modified: The last_modified of this IdentifierDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + 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(IdentifierDto, 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, IdentifierDto): + 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/swagger/api/api_identifier/models/image_brief_dto.py b/swagger/api/api_identifier/models/image_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..01ecbd3489c98eb935b0b601c8bb24ce57620d40 --- /dev/null +++ b/swagger/api/api_identifier/models/image_brief_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 ImageBriefDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag' + } + + def __init__(self, id=None, repository=None, tag=None): # noqa: E501 + """ImageBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + + @property + def id(self): + """Gets the id of this ImageBriefDto. # noqa: E501 + + + :return: The id of this ImageBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageBriefDto. + + + :param id: The id of this ImageBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageBriefDto. # noqa: E501 + + + :return: The repository of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageBriefDto. + + + :param repository: The repository of this ImageBriefDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageBriefDto. # noqa: E501 + + + :return: The tag of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageBriefDto. + + + :param tag: The tag of this ImageBriefDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + 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(ImageBriefDto, 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, ImageBriefDto): + 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/swagger/api/api_identifier/models/image_date_dto.py b/swagger/api/api_identifier/models/image_date_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..7cc2600d3358f8d03faf74cba45541d353db091d --- /dev/null +++ b/swagger/api/api_identifier/models/image_date_dto.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 ImageDateDto(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 = { + 'id': 'int', + 'example': 'str', + 'database_format': 'str', + 'unix_format': 'str', + 'has_time': 'bool', + 'created_at': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'example': 'example', + 'database_format': 'database_format', + 'unix_format': 'unix_format', + 'has_time': 'has_time', + 'created_at': 'created_at' + } + + def __init__(self, id=None, example=None, database_format=None, unix_format=None, has_time=None, created_at=None): # noqa: E501 + """ImageDateDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._example = None + self._database_format = None + self._unix_format = None + self._has_time = None + self._created_at = None + self.discriminator = None + self.id = id + self.example = example + self.database_format = database_format + self.unix_format = unix_format + self.has_time = has_time + if created_at is not None: + self.created_at = created_at + + @property + def id(self): + """Gets the id of this ImageDateDto. # noqa: E501 + + + :return: The id of this ImageDateDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDateDto. + + + :param id: The id of this ImageDateDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def example(self): + """Gets the example of this ImageDateDto. # noqa: E501 + + + :return: The example of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._example + + @example.setter + def example(self, example): + """Sets the example of this ImageDateDto. + + + :param example: The example of this ImageDateDto. # noqa: E501 + :type: str + """ + if example is None: + raise ValueError("Invalid value for `example`, must not be `None`") # noqa: E501 + + self._example = example + + @property + def database_format(self): + """Gets the database_format of this ImageDateDto. # noqa: E501 + + + :return: The database_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._database_format + + @database_format.setter + def database_format(self, database_format): + """Sets the database_format of this ImageDateDto. + + + :param database_format: The database_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if database_format is None: + raise ValueError("Invalid value for `database_format`, must not be `None`") # noqa: E501 + + self._database_format = database_format + + @property + def unix_format(self): + """Gets the unix_format of this ImageDateDto. # noqa: E501 + + + :return: The unix_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._unix_format + + @unix_format.setter + def unix_format(self, unix_format): + """Sets the unix_format of this ImageDateDto. + + + :param unix_format: The unix_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if unix_format is None: + raise ValueError("Invalid value for `unix_format`, must not be `None`") # noqa: E501 + + self._unix_format = unix_format + + @property + def has_time(self): + """Gets the has_time of this ImageDateDto. # noqa: E501 + + + :return: The has_time of this ImageDateDto. # noqa: E501 + :rtype: bool + """ + return self._has_time + + @has_time.setter + def has_time(self, has_time): + """Sets the has_time of this ImageDateDto. + + + :param has_time: The has_time of this ImageDateDto. # noqa: E501 + :type: bool + """ + if has_time is None: + raise ValueError("Invalid value for `has_time`, must not be `None`") # noqa: E501 + + self._has_time = has_time + + @property + def created_at(self): + """Gets the created_at of this ImageDateDto. # noqa: E501 + + + :return: The created_at of this ImageDateDto. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ImageDateDto. + + + :param created_at: The created_at of this ImageDateDto. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + 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(ImageDateDto, 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, ImageDateDto): + 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/swagger/api/api_identifier/models/image_dto.py b/swagger/api/api_identifier/models/image_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..5df90965d940982eb2d6a8977575293529d68e6e --- /dev/null +++ b/swagger/api/api_identifier/models/image_dto.py @@ -0,0 +1,404 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 ImageDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str', + 'dialect': 'str', + 'hash': 'str', + 'compiled': 'datetime', + 'size': 'int', + 'environment': 'list[ImageEnvItemDto]', + 'driver_class': 'str', + 'date_formats': 'list[ImageDateDto]', + 'jdbc_method': 'str', + 'default_port': 'int' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag', + 'dialect': 'dialect', + 'hash': 'hash', + 'compiled': 'compiled', + 'size': 'size', + 'environment': 'environment', + 'driver_class': 'driver_class', + 'date_formats': 'date_formats', + 'jdbc_method': 'jdbc_method', + 'default_port': 'default_port' + } + + def __init__(self, id=None, repository=None, tag=None, dialect=None, hash=None, compiled=None, size=None, environment=None, driver_class=None, date_formats=None, jdbc_method=None, default_port=None): # noqa: E501 + """ImageDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self._dialect = None + self._hash = None + self._compiled = None + self._size = None + self._environment = None + self._driver_class = None + self._date_formats = None + self._jdbc_method = None + self._default_port = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + self.dialect = dialect + if hash is not None: + self.hash = hash + if compiled is not None: + self.compiled = compiled + if size is not None: + self.size = size + self.environment = environment + self.driver_class = driver_class + if date_formats is not None: + self.date_formats = date_formats + self.jdbc_method = jdbc_method + self.default_port = default_port + + @property + def id(self): + """Gets the id of this ImageDto. # noqa: E501 + + + :return: The id of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDto. + + + :param id: The id of this ImageDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageDto. # noqa: E501 + + + :return: The repository of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageDto. + + + :param repository: The repository of this ImageDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageDto. # noqa: E501 + + + :return: The tag of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageDto. + + + :param tag: The tag of this ImageDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + @property + def dialect(self): + """Gets the dialect of this ImageDto. # noqa: E501 + + + :return: The dialect of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._dialect + + @dialect.setter + def dialect(self, dialect): + """Sets the dialect of this ImageDto. + + + :param dialect: The dialect of this ImageDto. # noqa: E501 + :type: str + """ + if dialect is None: + raise ValueError("Invalid value for `dialect`, must not be `None`") # noqa: E501 + + self._dialect = dialect + + @property + def hash(self): + """Gets the hash of this ImageDto. # noqa: E501 + + + :return: The hash of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ImageDto. + + + :param hash: The hash of this ImageDto. # noqa: E501 + :type: str + """ + + self._hash = hash + + @property + def compiled(self): + """Gets the compiled of this ImageDto. # noqa: E501 + + + :return: The compiled of this ImageDto. # noqa: E501 + :rtype: datetime + """ + return self._compiled + + @compiled.setter + def compiled(self, compiled): + """Sets the compiled of this ImageDto. + + + :param compiled: The compiled of this ImageDto. # noqa: E501 + :type: datetime + """ + + self._compiled = compiled + + @property + def size(self): + """Gets the size of this ImageDto. # noqa: E501 + + + :return: The size of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this ImageDto. + + + :param size: The size of this ImageDto. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def environment(self): + """Gets the environment of this ImageDto. # noqa: E501 + + + :return: The environment of this ImageDto. # noqa: E501 + :rtype: list[ImageEnvItemDto] + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this ImageDto. + + + :param environment: The environment of this ImageDto. # noqa: E501 + :type: list[ImageEnvItemDto] + """ + if environment is None: + raise ValueError("Invalid value for `environment`, must not be `None`") # noqa: E501 + + self._environment = environment + + @property + def driver_class(self): + """Gets the driver_class of this ImageDto. # noqa: E501 + + + :return: The driver_class of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._driver_class + + @driver_class.setter + def driver_class(self, driver_class): + """Sets the driver_class of this ImageDto. + + + :param driver_class: The driver_class of this ImageDto. # noqa: E501 + :type: str + """ + if driver_class is None: + raise ValueError("Invalid value for `driver_class`, must not be `None`") # noqa: E501 + + self._driver_class = driver_class + + @property + def date_formats(self): + """Gets the date_formats of this ImageDto. # noqa: E501 + + + :return: The date_formats of this ImageDto. # noqa: E501 + :rtype: list[ImageDateDto] + """ + return self._date_formats + + @date_formats.setter + def date_formats(self, date_formats): + """Sets the date_formats of this ImageDto. + + + :param date_formats: The date_formats of this ImageDto. # noqa: E501 + :type: list[ImageDateDto] + """ + + self._date_formats = date_formats + + @property + def jdbc_method(self): + """Gets the jdbc_method of this ImageDto. # noqa: E501 + + + :return: The jdbc_method of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._jdbc_method + + @jdbc_method.setter + def jdbc_method(self, jdbc_method): + """Sets the jdbc_method of this ImageDto. + + + :param jdbc_method: The jdbc_method of this ImageDto. # noqa: E501 + :type: str + """ + if jdbc_method is None: + raise ValueError("Invalid value for `jdbc_method`, must not be `None`") # noqa: E501 + + self._jdbc_method = jdbc_method + + @property + def default_port(self): + """Gets the default_port of this ImageDto. # noqa: E501 + + + :return: The default_port of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._default_port + + @default_port.setter + def default_port(self, default_port): + """Sets the default_port of this ImageDto. + + + :param default_port: The default_port of this ImageDto. # noqa: E501 + :type: int + """ + if default_port is None: + raise ValueError("Invalid value for `default_port`, must not be `None`") # noqa: E501 + + self._default_port = default_port + + 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(ImageDto, 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, ImageDto): + 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/swagger/api/api_identifier/models/image_env_item_dto.py b/swagger/api/api_identifier/models/image_env_item_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..d57bcd016227638defc32e968b0ccb68f157dfef --- /dev/null +++ b/swagger/api/api_identifier/models/image_env_item_dto.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 ImageEnvItemDto(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 = { + 'iid': 'int', + 'key': 'str', + 'value': 'str', + 'type': 'str' + } + + attribute_map = { + 'iid': 'iid', + 'key': 'key', + 'value': 'value', + 'type': 'type' + } + + def __init__(self, iid=None, key=None, value=None, type=None): # noqa: E501 + """ImageEnvItemDto - a model defined in Swagger""" # noqa: E501 + self._iid = None + self._key = None + self._value = None + self._type = None + self.discriminator = None + self.iid = iid + self.key = key + self.value = value + self.type = type + + @property + def iid(self): + """Gets the iid of this ImageEnvItemDto. # noqa: E501 + + + :return: The iid of this ImageEnvItemDto. # noqa: E501 + :rtype: int + """ + return self._iid + + @iid.setter + def iid(self, iid): + """Sets the iid of this ImageEnvItemDto. + + + :param iid: The iid of this ImageEnvItemDto. # noqa: E501 + :type: int + """ + if iid is None: + raise ValueError("Invalid value for `iid`, must not be `None`") # noqa: E501 + + self._iid = iid + + @property + def key(self): + """Gets the key of this ImageEnvItemDto. # noqa: E501 + + + :return: The key of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this ImageEnvItemDto. + + + :param key: The key of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if key is None: + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value(self): + """Gets the value of this ImageEnvItemDto. # noqa: E501 + + + :return: The value of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ImageEnvItemDto. + + + :param value: The value of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this ImageEnvItemDto. # noqa: E501 + + + :return: The type of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ImageEnvItemDto. + + + :param type: The type of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["username", "password", "privileged_username", "privileged_password"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + 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(ImageEnvItemDto, 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, ImageEnvItemDto): + 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/swagger/api/api_identifier/models/license_dto.py b/swagger/api/api_identifier/models/license_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ba76e7943f88a671b03942b7966ead846ef7f599 --- /dev/null +++ b/swagger/api/api_identifier/models/license_dto.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 LicenseDto(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 = { + 'identifier': 'str', + 'uri': 'str' + } + + attribute_map = { + 'identifier': 'identifier', + 'uri': 'uri' + } + + def __init__(self, identifier=None, uri=None): # noqa: E501 + """LicenseDto - a model defined in Swagger""" # noqa: E501 + self._identifier = None + self._uri = None + self.discriminator = None + self.identifier = identifier + self.uri = uri + + @property + def identifier(self): + """Gets the identifier of this LicenseDto. # noqa: E501 + + + :return: The identifier of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this LicenseDto. + + + :param identifier: The identifier of this LicenseDto. # noqa: E501 + :type: str + """ + if identifier is None: + raise ValueError("Invalid value for `identifier`, must not be `None`") # noqa: E501 + + self._identifier = identifier + + @property + def uri(self): + """Gets the uri of this LicenseDto. # noqa: E501 + + + :return: The uri of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this LicenseDto. + + + :param uri: The uri of this LicenseDto. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + 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(LicenseDto, 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, LicenseDto): + 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/swagger/api/api_identifier/models/related_identifier_create_dto.py b/swagger/api/api_identifier/models/related_identifier_create_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..595f92c87056bb46a762d3b6c403c926071a093d --- /dev/null +++ b/swagger/api/api_identifier/models/related_identifier_create_dto.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 RelatedIdentifierCreateDto(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 = { + 'value': 'str', + 'type': 'str', + 'relation': 'str' + } + + attribute_map = { + 'value': 'value', + 'type': 'type', + 'relation': 'relation' + } + + def __init__(self, value=None, type=None, relation=None): # noqa: E501 + """RelatedIdentifierCreateDto - a model defined in Swagger""" # noqa: E501 + self._value = None + self._type = None + self._relation = None + self.discriminator = None + self.value = value + if type is not None: + self.type = type + if relation is not None: + self.relation = relation + + @property + def value(self): + """Gets the value of this RelatedIdentifierCreateDto. # noqa: E501 + + + :return: The value of this RelatedIdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this RelatedIdentifierCreateDto. + + + :param value: The value of this RelatedIdentifierCreateDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this RelatedIdentifierCreateDto. # noqa: E501 + + + :return: The type of this RelatedIdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this RelatedIdentifierCreateDto. + + + :param type: The type of this RelatedIdentifierCreateDto. # noqa: E501 + :type: str + """ + allowed_values = ["DOI", "URL", "URN", "ARK", "arXiv", "bibcode", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "w3id"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def relation(self): + """Gets the relation of this RelatedIdentifierCreateDto. # noqa: E501 + + + :return: The relation of this RelatedIdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._relation + + @relation.setter + def relation(self, relation): + """Sets the relation of this RelatedIdentifierCreateDto. + + + :param relation: The relation of this RelatedIdentifierCreateDto. # noqa: E501 + :type: str + """ + allowed_values = ["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "IsDescribedBy", "Describes", "HasMetadata", "IsMetadataFor", "HasVersion", "IsVersionOf", "IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsPublishedIn", "IsReferencedBy", "References", "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf", "IsRequiredBy", "Requires", "IsObsoletedBy", "Obsoletes"] # noqa: E501 + if relation not in allowed_values: + raise ValueError( + "Invalid value for `relation` ({0}), must be one of {1}" # noqa: E501 + .format(relation, allowed_values) + ) + + self._relation = relation + + 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(RelatedIdentifierCreateDto, 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, RelatedIdentifierCreateDto): + 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/swagger/api/api_identifier/models/related_identifier_dto.py b/swagger/api/api_identifier/models/related_identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..2d266227abb8fee7a15dfb0e9b7a86711b25b056 --- /dev/null +++ b/swagger/api/api_identifier/models/related_identifier_dto.py @@ -0,0 +1,281 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 RelatedIdentifierDto(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 = { + 'id': 'int', + 'value': 'str', + 'type': 'str', + 'relation': 'str', + 'created': 'datetime', + 'deleted': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'value': 'value', + 'type': 'type', + 'relation': 'relation', + 'created': 'created', + 'deleted': 'deleted', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, value=None, type=None, relation=None, created=None, deleted=None, last_modified=None): # noqa: E501 + """RelatedIdentifierDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._value = None + self._type = None + self._relation = None + self._created = None + self._deleted = None + self._last_modified = None + self.discriminator = None + self.id = id + self.value = value + if type is not None: + self.type = type + if relation is not None: + self.relation = relation + self.created = created + if deleted is not None: + self.deleted = deleted + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this RelatedIdentifierDto. # noqa: E501 + + + :return: The id of this RelatedIdentifierDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this RelatedIdentifierDto. + + + :param id: The id of this RelatedIdentifierDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def value(self): + """Gets the value of this RelatedIdentifierDto. # noqa: E501 + + + :return: The value of this RelatedIdentifierDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this RelatedIdentifierDto. + + + :param value: The value of this RelatedIdentifierDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this RelatedIdentifierDto. # noqa: E501 + + + :return: The type of this RelatedIdentifierDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this RelatedIdentifierDto. + + + :param type: The type of this RelatedIdentifierDto. # noqa: E501 + :type: str + """ + allowed_values = ["DOI", "URL", "URN", "ARK", "arXiv", "bibcode", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "w3id"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def relation(self): + """Gets the relation of this RelatedIdentifierDto. # noqa: E501 + + + :return: The relation of this RelatedIdentifierDto. # noqa: E501 + :rtype: str + """ + return self._relation + + @relation.setter + def relation(self, relation): + """Sets the relation of this RelatedIdentifierDto. + + + :param relation: The relation of this RelatedIdentifierDto. # noqa: E501 + :type: str + """ + allowed_values = ["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "IsDescribedBy", "Describes", "HasMetadata", "IsMetadataFor", "HasVersion", "IsVersionOf", "IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsPublishedIn", "IsReferencedBy", "References", "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf", "IsRequiredBy", "Requires", "IsObsoletedBy", "Obsoletes"] # noqa: E501 + if relation not in allowed_values: + raise ValueError( + "Invalid value for `relation` ({0}), must be one of {1}" # noqa: E501 + .format(relation, allowed_values) + ) + + self._relation = relation + + @property + def created(self): + """Gets the created of this RelatedIdentifierDto. # noqa: E501 + + + :return: The created of this RelatedIdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this RelatedIdentifierDto. + + + :param created: The created of this RelatedIdentifierDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def deleted(self): + """Gets the deleted of this RelatedIdentifierDto. # noqa: E501 + + + :return: The deleted of this RelatedIdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this RelatedIdentifierDto. + + + :param deleted: The deleted of this RelatedIdentifierDto. # noqa: E501 + :type: datetime + """ + + self._deleted = deleted + + @property + def last_modified(self): + """Gets the last_modified of this RelatedIdentifierDto. # noqa: E501 + + + :return: The last_modified of this RelatedIdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this RelatedIdentifierDto. + + + :param last_modified: The last_modified of this RelatedIdentifierDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + 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(RelatedIdentifierDto, 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, RelatedIdentifierDto): + 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/swagger/api/api_identifier/models/table_brief_dto.py b/swagger/api/api_identifier/models/table_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..c3dec21e2b91d4e51ce8fc59ba64b427142bdae8 --- /dev/null +++ b/swagger/api/api_identifier/models/table_brief_dto.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 TableBriefDto(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 = { + 'id': 'int', + 'name': 'str', + 'creator': 'UserBriefDto', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator': 'creator', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + """TableBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._creator = None + self._internal_name = None + self.discriminator = None + self.id = id + self.name = name + self.creator = creator + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this TableBriefDto. # noqa: E501 + + + :return: The id of this TableBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TableBriefDto. + + + :param id: The id of this TableBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this TableBriefDto. # noqa: E501 + + + :return: The name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TableBriefDto. + + + :param name: The name of this TableBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this TableBriefDto. # noqa: E501 + + + :return: The creator of this TableBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this TableBriefDto. + + + :param creator: The creator of this TableBriefDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def internal_name(self): + """Gets the internal_name of this TableBriefDto. # noqa: E501 + + + :return: The internal_name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this TableBriefDto. + + + :param internal_name: The internal_name of this TableBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(TableBriefDto, 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, TableBriefDto): + 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/swagger/api/api_identifier/models/user_brief_dto.py b/swagger/api/api_identifier/models/user_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..2c331dde9093c6a77468dc93b938d670e58d267d --- /dev/null +++ b/swagger/api/api_identifier/models/user_brief_dto.py @@ -0,0 +1,350 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 UserBriefDto(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 = { + 'id': 'int', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserBriefDto. # noqa: E501 + + + :return: The id of this UserBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserBriefDto. + + + :param id: The id of this UserBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def username(self): + """Gets the username of this UserBriefDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserBriefDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserBriefDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserBriefDto. # noqa: E501 + + + :return: The firstname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserBriefDto. + + + :param firstname: The firstname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserBriefDto. # noqa: E501 + + + :return: The lastname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserBriefDto. + + + :param lastname: The lastname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserBriefDto. # noqa: E501 + + + :return: The affiliation of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserBriefDto. + + + :param affiliation: The affiliation of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserBriefDto. # noqa: E501 + + + :return: The orcid of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserBriefDto. + + + :param orcid: The orcid of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserBriefDto. # noqa: E501 + + + :return: The theme_dark of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserBriefDto. + + + :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserBriefDto. # noqa: E501 + + + :return: The email_verified of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserBriefDto. + + + :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserBriefDto, 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, UserBriefDto): + 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/swagger/api/api_identifier/models/user_dto.py b/swagger/api/api_identifier/models/user_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..882cb85a7d297c121498fb7d8d6c38e5d0dfdca9 --- /dev/null +++ b/swagger/api/api_identifier/models/user_dto.py @@ -0,0 +1,481 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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 UserDto(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 = { + 'id': 'int', + 'authorities': 'list[GrantedAuthorityDto]', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'containers': 'list[ContainerDto]', + 'databases': 'list[ContainerDto]', + 'identifiers': 'list[ContainerDto]', + 'email': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'authorities': 'authorities', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'containers': 'containers', + 'databases': 'databases', + 'identifiers': 'identifiers', + 'email': 'email', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._authorities = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._containers = None + self._databases = None + self._identifiers = None + self._email = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + if authorities is not None: + self.authorities = authorities + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if containers is not None: + self.containers = containers + if databases is not None: + self.databases = databases + if identifiers is not None: + self.identifiers = identifiers + self.email = email + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserDto. # noqa: E501 + + + :return: The id of this UserDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserDto. + + + :param id: The id of this UserDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def authorities(self): + """Gets the authorities of this UserDto. # noqa: E501 + + + :return: The authorities of this UserDto. # noqa: E501 + :rtype: list[GrantedAuthorityDto] + """ + return self._authorities + + @authorities.setter + def authorities(self, authorities): + """Sets the authorities of this UserDto. + + + :param authorities: The authorities of this UserDto. # noqa: E501 + :type: list[GrantedAuthorityDto] + """ + + self._authorities = authorities + + @property + def username(self): + """Gets the username of this UserDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserDto. # noqa: E501 + + + :return: The firstname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserDto. + + + :param firstname: The firstname of this UserDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserDto. # noqa: E501 + + + :return: The lastname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserDto. + + + :param lastname: The lastname of this UserDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserDto. # noqa: E501 + + + :return: The affiliation of this UserDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserDto. + + + :param affiliation: The affiliation of this UserDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserDto. # noqa: E501 + + + :return: The orcid of this UserDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserDto. + + + :param orcid: The orcid of this UserDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def containers(self): + """Gets the containers of this UserDto. # noqa: E501 + + + :return: The containers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._containers + + @containers.setter + def containers(self, containers): + """Sets the containers of this UserDto. + + + :param containers: The containers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._containers = containers + + @property + def databases(self): + """Gets the databases of this UserDto. # noqa: E501 + + + :return: The databases of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this UserDto. + + + :param databases: The databases of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._databases = databases + + @property + def identifiers(self): + """Gets the identifiers of this UserDto. # noqa: E501 + + + :return: The identifiers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._identifiers + + @identifiers.setter + def identifiers(self, identifiers): + """Sets the identifiers of this UserDto. + + + :param identifiers: The identifiers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._identifiers = identifiers + + @property + def email(self): + """Gets the email of this UserDto. # noqa: E501 + + + :return: The email of this UserDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserDto. + + + :param email: The email of this UserDto. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def titles_before(self): + """Gets the titles_before of this UserDto. # noqa: E501 + + + :return: The titles_before of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserDto. + + + :param titles_before: The titles_before of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserDto. # noqa: E501 + + + :return: The titles_after of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserDto. + + + :param titles_after: The titles_after of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserDto. # noqa: E501 + + + :return: The theme_dark of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserDto. + + + :param theme_dark: The theme_dark of this UserDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserDto. # noqa: E501 + + + :return: The email_verified of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserDto. + + + :param email_verified: The email_verified of this UserDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserDto, 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, UserDto): + 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/swagger/api/api_identifier/rest.py b/swagger/api/api_identifier/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..8033a0a8072fadbcf7c49c3dc9fdac1e2f00fd8c --- /dev/null +++ b/swagger/api/api_identifier/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Identifier Service API + + Service that manages the identifiers # 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/swagger/api/api_query/__init__.py b/swagger/api/api_query/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..142aed7fbc0ce87c14d0410efc89eb10a809f156 --- /dev/null +++ b/swagger/api/api_query/__init__.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.api.export_endpoint_api import ExportEndpointApi +from api_query.api.query_endpoint_api import QueryEndpointApi +from api_query.api.store_endpoint_api import StoreEndpointApi +from api_query.api.table_data_endpoint_api import TableDataEndpointApi +from api_query.api.table_history_endpoint_api import TableHistoryEndpointApi +# import ApiClient +from api_query.api_client import ApiClient +from api_query.configuration import Configuration +# import models into sdk package +from api_query.models.api_error_dto import ApiErrorDto +from api_query.models.container_dto import ContainerDto +from api_query.models.database_dto import DatabaseDto +from api_query.models.execute_statement_dto import ExecuteStatementDto +from api_query.models.granted_authority_dto import GrantedAuthorityDto +from api_query.models.image_brief_dto import ImageBriefDto +from api_query.models.image_date_dto import ImageDateDto +from api_query.models.image_dto import ImageDto +from api_query.models.image_env_item_dto import ImageEnvItemDto +from api_query.models.import_dto import ImportDto +from api_query.models.license_dto import LicenseDto +from api_query.models.query_brief_dto import QueryBriefDto +from api_query.models.query_dto import QueryDto +from api_query.models.query_result_dto import QueryResultDto +from api_query.models.table_brief_dto import TableBriefDto +from api_query.models.table_csv_delete_dto import TableCsvDeleteDto +from api_query.models.table_csv_dto import TableCsvDto +from api_query.models.table_csv_update_dto import TableCsvUpdateDto +from api_query.models.table_history_dto import TableHistoryDto +from api_query.models.user_brief_dto import UserBriefDto +from api_query.models.user_dto import UserDto diff --git a/swagger/api/api_query/api/__init__.py b/swagger/api/api_query/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b644b1438d02bcc510ef2c6c6cb3b93b50d5b76b --- /dev/null +++ b/swagger/api/api_query/api/__init__.py @@ -0,0 +1,10 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_query.api.export_endpoint_api import ExportEndpointApi +from api_query.api.query_endpoint_api import QueryEndpointApi +from api_query.api.store_endpoint_api import StoreEndpointApi +from api_query.api.table_data_endpoint_api import TableDataEndpointApi +from api_query.api.table_history_endpoint_api import TableHistoryEndpointApi diff --git a/swagger/api/api_query/api/export_endpoint_api.py b/swagger/api/api_query/api/export_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..6f67efb590901b2a7b7df3225614dbadb41a345b --- /dev/null +++ b/swagger/api/api_query/api/export_endpoint_api.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.api_client import ApiClient + + +class ExportEndpointApi(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 export(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Export table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.export(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param datetime timestamp: + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.export_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.export_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def export_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Export table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.export_with_http_info(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param datetime timestamp: + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_id', 'timestamp'] # 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 export" % key + ) + params[key] = val + del params['kwargs'] + # 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 `export`") # 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 `export`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `export`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + if 'timestamp' in params: + query_params.append(('timestamp', params['timestamp'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}/export', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # 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/swagger/api/api_query/api/query_endpoint_api.py b/swagger/api/api_query/api/query_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..a49f8443f997528fac0ab0a110305f7a7799b7dd --- /dev/null +++ b/swagger/api/api_query/api/query_endpoint_api.py @@ -0,0 +1,380 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.api_client import ApiClient + + +class QueryEndpointApi(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 execute(self, body, id, database_id, **kwargs): # noqa: E501 + """Execute query # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ExecuteStatementDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.execute_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.execute_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + return data + + def execute_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 + """Execute query # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.execute_with_http_info(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ExecuteStatementDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id', 'database_id', 'page', 'size'] # 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 execute" % 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 `execute`") # 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 `execute`") # 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 `execute`") # 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 = [] + if 'page' in params: + query_params.append(('page', params['page'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + + 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}/query', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QueryResultDto', # 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 export1(self, id, database_id, query_id, **kwargs): # noqa: E501 + """Exports some query # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.export1(id, database_id, query_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int query_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.export1_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + else: + (data) = self.export1_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + return data + + def export1_with_http_info(self, id, database_id, query_id, **kwargs): # noqa: E501 + """Exports some query # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.export1_with_http_info(id, database_id, query_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int query_id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'query_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 export1" % key + ) + params[key] = val + del params['kwargs'] + # 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 `export1`") # 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 `export1`") # noqa: E501 + # verify the required parameter 'query_id' is set + if ('query_id' not in params or + params['query_id'] is None): + raise ValueError("Missing the required parameter `query_id` when calling `export1`") # 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 + if 'query_id' in params: + path_params['queryId'] = params['query_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/query/{queryId}/export', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # 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 re_execute(self, id, database_id, query_id, **kwargs): # noqa: E501 + """Re-execute some query # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.re_execute(id, database_id, query_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int query_id: (required) + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.re_execute_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + else: + (data) = self.re_execute_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + return data + + def re_execute_with_http_info(self, id, database_id, query_id, **kwargs): # noqa: E501 + """Re-execute some query # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.re_execute_with_http_info(id, database_id, query_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int query_id: (required) + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'query_id', 'page', 'size'] # 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 re_execute" % key + ) + params[key] = val + del params['kwargs'] + # 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 `re_execute`") # 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 `re_execute`") # noqa: E501 + # verify the required parameter 'query_id' is set + if ('query_id' not in params or + params['query_id'] is None): + raise ValueError("Missing the required parameter `query_id` when calling `re_execute`") # 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 + if 'query_id' in params: + path_params['queryId'] = params['query_id'] # noqa: E501 + + query_params = [] + if 'page' in params: + query_params.append(('page', params['page'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/query/{queryId}/data', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QueryResultDto', # 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/swagger/api/api_query/api/store_endpoint_api.py b/swagger/api/api_query/api/store_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..7915be349dad83de0d555cddfb224ae58b6b36fa --- /dev/null +++ b/swagger/api/api_query/api/store_endpoint_api.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.api_client import ApiClient + + +class StoreEndpointApi(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 find(self, id, database_id, query_id, **kwargs): # noqa: E501 + """Find some query # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find(id, database_id, query_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int query_id: (required) + :return: QueryDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + else: + (data) = self.find_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + return data + + def find_with_http_info(self, id, database_id, query_id, **kwargs): # noqa: E501 + """Find some query # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_with_http_info(id, database_id, query_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int query_id: (required) + :return: QueryDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'query_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 find" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find`") # 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 `find`") # noqa: E501 + # verify the required parameter 'query_id' is set + if ('query_id' not in params or + params['query_id'] is None): + raise ValueError("Missing the required parameter `query_id` when calling `find`") # 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 + if 'query_id' in params: + path_params['queryId'] = params['query_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/query/{queryId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QueryDto', # 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 find_all(self, id, database_id, **kwargs): # noqa: E501 + """Find queries # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: list[QueryBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + return data + + def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Find queries # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all_with_http_info(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: list[QueryBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_all" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_all`") # 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 `find_all`") # 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 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/query', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[QueryBriefDto]', # 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/swagger/api/api_query/api/table_data_endpoint_api.py b/swagger/api/api_query/api/table_data_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..8f34b37dacac4db3543dd2def4951d0d24501b87 --- /dev/null +++ b/swagger/api/api_query/api/table_data_endpoint_api.py @@ -0,0 +1,759 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.api_client import ApiClient + + +class TableDataEndpointApi(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 delete(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + """Delete data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete(body, id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TableCsvDeleteDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def delete_with_http_info(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + """Delete data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_with_http_info(body, id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TableCsvDeleteDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id', 'database_id', 'table_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 delete" % 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 `delete`") # 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 `delete`") # 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 `delete`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `delete`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_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}/table/{tableId}/data', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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 get_all2(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Find data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all2(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param datetime timestamp: + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all2_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.get_all2_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def get_all2_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Find data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all2_with_http_info(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param datetime timestamp: + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_id', 'timestamp', 'page', 'size'] # 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 get_all2" % key + ) + params[key] = val + del params['kwargs'] + # 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 `get_all2`") # 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 `get_all2`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `get_all2`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + if 'timestamp' in params: + query_params.append(('timestamp', params['timestamp'])) # noqa: E501 + if 'page' in params: + query_params.append(('page', params['page'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QueryResultDto', # 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 get_all3(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Find data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all3(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param datetime timestamp: + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all3_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.get_all3_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def get_all3_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Find data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all3_with_http_info(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param datetime timestamp: + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_id', 'timestamp', 'page', 'size'] # 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 get_all3" % key + ) + params[key] = val + del params['kwargs'] + # 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 `get_all3`") # 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 `get_all3`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `get_all3`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + if 'timestamp' in params: + query_params.append(('timestamp', params['timestamp'])) # noqa: E501 + if 'page' in params: + query_params.append(('page', params['page'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'HEAD', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QueryResultDto', # 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 import_csv(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + """Insert data from csv # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.import_csv(body, id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ImportDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_csv_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.import_csv_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def import_csv_with_http_info(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + """Insert data from csv # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.import_csv_with_http_info(body, id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ImportDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id', 'database_id', 'table_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 import_csv" % 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 `import_csv`") # 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 `import_csv`") # 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 `import_csv`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `import_csv`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_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}/table/{tableId}/data/import', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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 insert(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + """Insert data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.insert(body, id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TableCsvDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.insert_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.insert_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def insert_with_http_info(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + """Insert data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.insert_with_http_info(body, id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TableCsvDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id', 'database_id', 'table_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 insert" % 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 `insert`") # 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 `insert`") # 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 `insert`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `insert`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_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}/table/{tableId}/data', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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, table_id, **kwargs): # noqa: E501 + """Update data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(body, id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TableCsvUpdateDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def update_with_http_info(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + """Update data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_with_http_info(body, id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TableCsvUpdateDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id', 'database_id', 'table_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 update" % 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 `update`") # 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 `update`") # 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 `update`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `update`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_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}/table/{tableId}/data', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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/swagger/api/api_query/api/table_history_endpoint_api.py b/swagger/api/api_query/api/table_history_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..024816773f5d4328cc00116d9c298b48cd860fc9 --- /dev/null +++ b/swagger/api/api_query/api/table_history_endpoint_api.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.api_client import ApiClient + + +class TableHistoryEndpointApi(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 get_all(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Find all history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: list[TableHistoryDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.get_all_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def get_all_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Find all history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_with_http_info(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: list[TableHistoryDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_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 get_all" % key + ) + params[key] = val + del params['kwargs'] + # 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 `get_all`") # 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 `get_all`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `get_all`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[TableHistoryDto]', # 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 get_all1(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Find all history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all1(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: list[TableHistoryDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all1_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.get_all1_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def get_all1_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Find all history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all1_with_http_info(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: list[TableHistoryDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_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 get_all1" % key + ) + params[key] = val + del params['kwargs'] + # 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 `get_all1`") # 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 `get_all1`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `get_all1`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}/history', 'HEAD', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[TableHistoryDto]', # 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/swagger/api/api_query/api/view_endpoint_api.py b/swagger/api/api_query/api/view_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..7443e08e6e79b141ac1634866ab6cb4910b0154d --- /dev/null +++ b/swagger/api/api_query/api/view_endpoint_api.py @@ -0,0 +1,473 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.api_client import ApiClient + + +class ViewEndpointApi(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 create(self, body, id, database_id, **kwargs): # noqa: E501 + """Create a view # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ViewCreateDto body: (required) + :param int id: (required) + :param int database_id: (required) + :return: ViewBriefDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.create_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + return data + + def create_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 + """Create a view # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_with_http_info(body, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ViewCreateDto body: (required) + :param int id: (required) + :param int database_id: (required) + :return: ViewBriefDto + 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 create" % 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 `create`") # 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 `create`") # 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 `create`") # 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}/view', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ViewBriefDto', # 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 data(self, id, database_id, view_id, **kwargs): # noqa: E501 + """Find view data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.data(id, database_id, view_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int view_id: (required) + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.data_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 + else: + (data) = self.data_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 + return data + + def data_with_http_info(self, id, database_id, view_id, **kwargs): # noqa: E501 + """Find view data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.data_with_http_info(id, database_id, view_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int view_id: (required) + :param int page: + :param int size: + :return: QueryResultDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'view_id', 'page', 'size'] # 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 data" % key + ) + params[key] = val + del params['kwargs'] + # 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 `data`") # 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 `data`") # noqa: E501 + # verify the required parameter 'view_id' is set + if ('view_id' not in params or + params['view_id'] is None): + raise ValueError("Missing the required parameter `view_id` when calling `data`") # 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 + if 'view_id' in params: + path_params['viewId'] = params['view_id'] # noqa: E501 + + query_params = [] + if 'page' in params: + query_params.append(('page', params['page'])) # noqa: E501 + if 'size' in params: + query_params.append(('size', params['size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/view/{viewId}/data', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QueryResultDto', # 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 find_all(self, id, database_id, **kwargs): # noqa: E501 + """Find all views # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: list[ViewBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + return data + + def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Find all views # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all_with_http_info(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: list[ViewBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_all" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_all`") # 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 `find_all`") # 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 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/view', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ViewBriefDto]', # 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 find_all1(self, id, database_id, view_id, **kwargs): # noqa: E501 + """Find one view # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all1(id, database_id, view_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int view_id: (required) + :return: ViewDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all1_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 + else: + (data) = self.find_all1_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 + return data + + def find_all1_with_http_info(self, id, database_id, view_id, **kwargs): # noqa: E501 + """Find one view # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all1_with_http_info(id, database_id, view_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int view_id: (required) + :return: ViewDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'view_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 find_all1" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_all1`") # 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 `find_all1`") # noqa: E501 + # verify the required parameter 'view_id' is set + if ('view_id' not in params or + params['view_id'] is None): + raise ValueError("Missing the required parameter `view_id` when calling `find_all1`") # 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 + if 'view_id' in params: + path_params['viewId'] = params['view_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/view/{viewId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ViewDto', # 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/swagger/api/api_query/api_client.py b/swagger/api/api_query/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..170ae02e07218bf4de3d47d831e7686fc0c30b7d --- /dev/null +++ b/swagger/api/api_query/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.configuration import Configuration +import api_query.models +from api_query 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_query.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/swagger/api/api_query/configuration.py b/swagger/api/api_query/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..2991fff8bf4bb94a0f13898b2c1332ee3644ca45 --- /dev/null +++ b/swagger/api/api_query/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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_query") + 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/swagger/api/api_query/models/__init__.py b/swagger/api/api_query/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5e2e453915e8343aea08ee1f42c29abad0538f06 --- /dev/null +++ b/swagger/api/api_query/models/__init__.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Query Service API + + Service that manages the queries # 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_query.models.api_error_dto import ApiErrorDto +from api_query.models.container_dto import ContainerDto +from api_query.models.database_dto import DatabaseDto +from api_query.models.execute_statement_dto import ExecuteStatementDto +from api_query.models.granted_authority_dto import GrantedAuthorityDto +from api_query.models.image_brief_dto import ImageBriefDto +from api_query.models.image_date_dto import ImageDateDto +from api_query.models.image_dto import ImageDto +from api_query.models.image_env_item_dto import ImageEnvItemDto +from api_query.models.import_dto import ImportDto +from api_query.models.license_dto import LicenseDto +from api_query.models.query_brief_dto import QueryBriefDto +from api_query.models.query_dto import QueryDto +from api_query.models.query_result_dto import QueryResultDto +from api_query.models.table_brief_dto import TableBriefDto +from api_query.models.table_csv_delete_dto import TableCsvDeleteDto +from api_query.models.table_csv_dto import TableCsvDto +from api_query.models.table_csv_update_dto import TableCsvUpdateDto +from api_query.models.table_history_dto import TableHistoryDto +from api_query.models.user_brief_dto import UserBriefDto +from api_query.models.user_dto import UserDto diff --git a/swagger/api/api_query/models/api_error_dto.py b/swagger/api/api_query/models/api_error_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..d873b7d260a3216d012bde69351ddd5d9756d22d --- /dev/null +++ b/swagger/api/api_query/models/api_error_dto.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ApiErrorDto(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 = { + 'status': 'str', + 'message': 'str', + 'code': 'str' + } + + attribute_map = { + 'status': 'status', + 'message': 'message', + 'code': 'code' + } + + def __init__(self, status=None, message=None, code=None): # noqa: E501 + """ApiErrorDto - a model defined in Swagger""" # noqa: E501 + self._status = None + self._message = None + self._code = None + self.discriminator = None + self.status = status + self.message = message + self.code = code + + @property + def status(self): + """Gets the status of this ApiErrorDto. # noqa: E501 + + + :return: The status of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ApiErrorDto. + + + :param status: The status of this ApiErrorDto. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["100 CONTINUE", "101 SWITCHING_PROTOCOLS", "102 PROCESSING", "103 CHECKPOINT", "200 OK", "201 CREATED", "202 ACCEPTED", "203 NON_AUTHORITATIVE_INFORMATION", "204 NO_CONTENT", "205 RESET_CONTENT", "206 PARTIAL_CONTENT", "207 MULTI_STATUS", "208 ALREADY_REPORTED", "226 IM_USED", "300 MULTIPLE_CHOICES", "301 MOVED_PERMANENTLY", "302 FOUND", "302 MOVED_TEMPORARILY", "303 SEE_OTHER", "304 NOT_MODIFIED", "305 USE_PROXY", "307 TEMPORARY_REDIRECT", "308 PERMANENT_REDIRECT", "400 BAD_REQUEST", "401 UNAUTHORIZED", "402 PAYMENT_REQUIRED", "403 FORBIDDEN", "404 NOT_FOUND", "405 METHOD_NOT_ALLOWED", "406 NOT_ACCEPTABLE", "407 PROXY_AUTHENTICATION_REQUIRED", "408 REQUEST_TIMEOUT", "409 CONFLICT", "410 GONE", "411 LENGTH_REQUIRED", "412 PRECONDITION_FAILED", "413 PAYLOAD_TOO_LARGE", "413 REQUEST_ENTITY_TOO_LARGE", "414 URI_TOO_LONG", "414 REQUEST_URI_TOO_LONG", "415 UNSUPPORTED_MEDIA_TYPE", "416 REQUESTED_RANGE_NOT_SATISFIABLE", "417 EXPECTATION_FAILED", "418 I_AM_A_TEAPOT", "419 INSUFFICIENT_SPACE_ON_RESOURCE", "420 METHOD_FAILURE", "421 DESTINATION_LOCKED", "422 UNPROCESSABLE_ENTITY", "423 LOCKED", "424 FAILED_DEPENDENCY", "425 TOO_EARLY", "426 UPGRADE_REQUIRED", "428 PRECONDITION_REQUIRED", "429 TOO_MANY_REQUESTS", "431 REQUEST_HEADER_FIELDS_TOO_LARGE", "451 UNAVAILABLE_FOR_LEGAL_REASONS", "500 INTERNAL_SERVER_ERROR", "501 NOT_IMPLEMENTED", "502 BAD_GATEWAY", "503 SERVICE_UNAVAILABLE", "504 GATEWAY_TIMEOUT", "505 HTTP_VERSION_NOT_SUPPORTED", "506 VARIANT_ALSO_NEGOTIATES", "507 INSUFFICIENT_STORAGE", "508 LOOP_DETECTED", "509 BANDWIDTH_LIMIT_EXCEEDED", "510 NOT_EXTENDED", "511 NETWORK_AUTHENTICATION_REQUIRED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def message(self): + """Gets the message of this ApiErrorDto. # noqa: E501 + + + :return: The message of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiErrorDto. + + + :param message: The message of this ApiErrorDto. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def code(self): + """Gets the code of this ApiErrorDto. # noqa: E501 + + + :return: The code of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiErrorDto. + + + :param code: The code of this ApiErrorDto. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + 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(ApiErrorDto, 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, ApiErrorDto): + 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/swagger/api/api_query/models/container_dto.py b/swagger/api/api_query/models/container_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..2869b35048a30bc5d5a0afe173526c738885301e --- /dev/null +++ b/swagger/api/api_query/models/container_dto.py @@ -0,0 +1,355 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ContainerDto(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 = { + 'id': 'int', + 'hash': 'str', + 'name': 'str', + 'state': 'str', + 'databases': 'list[DatabaseDto]', + 'image': 'ImageBriefDto', + 'port': 'int', + 'created': 'datetime', + 'internal_name': 'str', + 'ip_address': 'str' + } + + attribute_map = { + 'id': 'id', + 'hash': 'hash', + 'name': 'name', + 'state': 'state', + 'databases': 'databases', + 'image': 'image', + 'port': 'port', + 'created': 'created', + 'internal_name': 'internal_name', + 'ip_address': 'ip_address' + } + + def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + """ContainerDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._hash = None + self._name = None + self._state = None + self._databases = None + self._image = None + self._port = None + self._created = None + self._internal_name = None + self._ip_address = None + self.discriminator = None + self.id = id + self.hash = hash + self.name = name + if state is not None: + self.state = state + if databases is not None: + self.databases = databases + if image is not None: + self.image = image + if port is not None: + self.port = port + self.created = created + self.internal_name = internal_name + if ip_address is not None: + self.ip_address = ip_address + + @property + def id(self): + """Gets the id of this ContainerDto. # noqa: E501 + + + :return: The id of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContainerDto. + + + :param id: The id of this ContainerDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def hash(self): + """Gets the hash of this ContainerDto. # noqa: E501 + + + :return: The hash of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ContainerDto. + + + :param hash: The hash of this ContainerDto. # noqa: E501 + :type: str + """ + if hash is None: + raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501 + + self._hash = hash + + @property + def name(self): + """Gets the name of this ContainerDto. # noqa: E501 + + + :return: The name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerDto. + + + :param name: The name of this ContainerDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def state(self): + """Gets the state of this ContainerDto. # noqa: E501 + + + :return: The state of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this ContainerDto. + + + :param state: The state of this ContainerDto. # noqa: E501 + :type: str + """ + allowed_values = ["created", "restarting", "running", "paused", "exited", "dead"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def databases(self): + """Gets the databases of this ContainerDto. # noqa: E501 + + + :return: The databases of this ContainerDto. # noqa: E501 + :rtype: list[DatabaseDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this ContainerDto. + + + :param databases: The databases of this ContainerDto. # noqa: E501 + :type: list[DatabaseDto] + """ + + self._databases = databases + + @property + def image(self): + """Gets the image of this ContainerDto. # noqa: E501 + + + :return: The image of this ContainerDto. # noqa: E501 + :rtype: ImageBriefDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this ContainerDto. + + + :param image: The image of this ContainerDto. # noqa: E501 + :type: ImageBriefDto + """ + + self._image = image + + @property + def port(self): + """Gets the port of this ContainerDto. # noqa: E501 + + + :return: The port of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this ContainerDto. + + + :param port: The port of this ContainerDto. # noqa: E501 + :type: int + """ + + self._port = port + + @property + def created(self): + """Gets the created of this ContainerDto. # noqa: E501 + + + :return: The created of this ContainerDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ContainerDto. + + + :param created: The created of this ContainerDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def internal_name(self): + """Gets the internal_name of this ContainerDto. # noqa: E501 + + + :return: The internal_name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ContainerDto. + + + :param internal_name: The internal_name of this ContainerDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + @property + def ip_address(self): + """Gets the ip_address of this ContainerDto. # noqa: E501 + + + :return: The ip_address of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """Sets the ip_address of this ContainerDto. + + + :param ip_address: The ip_address of this ContainerDto. # noqa: E501 + :type: str + """ + + self._ip_address = ip_address + + 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(ContainerDto, 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, ContainerDto): + 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/swagger/api/api_query/models/database_dto.py b/swagger/api/api_query/models/database_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..2a1eca58879ea04405ff2b27dba5d4713893b3ac --- /dev/null +++ b/swagger/api/api_query/models/database_dto.py @@ -0,0 +1,589 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 DatabaseDto(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 = { + 'id': 'int', + 'name': 'str', + 'exchange': 'str', + 'creator': 'UserBriefDto', + 'subjects': 'list[str]', + 'language': 'str', + 'license': 'LicenseDto', + 'description': 'str', + 'publisher': 'str', + 'tables': 'list[TableBriefDto]', + 'image': 'ImageDto', + 'container': 'ContainerDto', + 'created': 'datetime', + 'deleted': 'datetime', + 'internal_name': 'str', + 'publication_year': 'int', + 'publication_month': 'int', + 'publication_day': 'int', + 'is_public': 'bool' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'exchange': 'exchange', + 'creator': 'creator', + 'subjects': 'subjects', + 'language': 'language', + 'license': 'license', + 'description': 'description', + 'publisher': 'publisher', + 'tables': 'tables', + 'image': 'image', + 'container': 'container', + 'created': 'created', + 'deleted': 'deleted', + 'internal_name': 'internal_name', + 'publication_year': 'publication_year', + 'publication_month': 'publication_month', + 'publication_day': 'publication_day', + 'is_public': 'is_public' + } + + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_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._tables = None + self._image = None + self._container = None + self._created = None + self._deleted = None + self._internal_name = None + self._publication_year = None + self._publication_month = None + self._publication_day = None + self._is_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 tables is not None: + self.tables = tables + if image is not None: + self.image = image + if container is not None: + self.container = container + if created is not None: + self.created = created + if deleted is not None: + self.deleted = deleted + self.internal_name = internal_name + if publication_year is not None: + self.publication_year = 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 is_public is not None: + self.is_public = is_public + + @property + def id(self): + """Gets the id of this DatabaseDto. # noqa: E501 + + + :return: The id of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DatabaseDto. + + + :param id: The id of this DatabaseDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this DatabaseDto. # noqa: E501 + + + :return: The name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DatabaseDto. + + + :param name: The name of this DatabaseDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def exchange(self): + """Gets the exchange of this DatabaseDto. # noqa: E501 + + + :return: The exchange of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this DatabaseDto. + + + :param exchange: The exchange of this DatabaseDto. # noqa: E501 + :type: str + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def creator(self): + """Gets the creator of this DatabaseDto. # noqa: E501 + + + :return: The creator of this DatabaseDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this DatabaseDto. + + + :param creator: The creator of this DatabaseDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def subjects(self): + """Gets the subjects of this DatabaseDto. # noqa: E501 + + + :return: The subjects of this DatabaseDto. # noqa: E501 + :rtype: list[str] + """ + return self._subjects + + @subjects.setter + def subjects(self, subjects): + """Sets the subjects of this DatabaseDto. + + + :param subjects: The subjects of this DatabaseDto. # noqa: E501 + :type: list[str] + """ + + self._subjects = subjects + + @property + def language(self): + """Gets the language of this DatabaseDto. # noqa: E501 + + + :return: The language of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this DatabaseDto. + + + :param language: The 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: + raise ValueError( + "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 + .format(language, allowed_values) + ) + + self._language = language + + @property + def license(self): + """Gets the license of this DatabaseDto. # noqa: E501 + + + :return: The license of this DatabaseDto. # noqa: E501 + :rtype: LicenseDto + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this DatabaseDto. + + + :param license: The license of this DatabaseDto. # noqa: E501 + :type: LicenseDto + """ + + self._license = license + + @property + def description(self): + """Gets the description of this DatabaseDto. # noqa: E501 + + + :return: The description of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this DatabaseDto. + + + :param description: The description of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def publisher(self): + """Gets the publisher of this DatabaseDto. # noqa: E501 + + + :return: The publisher of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this DatabaseDto. + + + :param publisher: The publisher of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._publisher = publisher + + @property + def tables(self): + """Gets the tables of this DatabaseDto. # noqa: E501 + + + :return: The tables of this DatabaseDto. # noqa: E501 + :rtype: list[TableBriefDto] + """ + return self._tables + + @tables.setter + def tables(self, tables): + """Sets the tables of this DatabaseDto. + + + :param tables: The tables of this DatabaseDto. # noqa: E501 + :type: list[TableBriefDto] + """ + + self._tables = tables + + @property + def image(self): + """Gets the image of this DatabaseDto. # noqa: E501 + + + :return: The image of this DatabaseDto. # noqa: E501 + :rtype: ImageDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this DatabaseDto. + + + :param image: The image of this DatabaseDto. # noqa: E501 + :type: ImageDto + """ + + self._image = image + + @property + def container(self): + """Gets the container of this DatabaseDto. # noqa: E501 + + + :return: The container of this DatabaseDto. # noqa: E501 + :rtype: ContainerDto + """ + return self._container + + @container.setter + def container(self, container): + """Sets the container of this DatabaseDto. + + + :param container: The container of this DatabaseDto. # noqa: E501 + :type: ContainerDto + """ + + self._container = container + + @property + def created(self): + """Gets the created of this DatabaseDto. # noqa: E501 + + + :return: The created of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseDto. + + + :param created: The created of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def deleted(self): + """Gets the deleted of this DatabaseDto. # noqa: E501 + + + :return: The deleted of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this DatabaseDto. + + + :param deleted: The deleted of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._deleted = deleted + + @property + def internal_name(self): + """Gets the internal_name of this DatabaseDto. # noqa: E501 + + + :return: The internal_name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this DatabaseDto. + + + :param internal_name: The 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 + + self._internal_name = internal_name + + @property + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 + + + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. + + + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_year = publication_year + + @property + def publication_month(self): + """Gets the publication_month of this DatabaseDto. # noqa: E501 + + + :return: The publication_month of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this DatabaseDto. + + + :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_day(self): + """Gets the publication_day of this DatabaseDto. # noqa: E501 + + + :return: The publication_day of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this DatabaseDto. + + + :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def is_public(self): + """Gets the is_public of this DatabaseDto. # noqa: E501 + + + :return: The is_public of this DatabaseDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseDto. + + + :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :type: bool + """ + + 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(DatabaseDto, 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, DatabaseDto): + 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/swagger/api/api_query/models/execute_statement_dto.py b/swagger/api/api_query/models/execute_statement_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..066ab10780de553f8414b831289c8d0caec52c1d --- /dev/null +++ b/swagger/api/api_query/models/execute_statement_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ExecuteStatementDto(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 = { + 'statement': 'str' + } + + attribute_map = { + 'statement': 'statement' + } + + def __init__(self, statement=None): # noqa: E501 + """ExecuteStatementDto - a model defined in Swagger""" # noqa: E501 + self._statement = None + self.discriminator = None + self.statement = statement + + @property + def statement(self): + """Gets the statement of this ExecuteStatementDto. # noqa: E501 + + + :return: The statement of this ExecuteStatementDto. # noqa: E501 + :rtype: str + """ + return self._statement + + @statement.setter + def statement(self, statement): + """Sets the statement of this ExecuteStatementDto. + + + :param statement: The statement of this ExecuteStatementDto. # noqa: E501 + :type: str + """ + if statement is None: + raise ValueError("Invalid value for `statement`, must not be `None`") # noqa: E501 + + self._statement = statement + + 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(ExecuteStatementDto, 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, ExecuteStatementDto): + 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/swagger/api/api_query/models/granted_authority_dto.py b/swagger/api/api_query/models/granted_authority_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..14256a5fe3229571bb8f6d72e4da652593f608da --- /dev/null +++ b/swagger/api/api_query/models/granted_authority_dto.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 GrantedAuthorityDto(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 = { + 'authority': 'str' + } + + attribute_map = { + 'authority': 'authority' + } + + def __init__(self, authority=None): # noqa: E501 + """GrantedAuthorityDto - a model defined in Swagger""" # noqa: E501 + self._authority = None + self.discriminator = None + if authority is not None: + self.authority = authority + + @property + def authority(self): + """Gets the authority of this GrantedAuthorityDto. # noqa: E501 + + + :return: The authority of this GrantedAuthorityDto. # noqa: E501 + :rtype: str + """ + return self._authority + + @authority.setter + def authority(self, authority): + """Sets the authority of this GrantedAuthorityDto. + + + :param authority: The authority of this GrantedAuthorityDto. # noqa: E501 + :type: str + """ + + self._authority = authority + + 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(GrantedAuthorityDto, 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, GrantedAuthorityDto): + 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/swagger/api/api_query/models/image_brief_dto.py b/swagger/api/api_query/models/image_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e2485ffd1d3174b6a2cd1d265ed771bd299e6f56 --- /dev/null +++ b/swagger/api/api_query/models/image_brief_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ImageBriefDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag' + } + + def __init__(self, id=None, repository=None, tag=None): # noqa: E501 + """ImageBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + + @property + def id(self): + """Gets the id of this ImageBriefDto. # noqa: E501 + + + :return: The id of this ImageBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageBriefDto. + + + :param id: The id of this ImageBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageBriefDto. # noqa: E501 + + + :return: The repository of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageBriefDto. + + + :param repository: The repository of this ImageBriefDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageBriefDto. # noqa: E501 + + + :return: The tag of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageBriefDto. + + + :param tag: The tag of this ImageBriefDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + 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(ImageBriefDto, 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, ImageBriefDto): + 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/swagger/api/api_query/models/image_date_dto.py b/swagger/api/api_query/models/image_date_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..cffa3c6e333e5ec1c0fb2b3754d8b3ae9886f319 --- /dev/null +++ b/swagger/api/api_query/models/image_date_dto.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ImageDateDto(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 = { + 'id': 'int', + 'example': 'str', + 'database_format': 'str', + 'unix_format': 'str', + 'has_time': 'bool', + 'created_at': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'example': 'example', + 'database_format': 'database_format', + 'unix_format': 'unix_format', + 'has_time': 'has_time', + 'created_at': 'created_at' + } + + def __init__(self, id=None, example=None, database_format=None, unix_format=None, has_time=None, created_at=None): # noqa: E501 + """ImageDateDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._example = None + self._database_format = None + self._unix_format = None + self._has_time = None + self._created_at = None + self.discriminator = None + self.id = id + self.example = example + self.database_format = database_format + self.unix_format = unix_format + self.has_time = has_time + if created_at is not None: + self.created_at = created_at + + @property + def id(self): + """Gets the id of this ImageDateDto. # noqa: E501 + + + :return: The id of this ImageDateDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDateDto. + + + :param id: The id of this ImageDateDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def example(self): + """Gets the example of this ImageDateDto. # noqa: E501 + + + :return: The example of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._example + + @example.setter + def example(self, example): + """Sets the example of this ImageDateDto. + + + :param example: The example of this ImageDateDto. # noqa: E501 + :type: str + """ + if example is None: + raise ValueError("Invalid value for `example`, must not be `None`") # noqa: E501 + + self._example = example + + @property + def database_format(self): + """Gets the database_format of this ImageDateDto. # noqa: E501 + + + :return: The database_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._database_format + + @database_format.setter + def database_format(self, database_format): + """Sets the database_format of this ImageDateDto. + + + :param database_format: The database_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if database_format is None: + raise ValueError("Invalid value for `database_format`, must not be `None`") # noqa: E501 + + self._database_format = database_format + + @property + def unix_format(self): + """Gets the unix_format of this ImageDateDto. # noqa: E501 + + + :return: The unix_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._unix_format + + @unix_format.setter + def unix_format(self, unix_format): + """Sets the unix_format of this ImageDateDto. + + + :param unix_format: The unix_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if unix_format is None: + raise ValueError("Invalid value for `unix_format`, must not be `None`") # noqa: E501 + + self._unix_format = unix_format + + @property + def has_time(self): + """Gets the has_time of this ImageDateDto. # noqa: E501 + + + :return: The has_time of this ImageDateDto. # noqa: E501 + :rtype: bool + """ + return self._has_time + + @has_time.setter + def has_time(self, has_time): + """Sets the has_time of this ImageDateDto. + + + :param has_time: The has_time of this ImageDateDto. # noqa: E501 + :type: bool + """ + if has_time is None: + raise ValueError("Invalid value for `has_time`, must not be `None`") # noqa: E501 + + self._has_time = has_time + + @property + def created_at(self): + """Gets the created_at of this ImageDateDto. # noqa: E501 + + + :return: The created_at of this ImageDateDto. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ImageDateDto. + + + :param created_at: The created_at of this ImageDateDto. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + 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(ImageDateDto, 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, ImageDateDto): + 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/swagger/api/api_query/models/image_dto.py b/swagger/api/api_query/models/image_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..f527a511f888b0c7ad69997b87397eeddde38a9b --- /dev/null +++ b/swagger/api/api_query/models/image_dto.py @@ -0,0 +1,404 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ImageDto(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 = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str', + 'dialect': 'str', + 'hash': 'str', + 'compiled': 'datetime', + 'size': 'int', + 'environment': 'list[ImageEnvItemDto]', + 'driver_class': 'str', + 'date_formats': 'list[ImageDateDto]', + 'jdbc_method': 'str', + 'default_port': 'int' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag', + 'dialect': 'dialect', + 'hash': 'hash', + 'compiled': 'compiled', + 'size': 'size', + 'environment': 'environment', + 'driver_class': 'driver_class', + 'date_formats': 'date_formats', + 'jdbc_method': 'jdbc_method', + 'default_port': 'default_port' + } + + def __init__(self, id=None, repository=None, tag=None, dialect=None, hash=None, compiled=None, size=None, environment=None, driver_class=None, date_formats=None, jdbc_method=None, default_port=None): # noqa: E501 + """ImageDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self._dialect = None + self._hash = None + self._compiled = None + self._size = None + self._environment = None + self._driver_class = None + self._date_formats = None + self._jdbc_method = None + self._default_port = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + self.dialect = dialect + if hash is not None: + self.hash = hash + if compiled is not None: + self.compiled = compiled + if size is not None: + self.size = size + self.environment = environment + self.driver_class = driver_class + if date_formats is not None: + self.date_formats = date_formats + self.jdbc_method = jdbc_method + self.default_port = default_port + + @property + def id(self): + """Gets the id of this ImageDto. # noqa: E501 + + + :return: The id of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDto. + + + :param id: The id of this ImageDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageDto. # noqa: E501 + + + :return: The repository of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageDto. + + + :param repository: The repository of this ImageDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageDto. # noqa: E501 + + + :return: The tag of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageDto. + + + :param tag: The tag of this ImageDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + @property + def dialect(self): + """Gets the dialect of this ImageDto. # noqa: E501 + + + :return: The dialect of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._dialect + + @dialect.setter + def dialect(self, dialect): + """Sets the dialect of this ImageDto. + + + :param dialect: The dialect of this ImageDto. # noqa: E501 + :type: str + """ + if dialect is None: + raise ValueError("Invalid value for `dialect`, must not be `None`") # noqa: E501 + + self._dialect = dialect + + @property + def hash(self): + """Gets the hash of this ImageDto. # noqa: E501 + + + :return: The hash of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ImageDto. + + + :param hash: The hash of this ImageDto. # noqa: E501 + :type: str + """ + + self._hash = hash + + @property + def compiled(self): + """Gets the compiled of this ImageDto. # noqa: E501 + + + :return: The compiled of this ImageDto. # noqa: E501 + :rtype: datetime + """ + return self._compiled + + @compiled.setter + def compiled(self, compiled): + """Sets the compiled of this ImageDto. + + + :param compiled: The compiled of this ImageDto. # noqa: E501 + :type: datetime + """ + + self._compiled = compiled + + @property + def size(self): + """Gets the size of this ImageDto. # noqa: E501 + + + :return: The size of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this ImageDto. + + + :param size: The size of this ImageDto. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def environment(self): + """Gets the environment of this ImageDto. # noqa: E501 + + + :return: The environment of this ImageDto. # noqa: E501 + :rtype: list[ImageEnvItemDto] + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this ImageDto. + + + :param environment: The environment of this ImageDto. # noqa: E501 + :type: list[ImageEnvItemDto] + """ + if environment is None: + raise ValueError("Invalid value for `environment`, must not be `None`") # noqa: E501 + + self._environment = environment + + @property + def driver_class(self): + """Gets the driver_class of this ImageDto. # noqa: E501 + + + :return: The driver_class of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._driver_class + + @driver_class.setter + def driver_class(self, driver_class): + """Sets the driver_class of this ImageDto. + + + :param driver_class: The driver_class of this ImageDto. # noqa: E501 + :type: str + """ + if driver_class is None: + raise ValueError("Invalid value for `driver_class`, must not be `None`") # noqa: E501 + + self._driver_class = driver_class + + @property + def date_formats(self): + """Gets the date_formats of this ImageDto. # noqa: E501 + + + :return: The date_formats of this ImageDto. # noqa: E501 + :rtype: list[ImageDateDto] + """ + return self._date_formats + + @date_formats.setter + def date_formats(self, date_formats): + """Sets the date_formats of this ImageDto. + + + :param date_formats: The date_formats of this ImageDto. # noqa: E501 + :type: list[ImageDateDto] + """ + + self._date_formats = date_formats + + @property + def jdbc_method(self): + """Gets the jdbc_method of this ImageDto. # noqa: E501 + + + :return: The jdbc_method of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._jdbc_method + + @jdbc_method.setter + def jdbc_method(self, jdbc_method): + """Sets the jdbc_method of this ImageDto. + + + :param jdbc_method: The jdbc_method of this ImageDto. # noqa: E501 + :type: str + """ + if jdbc_method is None: + raise ValueError("Invalid value for `jdbc_method`, must not be `None`") # noqa: E501 + + self._jdbc_method = jdbc_method + + @property + def default_port(self): + """Gets the default_port of this ImageDto. # noqa: E501 + + + :return: The default_port of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._default_port + + @default_port.setter + def default_port(self, default_port): + """Sets the default_port of this ImageDto. + + + :param default_port: The default_port of this ImageDto. # noqa: E501 + :type: int + """ + if default_port is None: + raise ValueError("Invalid value for `default_port`, must not be `None`") # noqa: E501 + + self._default_port = default_port + + 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(ImageDto, 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, ImageDto): + 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/swagger/api/api_query/models/image_env_item_dto.py b/swagger/api/api_query/models/image_env_item_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..521b735ee2ca69d6b694e6ade5cdc4de63c36478 --- /dev/null +++ b/swagger/api/api_query/models/image_env_item_dto.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ImageEnvItemDto(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 = { + 'iid': 'int', + 'key': 'str', + 'value': 'str', + 'type': 'str' + } + + attribute_map = { + 'iid': 'iid', + 'key': 'key', + 'value': 'value', + 'type': 'type' + } + + def __init__(self, iid=None, key=None, value=None, type=None): # noqa: E501 + """ImageEnvItemDto - a model defined in Swagger""" # noqa: E501 + self._iid = None + self._key = None + self._value = None + self._type = None + self.discriminator = None + self.iid = iid + self.key = key + self.value = value + self.type = type + + @property + def iid(self): + """Gets the iid of this ImageEnvItemDto. # noqa: E501 + + + :return: The iid of this ImageEnvItemDto. # noqa: E501 + :rtype: int + """ + return self._iid + + @iid.setter + def iid(self, iid): + """Sets the iid of this ImageEnvItemDto. + + + :param iid: The iid of this ImageEnvItemDto. # noqa: E501 + :type: int + """ + if iid is None: + raise ValueError("Invalid value for `iid`, must not be `None`") # noqa: E501 + + self._iid = iid + + @property + def key(self): + """Gets the key of this ImageEnvItemDto. # noqa: E501 + + + :return: The key of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this ImageEnvItemDto. + + + :param key: The key of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if key is None: + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value(self): + """Gets the value of this ImageEnvItemDto. # noqa: E501 + + + :return: The value of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ImageEnvItemDto. + + + :param value: The value of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this ImageEnvItemDto. # noqa: E501 + + + :return: The type of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ImageEnvItemDto. + + + :param type: The type of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["username", "password", "privileged_username", "privileged_password"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + 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(ImageEnvItemDto, 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, ImageEnvItemDto): + 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/swagger/api/api_query/models/import_dto.py b/swagger/api/api_query/models/import_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..b6a90a4e1cdd6c20fe0c68f9340b0a025355eb03 --- /dev/null +++ b/swagger/api/api_query/models/import_dto.py @@ -0,0 +1,268 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ImportDto(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 = { + 'location': 'str', + 'separator': 'str', + 'quote': 'str', + 'skip_lines': 'int', + 'false_element': 'str', + 'true_element': 'str', + 'null_element': 'str' + } + + attribute_map = { + 'location': 'location', + 'separator': 'separator', + 'quote': 'quote', + 'skip_lines': 'skip_lines', + 'false_element': 'false_element', + 'true_element': 'true_element', + 'null_element': 'null_element' + } + + def __init__(self, location=None, separator=None, quote=None, skip_lines=None, false_element=None, true_element=None, null_element=None): # noqa: E501 + """ImportDto - a model defined in Swagger""" # noqa: E501 + self._location = None + self._separator = None + self._quote = None + self._skip_lines = None + self._false_element = None + self._true_element = None + self._null_element = None + self.discriminator = None + self.location = location + self.separator = separator + if quote is not None: + self.quote = quote + if skip_lines is not None: + self.skip_lines = skip_lines + if false_element is not None: + self.false_element = false_element + if true_element is not None: + self.true_element = true_element + if null_element is not None: + self.null_element = null_element + + @property + def location(self): + """Gets the location of this ImportDto. # noqa: E501 + + + :return: The location of this ImportDto. # noqa: E501 + :rtype: str + """ + return self._location + + @location.setter + def location(self, location): + """Sets the location of this ImportDto. + + + :param location: The location of this ImportDto. # noqa: E501 + :type: str + """ + if location is None: + raise ValueError("Invalid value for `location`, must not be `None`") # noqa: E501 + + self._location = location + + @property + def separator(self): + """Gets the separator of this ImportDto. # noqa: E501 + + + :return: The separator of this ImportDto. # noqa: E501 + :rtype: str + """ + return self._separator + + @separator.setter + def separator(self, separator): + """Sets the separator of this ImportDto. + + + :param separator: The separator of this ImportDto. # noqa: E501 + :type: str + """ + if separator is None: + raise ValueError("Invalid value for `separator`, must not be `None`") # noqa: E501 + + self._separator = separator + + @property + def quote(self): + """Gets the quote of this ImportDto. # noqa: E501 + + + :return: The quote of this ImportDto. # noqa: E501 + :rtype: str + """ + return self._quote + + @quote.setter + def quote(self, quote): + """Sets the quote of this ImportDto. + + + :param quote: The quote of this ImportDto. # noqa: E501 + :type: str + """ + + self._quote = quote + + @property + def skip_lines(self): + """Gets the skip_lines of this ImportDto. # noqa: E501 + + + :return: The skip_lines of this ImportDto. # noqa: E501 + :rtype: int + """ + return self._skip_lines + + @skip_lines.setter + def skip_lines(self, skip_lines): + """Sets the skip_lines of this ImportDto. + + + :param skip_lines: The skip_lines of this ImportDto. # noqa: E501 + :type: int + """ + + self._skip_lines = skip_lines + + @property + def false_element(self): + """Gets the false_element of this ImportDto. # noqa: E501 + + + :return: The false_element of this ImportDto. # noqa: E501 + :rtype: str + """ + return self._false_element + + @false_element.setter + def false_element(self, false_element): + """Sets the false_element of this ImportDto. + + + :param false_element: The false_element of this ImportDto. # noqa: E501 + :type: str + """ + + self._false_element = false_element + + @property + def true_element(self): + """Gets the true_element of this ImportDto. # noqa: E501 + + + :return: The true_element of this ImportDto. # noqa: E501 + :rtype: str + """ + return self._true_element + + @true_element.setter + def true_element(self, true_element): + """Sets the true_element of this ImportDto. + + + :param true_element: The true_element of this ImportDto. # noqa: E501 + :type: str + """ + + self._true_element = true_element + + @property + def null_element(self): + """Gets the null_element of this ImportDto. # noqa: E501 + + + :return: The null_element of this ImportDto. # noqa: E501 + :rtype: str + """ + return self._null_element + + @null_element.setter + def null_element(self, null_element): + """Sets the null_element of this ImportDto. + + + :param null_element: The null_element of this ImportDto. # noqa: E501 + :type: str + """ + + self._null_element = null_element + + 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(ImportDto, 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, ImportDto): + 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/swagger/api/api_query/models/license_dto.py b/swagger/api/api_query/models/license_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ccba4e8f50e07141b90128f4b1e2dd5608b0380a --- /dev/null +++ b/swagger/api/api_query/models/license_dto.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 LicenseDto(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 = { + 'identifier': 'str', + 'uri': 'str' + } + + attribute_map = { + 'identifier': 'identifier', + 'uri': 'uri' + } + + def __init__(self, identifier=None, uri=None): # noqa: E501 + """LicenseDto - a model defined in Swagger""" # noqa: E501 + self._identifier = None + self._uri = None + self.discriminator = None + self.identifier = identifier + self.uri = uri + + @property + def identifier(self): + """Gets the identifier of this LicenseDto. # noqa: E501 + + + :return: The identifier of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this LicenseDto. + + + :param identifier: The identifier of this LicenseDto. # noqa: E501 + :type: str + """ + if identifier is None: + raise ValueError("Invalid value for `identifier`, must not be `None`") # noqa: E501 + + self._identifier = identifier + + @property + def uri(self): + """Gets the uri of this LicenseDto. # noqa: E501 + + + :return: The uri of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this LicenseDto. + + + :param uri: The uri of this LicenseDto. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + 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(LicenseDto, 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, LicenseDto): + 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/swagger/api/api_query/models/query_brief_dto.py b/swagger/api/api_query/models/query_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..4eb119fd8b0efcf31ba4edf6feed9207d0cf4a13 --- /dev/null +++ b/swagger/api/api_query/models/query_brief_dto.py @@ -0,0 +1,403 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 QueryBriefDto(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 = { + 'id': 'int', + 'cid': 'int', + 'dbid': 'int', + 'creator': 'UserDto', + 'execution': 'datetime', + 'query': 'str', + 'created': 'datetime', + 'query_normalized': 'str', + 'query_hash': 'str', + 'result_hash': 'str', + 'result_number': 'int', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'cid': 'cid', + 'dbid': 'dbid', + 'creator': 'creator', + 'execution': 'execution', + 'query': 'query', + 'created': 'created', + 'query_normalized': 'query_normalized', + 'query_hash': 'query_hash', + 'result_hash': 'result_hash', + 'result_number': 'result_number', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, cid=None, dbid=None, creator=None, execution=None, query=None, created=None, query_normalized=None, query_hash=None, result_hash=None, result_number=None, last_modified=None): # noqa: E501 + """QueryBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._cid = None + self._dbid = None + self._creator = None + self._execution = None + self._query = None + self._created = None + self._query_normalized = None + self._query_hash = None + self._result_hash = None + self._result_number = None + self._last_modified = None + self.discriminator = None + self.id = id + self.cid = cid + self.dbid = dbid + self.creator = creator + if execution is not None: + self.execution = execution + self.query = query + self.created = created + if query_normalized is not None: + self.query_normalized = query_normalized + self.query_hash = query_hash + if result_hash is not None: + self.result_hash = result_hash + if result_number is not None: + self.result_number = result_number + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this QueryBriefDto. # noqa: E501 + + + :return: The id of this QueryBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this QueryBriefDto. + + + :param id: The id of this QueryBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def cid(self): + """Gets the cid of this QueryBriefDto. # noqa: E501 + + + :return: The cid of this QueryBriefDto. # noqa: E501 + :rtype: int + """ + return self._cid + + @cid.setter + def cid(self, cid): + """Sets the cid of this QueryBriefDto. + + + :param cid: The cid of this QueryBriefDto. # noqa: E501 + :type: int + """ + if cid is None: + raise ValueError("Invalid value for `cid`, must not be `None`") # noqa: E501 + + self._cid = cid + + @property + def dbid(self): + """Gets the dbid of this QueryBriefDto. # noqa: E501 + + + :return: The dbid of this QueryBriefDto. # noqa: E501 + :rtype: int + """ + return self._dbid + + @dbid.setter + def dbid(self, dbid): + """Sets the dbid of this QueryBriefDto. + + + :param dbid: The dbid of this QueryBriefDto. # noqa: E501 + :type: int + """ + if dbid is None: + raise ValueError("Invalid value for `dbid`, must not be `None`") # noqa: E501 + + self._dbid = dbid + + @property + def creator(self): + """Gets the creator of this QueryBriefDto. # noqa: E501 + + + :return: The creator of this QueryBriefDto. # noqa: E501 + :rtype: UserDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this QueryBriefDto. + + + :param creator: The creator of this QueryBriefDto. # noqa: E501 + :type: UserDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def execution(self): + """Gets the execution of this QueryBriefDto. # noqa: E501 + + + :return: The execution of this QueryBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._execution + + @execution.setter + def execution(self, execution): + """Sets the execution of this QueryBriefDto. + + + :param execution: The execution of this QueryBriefDto. # noqa: E501 + :type: datetime + """ + + self._execution = execution + + @property + def query(self): + """Gets the query of this QueryBriefDto. # noqa: E501 + + + :return: The query of this QueryBriefDto. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this QueryBriefDto. + + + :param query: The query of this QueryBriefDto. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def created(self): + """Gets the created of this QueryBriefDto. # noqa: E501 + + + :return: The created of this QueryBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this QueryBriefDto. + + + :param created: The created of this QueryBriefDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def query_normalized(self): + """Gets the query_normalized of this QueryBriefDto. # noqa: E501 + + + :return: The query_normalized of this QueryBriefDto. # noqa: E501 + :rtype: str + """ + return self._query_normalized + + @query_normalized.setter + def query_normalized(self, query_normalized): + """Sets the query_normalized of this QueryBriefDto. + + + :param query_normalized: The query_normalized of this QueryBriefDto. # noqa: E501 + :type: str + """ + + self._query_normalized = query_normalized + + @property + def query_hash(self): + """Gets the query_hash of this QueryBriefDto. # noqa: E501 + + + :return: The query_hash of this QueryBriefDto. # noqa: E501 + :rtype: str + """ + return self._query_hash + + @query_hash.setter + def query_hash(self, query_hash): + """Sets the query_hash of this QueryBriefDto. + + + :param query_hash: The query_hash of this QueryBriefDto. # noqa: E501 + :type: str + """ + if query_hash is None: + raise ValueError("Invalid value for `query_hash`, must not be `None`") # noqa: E501 + + self._query_hash = query_hash + + @property + def result_hash(self): + """Gets the result_hash of this QueryBriefDto. # noqa: E501 + + + :return: The result_hash of this QueryBriefDto. # noqa: E501 + :rtype: str + """ + return self._result_hash + + @result_hash.setter + def result_hash(self, result_hash): + """Sets the result_hash of this QueryBriefDto. + + + :param result_hash: The result_hash of this QueryBriefDto. # noqa: E501 + :type: str + """ + + self._result_hash = result_hash + + @property + def result_number(self): + """Gets the result_number of this QueryBriefDto. # noqa: E501 + + + :return: The result_number of this QueryBriefDto. # noqa: E501 + :rtype: int + """ + return self._result_number + + @result_number.setter + def result_number(self, result_number): + """Sets the result_number of this QueryBriefDto. + + + :param result_number: The result_number of this QueryBriefDto. # noqa: E501 + :type: int + """ + + self._result_number = result_number + + @property + def last_modified(self): + """Gets the last_modified of this QueryBriefDto. # noqa: E501 + + + :return: The last_modified of this QueryBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this QueryBriefDto. + + + :param last_modified: The last_modified of this QueryBriefDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + 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(QueryBriefDto, 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, QueryBriefDto): + 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/swagger/api/api_query/models/query_dto.py b/swagger/api/api_query/models/query_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..60469ec4cf21b7ed58ed9c06ff17c95420e9cbd5 --- /dev/null +++ b/swagger/api/api_query/models/query_dto.py @@ -0,0 +1,403 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 QueryDto(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 = { + 'id': 'int', + 'cid': 'int', + 'dbid': 'int', + 'creator': 'UserDto', + 'execution': 'datetime', + 'query': 'str', + 'created': 'datetime', + 'query_normalized': 'str', + 'query_hash': 'str', + 'result_hash': 'str', + 'result_number': 'int', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'cid': 'cid', + 'dbid': 'dbid', + 'creator': 'creator', + 'execution': 'execution', + 'query': 'query', + 'created': 'created', + 'query_normalized': 'query_normalized', + 'query_hash': 'query_hash', + 'result_hash': 'result_hash', + 'result_number': 'result_number', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, cid=None, dbid=None, creator=None, execution=None, query=None, created=None, query_normalized=None, query_hash=None, result_hash=None, result_number=None, last_modified=None): # noqa: E501 + """QueryDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._cid = None + self._dbid = None + self._creator = None + self._execution = None + self._query = None + self._created = None + self._query_normalized = None + self._query_hash = None + self._result_hash = None + self._result_number = None + self._last_modified = None + self.discriminator = None + self.id = id + self.cid = cid + self.dbid = dbid + self.creator = creator + if execution is not None: + self.execution = execution + self.query = query + self.created = created + if query_normalized is not None: + self.query_normalized = query_normalized + self.query_hash = query_hash + if result_hash is not None: + self.result_hash = result_hash + if result_number is not None: + self.result_number = result_number + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this QueryDto. # noqa: E501 + + + :return: The id of this QueryDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this QueryDto. + + + :param id: The id of this QueryDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def cid(self): + """Gets the cid of this QueryDto. # noqa: E501 + + + :return: The cid of this QueryDto. # noqa: E501 + :rtype: int + """ + return self._cid + + @cid.setter + def cid(self, cid): + """Sets the cid of this QueryDto. + + + :param cid: The cid of this QueryDto. # noqa: E501 + :type: int + """ + if cid is None: + raise ValueError("Invalid value for `cid`, must not be `None`") # noqa: E501 + + self._cid = cid + + @property + def dbid(self): + """Gets the dbid of this QueryDto. # noqa: E501 + + + :return: The dbid of this QueryDto. # noqa: E501 + :rtype: int + """ + return self._dbid + + @dbid.setter + def dbid(self, dbid): + """Sets the dbid of this QueryDto. + + + :param dbid: The dbid of this QueryDto. # noqa: E501 + :type: int + """ + if dbid is None: + raise ValueError("Invalid value for `dbid`, must not be `None`") # noqa: E501 + + self._dbid = dbid + + @property + def creator(self): + """Gets the creator of this QueryDto. # noqa: E501 + + + :return: The creator of this QueryDto. # noqa: E501 + :rtype: UserDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this QueryDto. + + + :param creator: The creator of this QueryDto. # noqa: E501 + :type: UserDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def execution(self): + """Gets the execution of this QueryDto. # noqa: E501 + + + :return: The execution of this QueryDto. # noqa: E501 + :rtype: datetime + """ + return self._execution + + @execution.setter + def execution(self, execution): + """Sets the execution of this QueryDto. + + + :param execution: The execution of this QueryDto. # noqa: E501 + :type: datetime + """ + + self._execution = execution + + @property + def query(self): + """Gets the query of this QueryDto. # noqa: E501 + + + :return: The query of this QueryDto. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this QueryDto. + + + :param query: The query of this QueryDto. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def created(self): + """Gets the created of this QueryDto. # noqa: E501 + + + :return: The created of this QueryDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this QueryDto. + + + :param created: The created of this QueryDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def query_normalized(self): + """Gets the query_normalized of this QueryDto. # noqa: E501 + + + :return: The query_normalized of this QueryDto. # noqa: E501 + :rtype: str + """ + return self._query_normalized + + @query_normalized.setter + def query_normalized(self, query_normalized): + """Sets the query_normalized of this QueryDto. + + + :param query_normalized: The query_normalized of this QueryDto. # noqa: E501 + :type: str + """ + + self._query_normalized = query_normalized + + @property + def query_hash(self): + """Gets the query_hash of this QueryDto. # noqa: E501 + + + :return: The query_hash of this QueryDto. # noqa: E501 + :rtype: str + """ + return self._query_hash + + @query_hash.setter + def query_hash(self, query_hash): + """Sets the query_hash of this QueryDto. + + + :param query_hash: The query_hash of this QueryDto. # noqa: E501 + :type: str + """ + if query_hash is None: + raise ValueError("Invalid value for `query_hash`, must not be `None`") # noqa: E501 + + self._query_hash = query_hash + + @property + def result_hash(self): + """Gets the result_hash of this QueryDto. # noqa: E501 + + + :return: The result_hash of this QueryDto. # noqa: E501 + :rtype: str + """ + return self._result_hash + + @result_hash.setter + def result_hash(self, result_hash): + """Sets the result_hash of this QueryDto. + + + :param result_hash: The result_hash of this QueryDto. # noqa: E501 + :type: str + """ + + self._result_hash = result_hash + + @property + def result_number(self): + """Gets the result_number of this QueryDto. # noqa: E501 + + + :return: The result_number of this QueryDto. # noqa: E501 + :rtype: int + """ + return self._result_number + + @result_number.setter + def result_number(self, result_number): + """Sets the result_number of this QueryDto. + + + :param result_number: The result_number of this QueryDto. # noqa: E501 + :type: int + """ + + self._result_number = result_number + + @property + def last_modified(self): + """Gets the last_modified of this QueryDto. # noqa: E501 + + + :return: The last_modified of this QueryDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this QueryDto. + + + :param last_modified: The last_modified of this QueryDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + 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(QueryDto, 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, QueryDto): + 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/swagger/api/api_query/models/query_result_dto.py b/swagger/api/api_query/models/query_result_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..c60a6fe76eb2cd94ba74cb23c6f0b824e69142d9 --- /dev/null +++ b/swagger/api/api_query/models/query_result_dto.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 QueryResultDto(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 = { + 'result': 'list[dict(str, object)]', + 'id': 'int', + 'result_number': 'int' + } + + attribute_map = { + 'result': 'result', + 'id': 'id', + 'result_number': 'resultNumber' + } + + def __init__(self, result=None, id=None, result_number=None): # noqa: E501 + """QueryResultDto - a model defined in Swagger""" # noqa: E501 + self._result = None + self._id = None + self._result_number = None + self.discriminator = None + self.result = result + self.id = id + if result_number is not None: + self.result_number = result_number + + @property + def result(self): + """Gets the result of this QueryResultDto. # noqa: E501 + + + :return: The result of this QueryResultDto. # noqa: E501 + :rtype: list[dict(str, object)] + """ + return self._result + + @result.setter + def result(self, result): + """Sets the result of this QueryResultDto. + + + :param result: The result of this QueryResultDto. # noqa: E501 + :type: list[dict(str, object)] + """ + if result is None: + raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 + + self._result = result + + @property + def id(self): + """Gets the id of this QueryResultDto. # noqa: E501 + + + :return: The id of this QueryResultDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this QueryResultDto. + + + :param id: The id of this QueryResultDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def result_number(self): + """Gets the result_number of this QueryResultDto. # noqa: E501 + + + :return: The result_number of this QueryResultDto. # noqa: E501 + :rtype: int + """ + return self._result_number + + @result_number.setter + def result_number(self, result_number): + """Sets the result_number of this QueryResultDto. + + + :param result_number: The result_number of this QueryResultDto. # noqa: E501 + :type: int + """ + + self._result_number = result_number + + 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(QueryResultDto, 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, QueryResultDto): + 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/swagger/api/api_query/models/table_brief_dto.py b/swagger/api/api_query/models/table_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..3d373bbe508fcce09b5401b4654c36b34930c39f --- /dev/null +++ b/swagger/api/api_query/models/table_brief_dto.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 TableBriefDto(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 = { + 'id': 'int', + 'name': 'str', + 'creator': 'UserBriefDto', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator': 'creator', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + """TableBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._creator = None + self._internal_name = None + self.discriminator = None + self.id = id + self.name = name + self.creator = creator + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this TableBriefDto. # noqa: E501 + + + :return: The id of this TableBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TableBriefDto. + + + :param id: The id of this TableBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this TableBriefDto. # noqa: E501 + + + :return: The name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TableBriefDto. + + + :param name: The name of this TableBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this TableBriefDto. # noqa: E501 + + + :return: The creator of this TableBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this TableBriefDto. + + + :param creator: The creator of this TableBriefDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def internal_name(self): + """Gets the internal_name of this TableBriefDto. # noqa: E501 + + + :return: The internal_name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this TableBriefDto. + + + :param internal_name: The internal_name of this TableBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(TableBriefDto, 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, TableBriefDto): + 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/swagger/api/api_query/models/table_csv_delete_dto.py b/swagger/api/api_query/models/table_csv_delete_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ede0ff3d60eb6424d99f3c2572b11a44f802221a --- /dev/null +++ b/swagger/api/api_query/models/table_csv_delete_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 TableCsvDeleteDto(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 = { + 'keys': 'dict(str, object)' + } + + attribute_map = { + 'keys': 'keys' + } + + def __init__(self, keys=None): # noqa: E501 + """TableCsvDeleteDto - a model defined in Swagger""" # noqa: E501 + self._keys = None + self.discriminator = None + self.keys = keys + + @property + def keys(self): + """Gets the keys of this TableCsvDeleteDto. # noqa: E501 + + + :return: The keys of this TableCsvDeleteDto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._keys + + @keys.setter + def keys(self, keys): + """Sets the keys of this TableCsvDeleteDto. + + + :param keys: The keys of this TableCsvDeleteDto. # noqa: E501 + :type: dict(str, object) + """ + if keys is None: + raise ValueError("Invalid value for `keys`, must not be `None`") # noqa: E501 + + self._keys = keys + + 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(TableCsvDeleteDto, 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, TableCsvDeleteDto): + 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/swagger/api/api_query/models/table_csv_dto.py b/swagger/api/api_query/models/table_csv_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..b473e2acc95e2009adab375000c5995b1ac70260 --- /dev/null +++ b/swagger/api/api_query/models/table_csv_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 TableCsvDto(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 = { + 'data': 'dict(str, object)' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None): # noqa: E501 + """TableCsvDto - a model defined in Swagger""" # noqa: E501 + self._data = None + self.discriminator = None + self.data = data + + @property + def data(self): + """Gets the data of this TableCsvDto. # noqa: E501 + + + :return: The data of this TableCsvDto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this TableCsvDto. + + + :param data: The data of this TableCsvDto. # noqa: E501 + :type: dict(str, object) + """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + 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(TableCsvDto, 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, TableCsvDto): + 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/swagger/api/api_query/models/table_csv_update_dto.py b/swagger/api/api_query/models/table_csv_update_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..f2c2316f7d16ee540952af65452028b9d1debfb2 --- /dev/null +++ b/swagger/api/api_query/models/table_csv_update_dto.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 TableCsvUpdateDto(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 = { + 'data': 'dict(str, object)', + 'keys': 'dict(str, object)' + } + + attribute_map = { + 'data': 'data', + 'keys': 'keys' + } + + def __init__(self, data=None, keys=None): # noqa: E501 + """TableCsvUpdateDto - a model defined in Swagger""" # noqa: E501 + self._data = None + self._keys = None + self.discriminator = None + self.data = data + self.keys = keys + + @property + def data(self): + """Gets the data of this TableCsvUpdateDto. # noqa: E501 + + + :return: The data of this TableCsvUpdateDto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this TableCsvUpdateDto. + + + :param data: The data of this TableCsvUpdateDto. # noqa: E501 + :type: dict(str, object) + """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def keys(self): + """Gets the keys of this TableCsvUpdateDto. # noqa: E501 + + + :return: The keys of this TableCsvUpdateDto. # noqa: E501 + :rtype: dict(str, object) + """ + return self._keys + + @keys.setter + def keys(self, keys): + """Sets the keys of this TableCsvUpdateDto. + + + :param keys: The keys of this TableCsvUpdateDto. # noqa: E501 + :type: dict(str, object) + """ + if keys is None: + raise ValueError("Invalid value for `keys`, must not be `None`") # noqa: E501 + + self._keys = keys + + 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(TableCsvUpdateDto, 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, TableCsvUpdateDto): + 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/swagger/api/api_query/models/table_history_dto.py b/swagger/api/api_query/models/table_history_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..b79219069f8c2c1bfa1ab248fb85fdd5642d816c --- /dev/null +++ b/swagger/api/api_query/models/table_history_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 TableHistoryDto(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 = { + 'timestamp': 'datetime', + 'event': 'str', + 'total': 'int' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'event': 'event', + 'total': 'total' + } + + def __init__(self, timestamp=None, event=None, total=None): # noqa: E501 + """TableHistoryDto - a model defined in Swagger""" # noqa: E501 + self._timestamp = None + self._event = None + self._total = None + self.discriminator = None + self.timestamp = timestamp + self.event = event + self.total = total + + @property + def timestamp(self): + """Gets the timestamp of this TableHistoryDto. # noqa: E501 + + + :return: The timestamp of this TableHistoryDto. # noqa: E501 + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this TableHistoryDto. + + + :param timestamp: The timestamp of this TableHistoryDto. # noqa: E501 + :type: datetime + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + @property + def event(self): + """Gets the event of this TableHistoryDto. # noqa: E501 + + + :return: The event of this TableHistoryDto. # noqa: E501 + :rtype: str + """ + return self._event + + @event.setter + def event(self, event): + """Sets the event of this TableHistoryDto. + + + :param event: The event of this TableHistoryDto. # noqa: E501 + :type: str + """ + if event is None: + raise ValueError("Invalid value for `event`, must not be `None`") # noqa: E501 + + self._event = event + + @property + def total(self): + """Gets the total of this TableHistoryDto. # noqa: E501 + + + :return: The total of this TableHistoryDto. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this TableHistoryDto. + + + :param total: The total of this TableHistoryDto. # noqa: E501 + :type: int + """ + if total is None: + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + 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(TableHistoryDto, 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, TableHistoryDto): + 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/swagger/api/api_query/models/user_brief_dto.py b/swagger/api/api_query/models/user_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..c29510792162b1cdc193a1068c52cbdd470949dc --- /dev/null +++ b/swagger/api/api_query/models/user_brief_dto.py @@ -0,0 +1,350 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 UserBriefDto(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 = { + 'id': 'int', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserBriefDto. # noqa: E501 + + + :return: The id of this UserBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserBriefDto. + + + :param id: The id of this UserBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def username(self): + """Gets the username of this UserBriefDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserBriefDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserBriefDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserBriefDto. # noqa: E501 + + + :return: The firstname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserBriefDto. + + + :param firstname: The firstname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserBriefDto. # noqa: E501 + + + :return: The lastname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserBriefDto. + + + :param lastname: The lastname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserBriefDto. # noqa: E501 + + + :return: The affiliation of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserBriefDto. + + + :param affiliation: The affiliation of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserBriefDto. # noqa: E501 + + + :return: The orcid of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserBriefDto. + + + :param orcid: The orcid of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserBriefDto. # noqa: E501 + + + :return: The theme_dark of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserBriefDto. + + + :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserBriefDto. # noqa: E501 + + + :return: The email_verified of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserBriefDto. + + + :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserBriefDto, 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, UserBriefDto): + 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/swagger/api/api_query/models/user_dto.py b/swagger/api/api_query/models/user_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..6c3503411c21a5595d2818e6a107656da6b9e2ce --- /dev/null +++ b/swagger/api/api_query/models/user_dto.py @@ -0,0 +1,481 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 UserDto(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 = { + 'id': 'int', + 'authorities': 'list[GrantedAuthorityDto]', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'containers': 'list[ContainerDto]', + 'databases': 'list[ContainerDto]', + 'identifiers': 'list[ContainerDto]', + 'email': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'authorities': 'authorities', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'containers': 'containers', + 'databases': 'databases', + 'identifiers': 'identifiers', + 'email': 'email', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._authorities = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._containers = None + self._databases = None + self._identifiers = None + self._email = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + if authorities is not None: + self.authorities = authorities + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if containers is not None: + self.containers = containers + if databases is not None: + self.databases = databases + if identifiers is not None: + self.identifiers = identifiers + self.email = email + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserDto. # noqa: E501 + + + :return: The id of this UserDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserDto. + + + :param id: The id of this UserDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def authorities(self): + """Gets the authorities of this UserDto. # noqa: E501 + + + :return: The authorities of this UserDto. # noqa: E501 + :rtype: list[GrantedAuthorityDto] + """ + return self._authorities + + @authorities.setter + def authorities(self, authorities): + """Sets the authorities of this UserDto. + + + :param authorities: The authorities of this UserDto. # noqa: E501 + :type: list[GrantedAuthorityDto] + """ + + self._authorities = authorities + + @property + def username(self): + """Gets the username of this UserDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserDto. # noqa: E501 + + + :return: The firstname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserDto. + + + :param firstname: The firstname of this UserDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserDto. # noqa: E501 + + + :return: The lastname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserDto. + + + :param lastname: The lastname of this UserDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserDto. # noqa: E501 + + + :return: The affiliation of this UserDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserDto. + + + :param affiliation: The affiliation of this UserDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserDto. # noqa: E501 + + + :return: The orcid of this UserDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserDto. + + + :param orcid: The orcid of this UserDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def containers(self): + """Gets the containers of this UserDto. # noqa: E501 + + + :return: The containers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._containers + + @containers.setter + def containers(self, containers): + """Sets the containers of this UserDto. + + + :param containers: The containers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._containers = containers + + @property + def databases(self): + """Gets the databases of this UserDto. # noqa: E501 + + + :return: The databases of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this UserDto. + + + :param databases: The databases of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._databases = databases + + @property + def identifiers(self): + """Gets the identifiers of this UserDto. # noqa: E501 + + + :return: The identifiers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._identifiers + + @identifiers.setter + def identifiers(self, identifiers): + """Sets the identifiers of this UserDto. + + + :param identifiers: The identifiers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._identifiers = identifiers + + @property + def email(self): + """Gets the email of this UserDto. # noqa: E501 + + + :return: The email of this UserDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserDto. + + + :param email: The email of this UserDto. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def titles_before(self): + """Gets the titles_before of this UserDto. # noqa: E501 + + + :return: The titles_before of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserDto. + + + :param titles_before: The titles_before of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserDto. # noqa: E501 + + + :return: The titles_after of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserDto. + + + :param titles_after: The titles_after of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserDto. # noqa: E501 + + + :return: The theme_dark of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserDto. + + + :param theme_dark: The theme_dark of this UserDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserDto. # noqa: E501 + + + :return: The email_verified of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserDto. + + + :param email_verified: The email_verified of this UserDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserDto, 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, UserDto): + 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/swagger/api/api_query/models/view_brief_dto.py b/swagger/api/api_query/models/view_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..0022567a848f72a2e2d2ca7d2810b7396db528a7 --- /dev/null +++ b/swagger/api/api_query/models/view_brief_dto.py @@ -0,0 +1,324 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ViewBriefDto(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 = { + 'id': 'int', + 'vdbid': 'int', + 'name': 'str', + 'query': 'str', + 'created': 'datetime', + 'deleted': 'datetime', + 'is_public': 'bool', + 'initial_view': 'bool', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'vdbid': 'vdbid', + 'name': 'name', + 'query': 'query', + 'created': 'created', + 'deleted': 'deleted', + 'is_public': 'is_public', + 'initial_view': 'initial_view', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, vdbid=None, name=None, query=None, created=None, deleted=None, is_public=None, initial_view=None, last_modified=None): # noqa: E501 + """ViewBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._vdbid = None + self._name = None + self._query = None + self._created = None + self._deleted = None + self._is_public = None + self._initial_view = None + self._last_modified = None + self.discriminator = None + self.id = id + self.vdbid = vdbid + if name is not None: + self.name = name + self.query = query + self.created = created + if deleted is not None: + self.deleted = deleted + if is_public is not None: + self.is_public = is_public + if initial_view is not None: + self.initial_view = initial_view + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this ViewBriefDto. # noqa: E501 + + + :return: The id of this ViewBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ViewBriefDto. + + + :param id: The id of this ViewBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def vdbid(self): + """Gets the vdbid of this ViewBriefDto. # noqa: E501 + + + :return: The vdbid of this ViewBriefDto. # noqa: E501 + :rtype: int + """ + return self._vdbid + + @vdbid.setter + def vdbid(self, vdbid): + """Sets the vdbid of this ViewBriefDto. + + + :param vdbid: The vdbid of this ViewBriefDto. # noqa: E501 + :type: int + """ + if vdbid is None: + raise ValueError("Invalid value for `vdbid`, must not be `None`") # noqa: E501 + + self._vdbid = vdbid + + @property + def name(self): + """Gets the name of this ViewBriefDto. # noqa: E501 + + + :return: The name of this ViewBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ViewBriefDto. + + + :param name: The name of this ViewBriefDto. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def query(self): + """Gets the query of this ViewBriefDto. # noqa: E501 + + + :return: The query of this ViewBriefDto. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this ViewBriefDto. + + + :param query: The query of this ViewBriefDto. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def created(self): + """Gets the created of this ViewBriefDto. # noqa: E501 + + + :return: The created of this ViewBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ViewBriefDto. + + + :param created: The created of this ViewBriefDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def deleted(self): + """Gets the deleted of this ViewBriefDto. # noqa: E501 + + + :return: The deleted of this ViewBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this ViewBriefDto. + + + :param deleted: The deleted of this ViewBriefDto. # noqa: E501 + :type: datetime + """ + + self._deleted = deleted + + @property + def is_public(self): + """Gets the is_public of this ViewBriefDto. # noqa: E501 + + + :return: The is_public of this ViewBriefDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this ViewBriefDto. + + + :param is_public: The is_public of this ViewBriefDto. # noqa: E501 + :type: bool + """ + + self._is_public = is_public + + @property + def initial_view(self): + """Gets the initial_view of this ViewBriefDto. # noqa: E501 + + True if it is the default view for the database # noqa: E501 + + :return: The initial_view of this ViewBriefDto. # noqa: E501 + :rtype: bool + """ + return self._initial_view + + @initial_view.setter + def initial_view(self, initial_view): + """Sets the initial_view of this ViewBriefDto. + + True if it is the default view for the database # noqa: E501 + + :param initial_view: The initial_view of this ViewBriefDto. # noqa: E501 + :type: bool + """ + + self._initial_view = initial_view + + @property + def last_modified(self): + """Gets the last_modified of this ViewBriefDto. # noqa: E501 + + + :return: The last_modified of this ViewBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this ViewBriefDto. + + + :param last_modified: The last_modified of this ViewBriefDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + 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(ViewBriefDto, 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, ViewBriefDto): + 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/swagger/api/api_query/models/view_create_dto.py b/swagger/api/api_query/models/view_create_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ad46f9a3ed6900c1cbb3603f5c5fd71172438757 --- /dev/null +++ b/swagger/api/api_query/models/view_create_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ViewCreateDto(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 = { + 'name': 'str', + 'query': 'str', + 'is_public': 'bool' + } + + attribute_map = { + 'name': 'name', + 'query': 'query', + 'is_public': 'is_public' + } + + def __init__(self, name=None, query=None, is_public=None): # noqa: E501 + """ViewCreateDto - a model defined in Swagger""" # noqa: E501 + self._name = None + self._query = None + self._is_public = None + self.discriminator = None + self.name = name + self.query = query + self.is_public = is_public + + @property + def name(self): + """Gets the name of this ViewCreateDto. # noqa: E501 + + + :return: The name of this ViewCreateDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ViewCreateDto. + + + :param name: The name of this ViewCreateDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def query(self): + """Gets the query of this ViewCreateDto. # noqa: E501 + + + :return: The query of this ViewCreateDto. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this ViewCreateDto. + + + :param query: The query of this ViewCreateDto. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def is_public(self): + """Gets the is_public of this ViewCreateDto. # noqa: E501 + + + :return: The is_public of this ViewCreateDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this ViewCreateDto. + + + :param is_public: The is_public of this ViewCreateDto. # 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(ViewCreateDto, 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, ViewCreateDto): + 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/swagger/api/api_query/models/view_dto.py b/swagger/api/api_query/models/view_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..4b79b5c60a7e090eb3aad23583aa75d314cbf861 --- /dev/null +++ b/swagger/api/api_query/models/view_dto.py @@ -0,0 +1,379 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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 ViewDto(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 = { + 'id': 'int', + 'vdbid': 'int', + 'creator': 'UserDto', + 'database': 'DatabaseDto', + 'name': 'str', + 'query': 'str', + 'created': 'datetime', + 'deleted': 'datetime', + 'is_public': 'bool', + 'initial_view': 'bool', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'vdbid': 'vdbid', + 'creator': 'creator', + 'database': 'database', + 'name': 'name', + 'query': 'query', + 'created': 'created', + 'deleted': 'deleted', + 'is_public': 'is_public', + 'initial_view': 'initial_view', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, vdbid=None, creator=None, database=None, name=None, query=None, created=None, deleted=None, is_public=None, initial_view=None, last_modified=None): # noqa: E501 + """ViewDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._vdbid = None + self._creator = None + self._database = None + self._name = None + self._query = None + self._created = None + self._deleted = None + self._is_public = None + self._initial_view = None + self._last_modified = None + self.discriminator = None + self.id = id + self.vdbid = vdbid + self.creator = creator + self.database = database + self.name = name + self.query = query + self.created = created + if deleted is not None: + self.deleted = deleted + if is_public is not None: + self.is_public = is_public + if initial_view is not None: + self.initial_view = initial_view + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this ViewDto. # noqa: E501 + + + :return: The id of this ViewDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ViewDto. + + + :param id: The id of this ViewDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def vdbid(self): + """Gets the vdbid of this ViewDto. # noqa: E501 + + + :return: The vdbid of this ViewDto. # noqa: E501 + :rtype: int + """ + return self._vdbid + + @vdbid.setter + def vdbid(self, vdbid): + """Sets the vdbid of this ViewDto. + + + :param vdbid: The vdbid of this ViewDto. # noqa: E501 + :type: int + """ + if vdbid is None: + raise ValueError("Invalid value for `vdbid`, must not be `None`") # noqa: E501 + + self._vdbid = vdbid + + @property + def creator(self): + """Gets the creator of this ViewDto. # noqa: E501 + + + :return: The creator of this ViewDto. # noqa: E501 + :rtype: UserDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this ViewDto. + + + :param creator: The creator of this ViewDto. # noqa: E501 + :type: UserDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def database(self): + """Gets the database of this ViewDto. # noqa: E501 + + + :return: The database of this ViewDto. # noqa: E501 + :rtype: DatabaseDto + """ + return self._database + + @database.setter + def database(self, database): + """Sets the database of this ViewDto. + + + :param database: The database of this ViewDto. # noqa: E501 + :type: DatabaseDto + """ + if database is None: + raise ValueError("Invalid value for `database`, must not be `None`") # noqa: E501 + + self._database = database + + @property + def name(self): + """Gets the name of this ViewDto. # noqa: E501 + + + :return: The name of this ViewDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ViewDto. + + + :param name: The name of this ViewDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def query(self): + """Gets the query of this ViewDto. # noqa: E501 + + + :return: The query of this ViewDto. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this ViewDto. + + + :param query: The query of this ViewDto. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def created(self): + """Gets the created of this ViewDto. # noqa: E501 + + + :return: The created of this ViewDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ViewDto. + + + :param created: The created of this ViewDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def deleted(self): + """Gets the deleted of this ViewDto. # noqa: E501 + + + :return: The deleted of this ViewDto. # noqa: E501 + :rtype: datetime + """ + return self._deleted + + @deleted.setter + def deleted(self, deleted): + """Sets the deleted of this ViewDto. + + + :param deleted: The deleted of this ViewDto. # noqa: E501 + :type: datetime + """ + + self._deleted = deleted + + @property + def is_public(self): + """Gets the is_public of this ViewDto. # noqa: E501 + + + :return: The is_public of this ViewDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this ViewDto. + + + :param is_public: The is_public of this ViewDto. # noqa: E501 + :type: bool + """ + + self._is_public = is_public + + @property + def initial_view(self): + """Gets the initial_view of this ViewDto. # noqa: E501 + + True if it is the default view for the database # noqa: E501 + + :return: The initial_view of this ViewDto. # noqa: E501 + :rtype: bool + """ + return self._initial_view + + @initial_view.setter + def initial_view(self, initial_view): + """Sets the initial_view of this ViewDto. + + True if it is the default view for the database # noqa: E501 + + :param initial_view: The initial_view of this ViewDto. # noqa: E501 + :type: bool + """ + + self._initial_view = initial_view + + @property + def last_modified(self): + """Gets the last_modified of this ViewDto. # noqa: E501 + + + :return: The last_modified of this ViewDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this ViewDto. + + + :param last_modified: The last_modified of this ViewDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + 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(ViewDto, 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, ViewDto): + 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/swagger/api/api_query/rest.py b/swagger/api/api_query/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..ca858e0e27c750a6ab56fbc0451a091cd3b51818 --- /dev/null +++ b/swagger/api/api_query/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # 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/swagger/api/api_table/__init__.py b/swagger/api/api_table/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..37441edea5b7655b2a5337e45897d5860cd36e48 --- /dev/null +++ b/swagger/api/api_table/__init__.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Table Service API + + Service that manages the tables # 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_table.api.table_endpoint_api import TableEndpointApi +# import ApiClient +from api_table.api_client import ApiClient +from api_table.configuration import Configuration +# import models into sdk package +from api_table.models.api_error_dto import ApiErrorDto +from api_table.models.column_create_dto import ColumnCreateDto +from api_table.models.column_dto import ColumnDto +from api_table.models.concept_dto import ConceptDto +from api_table.models.image_date_dto import ImageDateDto +from api_table.models.table_brief_dto import TableBriefDto +from api_table.models.table_create_dto import TableCreateDto +from api_table.models.table_dto import TableDto +from api_table.models.user_brief_dto import UserBriefDto diff --git a/swagger/api/api_table/api/__init__.py b/swagger/api/api_table/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7ac1b66c4f54b7eab1ebc4b1898d33e21f56cb61 --- /dev/null +++ b/swagger/api/api_table/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_table.api.table_endpoint_api import TableEndpointApi diff --git a/swagger/api/api_table/api/table_endpoint_api.py b/swagger/api/api_table/api/table_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..55049efced3b3b4d48481955d940887bf2542a5c --- /dev/null +++ b/swagger/api/api_table/api/table_endpoint_api.py @@ -0,0 +1,590 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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_table.api_client import ApiClient + + +class TableEndpointApi(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 create(self, body, authorization, id, database_id, **kwargs): # noqa: E501 + """Create a table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create(body, authorization, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TableCreateDto body: (required) + :param str authorization: (required) + :param int id: (required) + :param int database_id: (required) + :return: TableBriefDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_with_http_info(body, authorization, id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.create_with_http_info(body, authorization, id, database_id, **kwargs) # noqa: E501 + return data + + def create_with_http_info(self, body, authorization, id, database_id, **kwargs): # noqa: E501 + """Create a table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_with_http_info(body, authorization, id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TableCreateDto body: (required) + :param str authorization: (required) + :param int id: (required) + :param int database_id: (required) + :return: TableBriefDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'authorization', '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 create" % 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 `create`") # noqa: E501 + # verify the required parameter 'authorization' is set + if ('authorization' not in params or + params['authorization'] is None): + raise ValueError("Missing the required parameter `authorization` when calling `create`") # 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 `create`") # 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 `create`") # 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 = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + + 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}/table', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TableBriefDto', # 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 delete(self, id, database_id, table_id, authorization, **kwargs): # noqa: E501 + """Delete a table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete(id, database_id, table_id, authorization, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param str authorization: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_with_http_info(id, database_id, table_id, authorization, **kwargs) # noqa: E501 + else: + (data) = self.delete_with_http_info(id, database_id, table_id, authorization, **kwargs) # noqa: E501 + return data + + def delete_with_http_info(self, id, database_id, table_id, authorization, **kwargs): # noqa: E501 + """Delete a table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_with_http_info(id, database_id, table_id, authorization, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param str authorization: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_id', 'authorization'] # 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 delete" % key + ) + params[key] = val + del params['kwargs'] + # 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 `delete`") # 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 `delete`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `delete`") # noqa: E501 + # verify the required parameter 'authorization' is set + if ('authorization' not in params or + params['authorization'] is None): + raise ValueError("Missing the required parameter `authorization` when calling `delete`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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 find_all(self, id, database_id, **kwargs): # noqa: E501 + """List all tables # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: list[TableBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + else: + (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + return data + + def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """List all tables # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_all_with_http_info(id, database_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :return: list[TableBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['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 find_all" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_all`") # 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 `find_all`") # 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 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[TableBriefDto]', # 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 find_by_id(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Get information about table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_by_id(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: TableDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_by_id_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.find_by_id_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def find_by_id_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Get information about table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_by_id_with_http_info(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: TableDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_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 find_by_id" % key + ) + params[key] = val + del params['kwargs'] + # 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 `find_by_id`") # 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 `find_by_id`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `find_by_id`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TableDto', # 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, id, database_id, table_id, **kwargs): # noqa: E501 + """Update a table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: TableBriefDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def update_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Update a table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_with_http_info(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: TableBriefDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_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 update" % key + ) + params[key] = val + del params['kwargs'] + # 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 `update`") # 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 `update`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `update`") # 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 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TableBriefDto', # 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/swagger/api/api_table/api_client.py b/swagger/api/api_table/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..ad7dbac3be914066b22d990599ece33392227a84 --- /dev/null +++ b/swagger/api/api_table/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Table Service API + + Service that manages the tables # 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_table.configuration import Configuration +import api_table.models +from api_table 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_table.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/swagger/api/api_table/configuration.py b/swagger/api/api_table/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..557adf4db5a7409e3736e03ecbe0380531dac8a6 --- /dev/null +++ b/swagger/api/api_table/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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_table") + 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/swagger/api/api_table/models/__init__.py b/swagger/api/api_table/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..65818bef09589a604af11a71cac062d8ca9b09de --- /dev/null +++ b/swagger/api/api_table/models/__init__.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Table Service API + + Service that manages the tables # 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_table.models.api_error_dto import ApiErrorDto +from api_table.models.column_create_dto import ColumnCreateDto +from api_table.models.column_dto import ColumnDto +from api_table.models.concept_dto import ConceptDto +from api_table.models.image_date_dto import ImageDateDto +from api_table.models.table_brief_dto import TableBriefDto +from api_table.models.table_create_dto import TableCreateDto +from api_table.models.table_dto import TableDto +from api_table.models.user_brief_dto import UserBriefDto diff --git a/swagger/api/api_table/models/api_error_dto.py b/swagger/api/api_table/models/api_error_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..a67060c6825f53ef2ffb421da1b1386269540ee2 --- /dev/null +++ b/swagger/api/api_table/models/api_error_dto.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 ApiErrorDto(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 = { + 'status': 'str', + 'message': 'str', + 'code': 'str' + } + + attribute_map = { + 'status': 'status', + 'message': 'message', + 'code': 'code' + } + + def __init__(self, status=None, message=None, code=None): # noqa: E501 + """ApiErrorDto - a model defined in Swagger""" # noqa: E501 + self._status = None + self._message = None + self._code = None + self.discriminator = None + self.status = status + self.message = message + self.code = code + + @property + def status(self): + """Gets the status of this ApiErrorDto. # noqa: E501 + + + :return: The status of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ApiErrorDto. + + + :param status: The status of this ApiErrorDto. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["100 CONTINUE", "101 SWITCHING_PROTOCOLS", "102 PROCESSING", "103 CHECKPOINT", "200 OK", "201 CREATED", "202 ACCEPTED", "203 NON_AUTHORITATIVE_INFORMATION", "204 NO_CONTENT", "205 RESET_CONTENT", "206 PARTIAL_CONTENT", "207 MULTI_STATUS", "208 ALREADY_REPORTED", "226 IM_USED", "300 MULTIPLE_CHOICES", "301 MOVED_PERMANENTLY", "302 FOUND", "302 MOVED_TEMPORARILY", "303 SEE_OTHER", "304 NOT_MODIFIED", "305 USE_PROXY", "307 TEMPORARY_REDIRECT", "308 PERMANENT_REDIRECT", "400 BAD_REQUEST", "401 UNAUTHORIZED", "402 PAYMENT_REQUIRED", "403 FORBIDDEN", "404 NOT_FOUND", "405 METHOD_NOT_ALLOWED", "406 NOT_ACCEPTABLE", "407 PROXY_AUTHENTICATION_REQUIRED", "408 REQUEST_TIMEOUT", "409 CONFLICT", "410 GONE", "411 LENGTH_REQUIRED", "412 PRECONDITION_FAILED", "413 PAYLOAD_TOO_LARGE", "413 REQUEST_ENTITY_TOO_LARGE", "414 URI_TOO_LONG", "414 REQUEST_URI_TOO_LONG", "415 UNSUPPORTED_MEDIA_TYPE", "416 REQUESTED_RANGE_NOT_SATISFIABLE", "417 EXPECTATION_FAILED", "418 I_AM_A_TEAPOT", "419 INSUFFICIENT_SPACE_ON_RESOURCE", "420 METHOD_FAILURE", "421 DESTINATION_LOCKED", "422 UNPROCESSABLE_ENTITY", "423 LOCKED", "424 FAILED_DEPENDENCY", "425 TOO_EARLY", "426 UPGRADE_REQUIRED", "428 PRECONDITION_REQUIRED", "429 TOO_MANY_REQUESTS", "431 REQUEST_HEADER_FIELDS_TOO_LARGE", "451 UNAVAILABLE_FOR_LEGAL_REASONS", "500 INTERNAL_SERVER_ERROR", "501 NOT_IMPLEMENTED", "502 BAD_GATEWAY", "503 SERVICE_UNAVAILABLE", "504 GATEWAY_TIMEOUT", "505 HTTP_VERSION_NOT_SUPPORTED", "506 VARIANT_ALSO_NEGOTIATES", "507 INSUFFICIENT_STORAGE", "508 LOOP_DETECTED", "509 BANDWIDTH_LIMIT_EXCEEDED", "510 NOT_EXTENDED", "511 NETWORK_AUTHENTICATION_REQUIRED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def message(self): + """Gets the message of this ApiErrorDto. # noqa: E501 + + + :return: The message of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiErrorDto. + + + :param message: The message of this ApiErrorDto. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def code(self): + """Gets the code of this ApiErrorDto. # noqa: E501 + + + :return: The code of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiErrorDto. + + + :param code: The code of this ApiErrorDto. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + 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(ApiErrorDto, 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, ApiErrorDto): + 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/swagger/api/api_table/models/column_create_dto.py b/swagger/api/api_table/models/column_create_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..5c14839dd9683c72ffe8de93612c9c5944a723e0 --- /dev/null +++ b/swagger/api/api_table/models/column_create_dto.py @@ -0,0 +1,357 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 ColumnCreateDto(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 = { + 'name': 'str', + 'type': 'str', + 'dfid': 'int', + 'unique': 'bool', + 'references': 'str', + 'primary_key': 'bool', + 'null_allowed': 'bool', + 'check_expression': 'str', + 'foreign_key': 'str', + 'enum_values': 'list[str]' + } + + attribute_map = { + 'name': 'name', + 'type': 'type', + 'dfid': 'dfid', + 'unique': 'unique', + 'references': 'references', + 'primary_key': 'primary_key', + 'null_allowed': 'null_allowed', + 'check_expression': 'check_expression', + 'foreign_key': 'foreign_key', + 'enum_values': 'enum_values' + } + + def __init__(self, name=None, type=None, dfid=None, unique=None, references=None, primary_key=None, null_allowed=None, check_expression=None, foreign_key=None, enum_values=None): # noqa: E501 + """ColumnCreateDto - a model defined in Swagger""" # noqa: E501 + self._name = None + self._type = None + self._dfid = None + self._unique = None + self._references = None + self._primary_key = None + self._null_allowed = None + self._check_expression = None + self._foreign_key = None + self._enum_values = None + self.discriminator = None + self.name = name + self.type = type + if dfid is not None: + self.dfid = dfid + self.unique = unique + if references is not None: + self.references = references + self.primary_key = primary_key + self.null_allowed = null_allowed + if check_expression is not None: + self.check_expression = check_expression + if foreign_key is not None: + self.foreign_key = foreign_key + if enum_values is not None: + self.enum_values = enum_values + + @property + def name(self): + """Gets the name of this ColumnCreateDto. # noqa: E501 + + + :return: The name of this ColumnCreateDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ColumnCreateDto. + + + :param name: The name of this ColumnCreateDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def type(self): + """Gets the type of this ColumnCreateDto. # noqa: E501 + + + :return: The type of this ColumnCreateDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ColumnCreateDto. + + + :param type: The type of this ColumnCreateDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["enum", "number", "decimal", "string", "text", "boolean", "date", "timestamp", "blob"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def dfid(self): + """Gets the dfid of this ColumnCreateDto. # noqa: E501 + + date format id # noqa: E501 + + :return: The dfid of this ColumnCreateDto. # noqa: E501 + :rtype: int + """ + return self._dfid + + @dfid.setter + def dfid(self, dfid): + """Sets the dfid of this ColumnCreateDto. + + date format id # noqa: E501 + + :param dfid: The dfid of this ColumnCreateDto. # noqa: E501 + :type: int + """ + + self._dfid = dfid + + @property + def unique(self): + """Gets the unique of this ColumnCreateDto. # noqa: E501 + + + :return: The unique of this ColumnCreateDto. # noqa: E501 + :rtype: bool + """ + return self._unique + + @unique.setter + def unique(self, unique): + """Sets the unique of this ColumnCreateDto. + + + :param unique: The unique of this ColumnCreateDto. # noqa: E501 + :type: bool + """ + if unique is None: + raise ValueError("Invalid value for `unique`, must not be `None`") # noqa: E501 + + self._unique = unique + + @property + def references(self): + """Gets the references of this ColumnCreateDto. # noqa: E501 + + + :return: The references of this ColumnCreateDto. # noqa: E501 + :rtype: str + """ + return self._references + + @references.setter + def references(self, references): + """Sets the references of this ColumnCreateDto. + + + :param references: The references of this ColumnCreateDto. # noqa: E501 + :type: str + """ + + self._references = references + + @property + def primary_key(self): + """Gets the primary_key of this ColumnCreateDto. # noqa: E501 + + + :return: The primary_key of this ColumnCreateDto. # noqa: E501 + :rtype: bool + """ + return self._primary_key + + @primary_key.setter + def primary_key(self, primary_key): + """Sets the primary_key of this ColumnCreateDto. + + + :param primary_key: The primary_key of this ColumnCreateDto. # noqa: E501 + :type: bool + """ + if primary_key is None: + raise ValueError("Invalid value for `primary_key`, must not be `None`") # noqa: E501 + + self._primary_key = primary_key + + @property + def null_allowed(self): + """Gets the null_allowed of this ColumnCreateDto. # noqa: E501 + + + :return: The null_allowed of this ColumnCreateDto. # noqa: E501 + :rtype: bool + """ + return self._null_allowed + + @null_allowed.setter + def null_allowed(self, null_allowed): + """Sets the null_allowed of this ColumnCreateDto. + + + :param null_allowed: The null_allowed of this ColumnCreateDto. # noqa: E501 + :type: bool + """ + if null_allowed is None: + raise ValueError("Invalid value for `null_allowed`, must not be `None`") # noqa: E501 + + self._null_allowed = null_allowed + + @property + def check_expression(self): + """Gets the check_expression of this ColumnCreateDto. # noqa: E501 + + + :return: The check_expression of this ColumnCreateDto. # noqa: E501 + :rtype: str + """ + return self._check_expression + + @check_expression.setter + def check_expression(self, check_expression): + """Sets the check_expression of this ColumnCreateDto. + + + :param check_expression: The check_expression of this ColumnCreateDto. # noqa: E501 + :type: str + """ + + self._check_expression = check_expression + + @property + def foreign_key(self): + """Gets the foreign_key of this ColumnCreateDto. # noqa: E501 + + + :return: The foreign_key of this ColumnCreateDto. # noqa: E501 + :rtype: str + """ + return self._foreign_key + + @foreign_key.setter + def foreign_key(self, foreign_key): + """Sets the foreign_key of this ColumnCreateDto. + + + :param foreign_key: The foreign_key of this ColumnCreateDto. # noqa: E501 + :type: str + """ + + self._foreign_key = foreign_key + + @property + def enum_values(self): + """Gets the enum_values of this ColumnCreateDto. # noqa: E501 + + + :return: The enum_values of this ColumnCreateDto. # noqa: E501 + :rtype: list[str] + """ + return self._enum_values + + @enum_values.setter + def enum_values(self, enum_values): + """Sets the enum_values of this ColumnCreateDto. + + + :param enum_values: The enum_values of this ColumnCreateDto. # noqa: E501 + :type: list[str] + """ + + self._enum_values = enum_values + + 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(ColumnCreateDto, 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, ColumnCreateDto): + 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/swagger/api/api_table/models/column_dto.py b/swagger/api/api_table/models/column_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..08c3ab7a70536b6fec106d21b598225f2da9369e --- /dev/null +++ b/swagger/api/api_table/models/column_dto.py @@ -0,0 +1,462 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 ColumnDto(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 = { + 'id': 'int', + 'name': 'str', + 'unique': 'bool', + 'references': 'str', + 'internal_name': 'str', + 'date_format': 'ImageDateDto', + 'auto_generated': 'bool', + 'is_primary_key': 'bool', + 'column_type': 'str', + 'column_concept': 'ConceptDto', + 'is_null_allowed': 'bool', + 'check_expression': 'str', + 'foreign_key': 'str', + 'enum_values': 'list[str]' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'unique': 'unique', + 'references': 'references', + 'internal_name': 'internal_name', + 'date_format': 'date_format', + 'auto_generated': 'auto_generated', + 'is_primary_key': 'is_primary_key', + 'column_type': 'column_type', + 'column_concept': 'column_concept', + 'is_null_allowed': 'is_null_allowed', + 'check_expression': 'check_expression', + 'foreign_key': 'foreign_key', + 'enum_values': 'enum_values' + } + + def __init__(self, id=None, name=None, unique=None, references=None, internal_name=None, date_format=None, auto_generated=None, is_primary_key=None, column_type=None, column_concept=None, is_null_allowed=None, check_expression=None, foreign_key=None, enum_values=None): # noqa: E501 + """ColumnDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._unique = None + self._references = None + self._internal_name = None + self._date_format = None + self._auto_generated = None + self._is_primary_key = None + self._column_type = None + self._column_concept = None + self._is_null_allowed = None + self._check_expression = None + self._foreign_key = None + self._enum_values = None + self.discriminator = None + self.id = id + self.name = name + self.unique = unique + if references is not None: + self.references = references + self.internal_name = internal_name + if date_format is not None: + self.date_format = date_format + self.auto_generated = auto_generated + self.is_primary_key = is_primary_key + self.column_type = column_type + if column_concept is not None: + self.column_concept = column_concept + self.is_null_allowed = is_null_allowed + if check_expression is not None: + self.check_expression = check_expression + if foreign_key is not None: + self.foreign_key = foreign_key + if enum_values is not None: + self.enum_values = enum_values + + @property + def id(self): + """Gets the id of this ColumnDto. # noqa: E501 + + + :return: The id of this ColumnDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ColumnDto. + + + :param id: The id of this ColumnDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this ColumnDto. # noqa: E501 + + + :return: The name of this ColumnDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ColumnDto. + + + :param name: The name of this ColumnDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def unique(self): + """Gets the unique of this ColumnDto. # noqa: E501 + + + :return: The unique of this ColumnDto. # noqa: E501 + :rtype: bool + """ + return self._unique + + @unique.setter + def unique(self, unique): + """Sets the unique of this ColumnDto. + + + :param unique: The unique of this ColumnDto. # noqa: E501 + :type: bool + """ + if unique is None: + raise ValueError("Invalid value for `unique`, must not be `None`") # noqa: E501 + + self._unique = unique + + @property + def references(self): + """Gets the references of this ColumnDto. # noqa: E501 + + + :return: The references of this ColumnDto. # noqa: E501 + :rtype: str + """ + return self._references + + @references.setter + def references(self, references): + """Sets the references of this ColumnDto. + + + :param references: The references of this ColumnDto. # noqa: E501 + :type: str + """ + + self._references = references + + @property + def internal_name(self): + """Gets the internal_name of this ColumnDto. # noqa: E501 + + + :return: The internal_name of this ColumnDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ColumnDto. + + + :param internal_name: The internal_name of this ColumnDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + @property + def date_format(self): + """Gets the date_format of this ColumnDto. # noqa: E501 + + + :return: The date_format of this ColumnDto. # noqa: E501 + :rtype: ImageDateDto + """ + return self._date_format + + @date_format.setter + def date_format(self, date_format): + """Sets the date_format of this ColumnDto. + + + :param date_format: The date_format of this ColumnDto. # noqa: E501 + :type: ImageDateDto + """ + + self._date_format = date_format + + @property + def auto_generated(self): + """Gets the auto_generated of this ColumnDto. # noqa: E501 + + + :return: The auto_generated of this ColumnDto. # noqa: E501 + :rtype: bool + """ + return self._auto_generated + + @auto_generated.setter + def auto_generated(self, auto_generated): + """Sets the auto_generated of this ColumnDto. + + + :param auto_generated: The auto_generated of this ColumnDto. # noqa: E501 + :type: bool + """ + if auto_generated is None: + raise ValueError("Invalid value for `auto_generated`, must not be `None`") # noqa: E501 + + self._auto_generated = auto_generated + + @property + def is_primary_key(self): + """Gets the is_primary_key of this ColumnDto. # noqa: E501 + + + :return: The is_primary_key of this ColumnDto. # noqa: E501 + :rtype: bool + """ + return self._is_primary_key + + @is_primary_key.setter + def is_primary_key(self, is_primary_key): + """Sets the is_primary_key of this ColumnDto. + + + :param is_primary_key: The is_primary_key of this ColumnDto. # noqa: E501 + :type: bool + """ + if is_primary_key is None: + raise ValueError("Invalid value for `is_primary_key`, must not be `None`") # noqa: E501 + + self._is_primary_key = is_primary_key + + @property + def column_type(self): + """Gets the column_type of this ColumnDto. # noqa: E501 + + + :return: The column_type of this ColumnDto. # noqa: E501 + :rtype: str + """ + return self._column_type + + @column_type.setter + def column_type(self, column_type): + """Sets the column_type of this ColumnDto. + + + :param column_type: The column_type of this ColumnDto. # noqa: E501 + :type: str + """ + if column_type is None: + raise ValueError("Invalid value for `column_type`, must not be `None`") # noqa: E501 + allowed_values = ["enum", "number", "decimal", "string", "text", "boolean", "date", "timestamp", "blob"] # noqa: E501 + if column_type not in allowed_values: + raise ValueError( + "Invalid value for `column_type` ({0}), must be one of {1}" # noqa: E501 + .format(column_type, allowed_values) + ) + + self._column_type = column_type + + @property + def column_concept(self): + """Gets the column_concept of this ColumnDto. # noqa: E501 + + + :return: The column_concept of this ColumnDto. # noqa: E501 + :rtype: ConceptDto + """ + return self._column_concept + + @column_concept.setter + def column_concept(self, column_concept): + """Sets the column_concept of this ColumnDto. + + + :param column_concept: The column_concept of this ColumnDto. # noqa: E501 + :type: ConceptDto + """ + + self._column_concept = column_concept + + @property + def is_null_allowed(self): + """Gets the is_null_allowed of this ColumnDto. # noqa: E501 + + + :return: The is_null_allowed of this ColumnDto. # noqa: E501 + :rtype: bool + """ + return self._is_null_allowed + + @is_null_allowed.setter + def is_null_allowed(self, is_null_allowed): + """Sets the is_null_allowed of this ColumnDto. + + + :param is_null_allowed: The is_null_allowed of this ColumnDto. # noqa: E501 + :type: bool + """ + if is_null_allowed is None: + raise ValueError("Invalid value for `is_null_allowed`, must not be `None`") # noqa: E501 + + self._is_null_allowed = is_null_allowed + + @property + def check_expression(self): + """Gets the check_expression of this ColumnDto. # noqa: E501 + + + :return: The check_expression of this ColumnDto. # noqa: E501 + :rtype: str + """ + return self._check_expression + + @check_expression.setter + def check_expression(self, check_expression): + """Sets the check_expression of this ColumnDto. + + + :param check_expression: The check_expression of this ColumnDto. # noqa: E501 + :type: str + """ + + self._check_expression = check_expression + + @property + def foreign_key(self): + """Gets the foreign_key of this ColumnDto. # noqa: E501 + + + :return: The foreign_key of this ColumnDto. # noqa: E501 + :rtype: str + """ + return self._foreign_key + + @foreign_key.setter + def foreign_key(self, foreign_key): + """Sets the foreign_key of this ColumnDto. + + + :param foreign_key: The foreign_key of this ColumnDto. # noqa: E501 + :type: str + """ + + self._foreign_key = foreign_key + + @property + def enum_values(self): + """Gets the enum_values of this ColumnDto. # noqa: E501 + + + :return: The enum_values of this ColumnDto. # noqa: E501 + :rtype: list[str] + """ + return self._enum_values + + @enum_values.setter + def enum_values(self, enum_values): + """Sets the enum_values of this ColumnDto. + + + :param enum_values: The enum_values of this ColumnDto. # noqa: E501 + :type: list[str] + """ + + self._enum_values = enum_values + + 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(ColumnDto, 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, ColumnDto): + 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/swagger/api/api_table/models/concept_dto.py b/swagger/api/api_table/models/concept_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..7e02a3ae796b19f32d86795638fdbbbf467a3f3d --- /dev/null +++ b/swagger/api/api_table/models/concept_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 ConceptDto(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 = { + 'uri': 'str', + 'name': 'str', + 'created': 'datetime' + } + + attribute_map = { + 'uri': 'uri', + 'name': 'name', + 'created': 'created' + } + + def __init__(self, uri=None, name=None, created=None): # noqa: E501 + """ConceptDto - a model defined in Swagger""" # noqa: E501 + self._uri = None + self._name = None + self._created = None + self.discriminator = None + self.uri = uri + self.name = name + self.created = created + + @property + def uri(self): + """Gets the uri of this ConceptDto. # noqa: E501 + + + :return: The uri of this ConceptDto. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this ConceptDto. + + + :param uri: The uri of this ConceptDto. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + @property + def name(self): + """Gets the name of this ConceptDto. # noqa: E501 + + + :return: The name of this ConceptDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConceptDto. + + + :param name: The name of this ConceptDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def created(self): + """Gets the created of this ConceptDto. # noqa: E501 + + + :return: The created of this ConceptDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ConceptDto. + + + :param created: The created of this ConceptDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + 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(ConceptDto, 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, ConceptDto): + 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/swagger/api/api_table/models/image_date_dto.py b/swagger/api/api_table/models/image_date_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..7550028900c37eee6f432eb1e8278b9a36a47504 --- /dev/null +++ b/swagger/api/api_table/models/image_date_dto.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 ImageDateDto(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 = { + 'id': 'int', + 'example': 'str', + 'database_format': 'str', + 'unix_format': 'str', + 'has_time': 'bool', + 'created_at': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'example': 'example', + 'database_format': 'database_format', + 'unix_format': 'unix_format', + 'has_time': 'has_time', + 'created_at': 'created_at' + } + + def __init__(self, id=None, example=None, database_format=None, unix_format=None, has_time=None, created_at=None): # noqa: E501 + """ImageDateDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._example = None + self._database_format = None + self._unix_format = None + self._has_time = None + self._created_at = None + self.discriminator = None + self.id = id + self.example = example + self.database_format = database_format + self.unix_format = unix_format + self.has_time = has_time + if created_at is not None: + self.created_at = created_at + + @property + def id(self): + """Gets the id of this ImageDateDto. # noqa: E501 + + + :return: The id of this ImageDateDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDateDto. + + + :param id: The id of this ImageDateDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def example(self): + """Gets the example of this ImageDateDto. # noqa: E501 + + + :return: The example of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._example + + @example.setter + def example(self, example): + """Sets the example of this ImageDateDto. + + + :param example: The example of this ImageDateDto. # noqa: E501 + :type: str + """ + if example is None: + raise ValueError("Invalid value for `example`, must not be `None`") # noqa: E501 + + self._example = example + + @property + def database_format(self): + """Gets the database_format of this ImageDateDto. # noqa: E501 + + + :return: The database_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._database_format + + @database_format.setter + def database_format(self, database_format): + """Sets the database_format of this ImageDateDto. + + + :param database_format: The database_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if database_format is None: + raise ValueError("Invalid value for `database_format`, must not be `None`") # noqa: E501 + + self._database_format = database_format + + @property + def unix_format(self): + """Gets the unix_format of this ImageDateDto. # noqa: E501 + + + :return: The unix_format of this ImageDateDto. # noqa: E501 + :rtype: str + """ + return self._unix_format + + @unix_format.setter + def unix_format(self, unix_format): + """Sets the unix_format of this ImageDateDto. + + + :param unix_format: The unix_format of this ImageDateDto. # noqa: E501 + :type: str + """ + if unix_format is None: + raise ValueError("Invalid value for `unix_format`, must not be `None`") # noqa: E501 + + self._unix_format = unix_format + + @property + def has_time(self): + """Gets the has_time of this ImageDateDto. # noqa: E501 + + + :return: The has_time of this ImageDateDto. # noqa: E501 + :rtype: bool + """ + return self._has_time + + @has_time.setter + def has_time(self, has_time): + """Sets the has_time of this ImageDateDto. + + + :param has_time: The has_time of this ImageDateDto. # noqa: E501 + :type: bool + """ + if has_time is None: + raise ValueError("Invalid value for `has_time`, must not be `None`") # noqa: E501 + + self._has_time = has_time + + @property + def created_at(self): + """Gets the created_at of this ImageDateDto. # noqa: E501 + + + :return: The created_at of this ImageDateDto. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ImageDateDto. + + + :param created_at: The created_at of this ImageDateDto. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + 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(ImageDateDto, 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, ImageDateDto): + 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/swagger/api/api_table/models/table_brief_dto.py b/swagger/api/api_table/models/table_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..a811499bd935581d4021a5783ffd3c5490a9907c --- /dev/null +++ b/swagger/api/api_table/models/table_brief_dto.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 TableBriefDto(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 = { + 'id': 'int', + 'name': 'str', + 'creator': 'UserBriefDto', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator': 'creator', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + """TableBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._creator = None + self._internal_name = None + self.discriminator = None + self.id = id + self.name = name + self.creator = creator + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this TableBriefDto. # noqa: E501 + + + :return: The id of this TableBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TableBriefDto. + + + :param id: The id of this TableBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this TableBriefDto. # noqa: E501 + + + :return: The name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TableBriefDto. + + + :param name: The name of this TableBriefDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this TableBriefDto. # noqa: E501 + + + :return: The creator of this TableBriefDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this TableBriefDto. + + + :param creator: The creator of this TableBriefDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def internal_name(self): + """Gets the internal_name of this TableBriefDto. # noqa: E501 + + + :return: The internal_name of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this TableBriefDto. + + + :param internal_name: The internal_name of this TableBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(TableBriefDto, 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, TableBriefDto): + 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/swagger/api/api_table/models/table_create_dto.py b/swagger/api/api_table/models/table_create_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..b80fd32e1fc602b5834e167df02cf02a5dc12c3a --- /dev/null +++ b/swagger/api/api_table/models/table_create_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 TableCreateDto(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 = { + 'name': 'str', + 'description': 'str', + 'columns': 'list[ColumnCreateDto]' + } + + attribute_map = { + 'name': 'name', + 'description': 'description', + 'columns': 'columns' + } + + def __init__(self, name=None, description=None, columns=None): # noqa: E501 + """TableCreateDto - a model defined in Swagger""" # noqa: E501 + self._name = None + self._description = None + self._columns = None + self.discriminator = None + self.name = name + self.description = description + self.columns = columns + + @property + def name(self): + """Gets the name of this TableCreateDto. # noqa: E501 + + + :return: The name of this TableCreateDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TableCreateDto. + + + :param name: The name of this TableCreateDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def description(self): + """Gets the description of this TableCreateDto. # noqa: E501 + + + :return: The description of this TableCreateDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TableCreateDto. + + + :param description: The description of this TableCreateDto. # 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 columns(self): + """Gets the columns of this TableCreateDto. # noqa: E501 + + + :return: The columns of this TableCreateDto. # noqa: E501 + :rtype: list[ColumnCreateDto] + """ + return self._columns + + @columns.setter + def columns(self, columns): + """Sets the columns of this TableCreateDto. + + + :param columns: The columns of this TableCreateDto. # noqa: E501 + :type: list[ColumnCreateDto] + """ + if columns is None: + raise ValueError("Invalid value for `columns`, must not be `None`") # noqa: E501 + + self._columns = columns + + 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(TableCreateDto, 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, TableCreateDto): + 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/swagger/api/api_table/models/table_dto.py b/swagger/api/api_table/models/table_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..00af01d052aaddfcda9f0b561dd283325fcd43bd --- /dev/null +++ b/swagger/api/api_table/models/table_dto.py @@ -0,0 +1,299 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 TableDto(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 = { + 'id': 'int', + 'name': 'str', + 'creator': 'UserBriefDto', + 'topic': 'str', + 'description': 'str', + 'created': 'datetime', + 'columns': 'list[ColumnDto]', + 'internal_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator': 'creator', + 'topic': 'topic', + 'description': 'description', + 'created': 'created', + 'columns': 'columns', + 'internal_name': 'internal_name' + } + + def __init__(self, id=None, name=None, creator=None, topic=None, description=None, created=None, columns=None, internal_name=None): # noqa: E501 + """TableDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._creator = None + self._topic = None + self._description = None + self._created = None + self._columns = None + self._internal_name = None + self.discriminator = None + self.id = id + self.name = name + self.creator = creator + self.topic = topic + self.description = description + if created is not None: + self.created = created + self.columns = columns + self.internal_name = internal_name + + @property + def id(self): + """Gets the id of this TableDto. # noqa: E501 + + + :return: The id of this TableDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TableDto. + + + :param id: The id of this TableDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this TableDto. # noqa: E501 + + + :return: The name of this TableDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TableDto. + + + :param name: The name of this TableDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this TableDto. # noqa: E501 + + + :return: The creator of this TableDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this TableDto. + + + :param creator: The creator of this TableDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def topic(self): + """Gets the topic of this TableDto. # noqa: E501 + + + :return: The topic of this TableDto. # noqa: E501 + :rtype: str + """ + return self._topic + + @topic.setter + def topic(self, topic): + """Sets the topic of this TableDto. + + + :param topic: The topic of this TableDto. # noqa: E501 + :type: str + """ + if topic is None: + raise ValueError("Invalid value for `topic`, must not be `None`") # noqa: E501 + + self._topic = topic + + @property + def description(self): + """Gets the description of this TableDto. # noqa: E501 + + + :return: The description of this TableDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TableDto. + + + :param description: The description of this TableDto. # 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 created(self): + """Gets the created of this TableDto. # noqa: E501 + + + :return: The created of this TableDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this TableDto. + + + :param created: The created of this TableDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def columns(self): + """Gets the columns of this TableDto. # noqa: E501 + + + :return: The columns of this TableDto. # noqa: E501 + :rtype: list[ColumnDto] + """ + return self._columns + + @columns.setter + def columns(self, columns): + """Sets the columns of this TableDto. + + + :param columns: The columns of this TableDto. # noqa: E501 + :type: list[ColumnDto] + """ + if columns is None: + raise ValueError("Invalid value for `columns`, must not be `None`") # noqa: E501 + + self._columns = columns + + @property + def internal_name(self): + """Gets the internal_name of this TableDto. # noqa: E501 + + + :return: The internal_name of this TableDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this TableDto. + + + :param internal_name: The internal_name of this TableDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + 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(TableDto, 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, TableDto): + 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/swagger/api/api_table/models/user_brief_dto.py b/swagger/api/api_table/models/user_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..ed701ff11ae01e4d93dab071529b088e3c330ae9 --- /dev/null +++ b/swagger/api/api_table/models/user_brief_dto.py @@ -0,0 +1,350 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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 UserBriefDto(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 = { + 'id': 'int', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserBriefDto. # noqa: E501 + + + :return: The id of this UserBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserBriefDto. + + + :param id: The id of this UserBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def username(self): + """Gets the username of this UserBriefDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserBriefDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserBriefDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserBriefDto. # noqa: E501 + + + :return: The firstname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserBriefDto. + + + :param firstname: The firstname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserBriefDto. # noqa: E501 + + + :return: The lastname of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserBriefDto. + + + :param lastname: The lastname of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserBriefDto. # noqa: E501 + + + :return: The affiliation of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserBriefDto. + + + :param affiliation: The affiliation of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserBriefDto. # noqa: E501 + + + :return: The orcid of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserBriefDto. + + + :param orcid: The orcid of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserBriefDto. # noqa: E501 + + + :return: The theme_dark of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserBriefDto. + + + :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserBriefDto. # noqa: E501 + + + :return: The email_verified of this UserBriefDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserBriefDto. + + + :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + 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(UserBriefDto, 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, UserBriefDto): + 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/swagger/api/api_table/rest.py b/swagger/api/api_table/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..6796e1ae47c980a57126ed5dd684a10cd09e3e00 --- /dev/null +++ b/swagger/api/api_table/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # 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/swagger/api/api_units/__init__.py b/swagger/api/api_units/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4c957b741e1db37d91b16cf96b692225e94af901 --- /dev/null +++ b/swagger/api/api_units/__init__.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +# flake8: noqa + +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import apis into sdk package +from api_units.api.default_api import DefaultApi +# import ApiClient +from api_units.api_client import ApiClient +from api_units.configuration import Configuration +# import models into sdk package +from api_units.models.units_savecolumnsconcept_body import UnitsSavecolumnsconceptBody +from api_units.models.units_saveconcept_body import UnitsSaveconceptBody +from api_units.models.units_suggest_body import UnitsSuggestBody diff --git a/swagger/api/api_units/api/__init__.py b/swagger/api/api_units/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e0a0fa250b70cb3f7dea9bcc5941dea5a85d763f --- /dev/null +++ b/swagger/api/api_units/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_units.api.default_api import DefaultApi diff --git a/swagger/api/api_units/api/default_api.py b/swagger/api/api_units/api/default_api.py new file mode 100644 index 0000000000000000000000000000000000000000..9de20b4fd5c4600ed24a84f4255b683d99b77536 --- /dev/null +++ b/swagger/api/api_units/api/default_api.py @@ -0,0 +1,500 @@ +# coding: utf-8 + +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + 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_units.api_client import ApiClient + + +class DefaultApi(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 api_units_savecolumnsconcept_post(self, body, **kwargs): # noqa: E501 + """Save concepts to MDB # noqa: E501 + + This is a simple API for saving units and concepts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_savecolumnsconcept_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UnitsSavecolumnsconceptBody body: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_units_savecolumnsconcept_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.api_units_savecolumnsconcept_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def api_units_savecolumnsconcept_post_with_http_info(self, body, **kwargs): # noqa: E501 + """Save concepts to MDB # noqa: E501 + + This is a simple API for saving units and concepts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_savecolumnsconcept_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UnitsSavecolumnsconceptBody body: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 api_units_savecolumnsconcept_post" % 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 `api_units_savecolumnsconcept_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/units/savecolumnsconcept', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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 api_units_saveconcept_post(self, body, **kwargs): # noqa: E501 + """Save concepts to MDB # noqa: E501 + + This is a simple API for saving units and concepts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_saveconcept_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UnitsSaveconceptBody body: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_units_saveconcept_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.api_units_saveconcept_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def api_units_saveconcept_post_with_http_info(self, body, **kwargs): # noqa: E501 + """Save concepts to MDB # noqa: E501 + + This is a simple API for saving units and concepts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_saveconcept_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UnitsSaveconceptBody body: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 api_units_saveconcept_post" % 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 `api_units_saveconcept_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/units/saveconcept', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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 api_units_suggest_post(self, body, **kwargs): # noqa: E501 + """Autosuggest units # noqa: E501 + + This is a simple API which returns a list of suggested units. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_suggest_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UnitsSuggestBody body: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_units_suggest_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.api_units_suggest_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def api_units_suggest_post_with_http_info(self, body, **kwargs): # noqa: E501 + """Autosuggest units # noqa: E501 + + This is a simple API which returns a list of suggested units. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_suggest_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UnitsSuggestBody body: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # 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 api_units_suggest_post" % 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 `api_units_suggest_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/units/suggest', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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 api_units_uri_uname_get(self, uname, **kwargs): # noqa: E501 + """Get URI of units # noqa: E501 + + This is a simple API for getting the URI of a certain unit in OM. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_uri_uname_get(uname, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uname: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_units_uri_uname_get_with_http_info(uname, **kwargs) # noqa: E501 + else: + (data) = self.api_units_uri_uname_get_with_http_info(uname, **kwargs) # noqa: E501 + return data + + def api_units_uri_uname_get_with_http_info(self, uname, **kwargs): # noqa: E501 + """Get URI of units # noqa: E501 + + This is a simple API for getting the URI of a certain unit in OM. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_uri_uname_get_with_http_info(uname, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uname: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uname'] # 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 api_units_uri_uname_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uname' is set + if ('uname' not in params or + params['uname'] is None): + raise ValueError("Missing the required parameter `uname` when calling `api_units_uri_uname_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uname' in params: + path_params['uname'] = params['uname'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/units/uri/{uname}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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 api_units_validate_unit_get(self, unit, **kwargs): # noqa: E501 + """Validate units # noqa: E501 + + This is a simple API for validating units. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_validate_unit_get(unit, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str unit: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_units_validate_unit_get_with_http_info(unit, **kwargs) # noqa: E501 + else: + (data) = self.api_units_validate_unit_get_with_http_info(unit, **kwargs) # noqa: E501 + return data + + def api_units_validate_unit_get_with_http_info(self, unit, **kwargs): # noqa: E501 + """Validate units # noqa: E501 + + This is a simple API for validating units. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_units_validate_unit_get_with_http_info(unit, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str unit: to-do description (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['unit'] # 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 api_units_validate_unit_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'unit' is set + if ('unit' not in params or + params['unit'] is None): + raise ValueError("Missing the required parameter `unit` when calling `api_units_validate_unit_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'unit' in params: + path_params['unit'] = params['unit'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/units/validate/{unit}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # 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/swagger/api/api_units/api_client.py b/swagger/api/api_units/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..36201d73283cdae2ea1e5cfb656c63a6de6f74d8 --- /dev/null +++ b/swagger/api/api_units/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + 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_units.configuration import Configuration +import api_units.models +from api_units 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_units.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/swagger/api/api_units/configuration.py b/swagger/api/api_units/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..d9746a635357a967d7864586c7e7f480262dba9b --- /dev/null +++ b/swagger/api/api_units/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + 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_units") + 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: 0.0.1\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/swagger/api/api_units/models/__init__.py b/swagger/api/api_units/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..08e7322d4595851ab810ec897cd98917b07fdeb2 --- /dev/null +++ b/swagger/api/api_units/models/__init__.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +# flake8: noqa +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import models into model package +from api_units.models.units_savecolumnsconcept_body import UnitsSavecolumnsconceptBody +from api_units.models.units_saveconcept_body import UnitsSaveconceptBody +from api_units.models.units_suggest_body import UnitsSuggestBody diff --git a/swagger/api/api_units/models/units_savecolumnsconcept_body.py b/swagger/api/api_units/models/units_savecolumnsconcept_body.py new file mode 100644 index 0000000000000000000000000000000000000000..1237b414feffa530b7b014493c40e6daf6ae40da --- /dev/null +++ b/swagger/api/api_units/models/units_savecolumnsconcept_body.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UnitsSavecolumnsconceptBody(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 = { + 'cdbid': 'int', + 'cid': 'int', + 'tid': 'int', + 'uri': 'str' + } + + attribute_map = { + 'cdbid': 'cdbid', + 'cid': 'cid', + 'tid': 'tid', + 'uri': 'uri' + } + + def __init__(self, cdbid=None, cid=None, tid=None, uri=None): # noqa: E501 + """UnitsSavecolumnsconceptBody - a model defined in Swagger""" # noqa: E501 + self._cdbid = None + self._cid = None + self._tid = None + self._uri = None + self.discriminator = None + if cdbid is not None: + self.cdbid = cdbid + if cid is not None: + self.cid = cid + if tid is not None: + self.tid = tid + if uri is not None: + self.uri = uri + + @property + def cdbid(self): + """Gets the cdbid of this UnitsSavecolumnsconceptBody. # noqa: E501 + + + :return: The cdbid of this UnitsSavecolumnsconceptBody. # noqa: E501 + :rtype: int + """ + return self._cdbid + + @cdbid.setter + def cdbid(self, cdbid): + """Sets the cdbid of this UnitsSavecolumnsconceptBody. + + + :param cdbid: The cdbid of this UnitsSavecolumnsconceptBody. # noqa: E501 + :type: int + """ + + self._cdbid = cdbid + + @property + def cid(self): + """Gets the cid of this UnitsSavecolumnsconceptBody. # noqa: E501 + + + :return: The cid of this UnitsSavecolumnsconceptBody. # noqa: E501 + :rtype: int + """ + return self._cid + + @cid.setter + def cid(self, cid): + """Sets the cid of this UnitsSavecolumnsconceptBody. + + + :param cid: The cid of this UnitsSavecolumnsconceptBody. # noqa: E501 + :type: int + """ + + self._cid = cid + + @property + def tid(self): + """Gets the tid of this UnitsSavecolumnsconceptBody. # noqa: E501 + + + :return: The tid of this UnitsSavecolumnsconceptBody. # noqa: E501 + :rtype: int + """ + return self._tid + + @tid.setter + def tid(self, tid): + """Sets the tid of this UnitsSavecolumnsconceptBody. + + + :param tid: The tid of this UnitsSavecolumnsconceptBody. # noqa: E501 + :type: int + """ + + self._tid = tid + + @property + def uri(self): + """Gets the uri of this UnitsSavecolumnsconceptBody. # noqa: E501 + + + :return: The uri of this UnitsSavecolumnsconceptBody. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this UnitsSavecolumnsconceptBody. + + + :param uri: The uri of this UnitsSavecolumnsconceptBody. # noqa: E501 + :type: str + """ + + self._uri = uri + + 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(UnitsSavecolumnsconceptBody, 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, UnitsSavecolumnsconceptBody): + 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/swagger/api/api_units/models/units_saveconcept_body.py b/swagger/api/api_units/models/units_saveconcept_body.py new file mode 100644 index 0000000000000000000000000000000000000000..16fcdacc063f5f608a6e65034ada792420a0961e --- /dev/null +++ b/swagger/api/api_units/models/units_saveconcept_body.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UnitsSaveconceptBody(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 = { + 'name': 'str', + 'uri': 'str' + } + + attribute_map = { + 'name': 'name', + 'uri': 'uri' + } + + def __init__(self, name=None, uri=None): # noqa: E501 + """UnitsSaveconceptBody - a model defined in Swagger""" # noqa: E501 + self._name = None + self._uri = None + self.discriminator = None + if name is not None: + self.name = name + if uri is not None: + self.uri = uri + + @property + def name(self): + """Gets the name of this UnitsSaveconceptBody. # noqa: E501 + + + :return: The name of this UnitsSaveconceptBody. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this UnitsSaveconceptBody. + + + :param name: The name of this UnitsSaveconceptBody. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def uri(self): + """Gets the uri of this UnitsSaveconceptBody. # noqa: E501 + + + :return: The uri of this UnitsSaveconceptBody. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this UnitsSaveconceptBody. + + + :param uri: The uri of this UnitsSaveconceptBody. # noqa: E501 + :type: str + """ + + self._uri = uri + + 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(UnitsSaveconceptBody, 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, UnitsSaveconceptBody): + 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/swagger/api/api_units/models/units_suggest_body.py b/swagger/api/api_units/models/units_suggest_body.py new file mode 100644 index 0000000000000000000000000000000000000000..7aaa2366f8bed8b81c00f6db2871d11670c663a5 --- /dev/null +++ b/swagger/api/api_units/models/units_suggest_body.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UnitsSuggestBody(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 = { + 'offset': 'int', + 'ustring': 'str' + } + + attribute_map = { + 'offset': 'offset', + 'ustring': 'ustring' + } + + def __init__(self, offset=None, ustring=None): # noqa: E501 + """UnitsSuggestBody - a model defined in Swagger""" # noqa: E501 + self._offset = None + self._ustring = None + self.discriminator = None + if offset is not None: + self.offset = offset + if ustring is not None: + self.ustring = ustring + + @property + def offset(self): + """Gets the offset of this UnitsSuggestBody. # noqa: E501 + + + :return: The offset of this UnitsSuggestBody. # noqa: E501 + :rtype: int + """ + return self._offset + + @offset.setter + def offset(self, offset): + """Sets the offset of this UnitsSuggestBody. + + + :param offset: The offset of this UnitsSuggestBody. # noqa: E501 + :type: int + """ + + self._offset = offset + + @property + def ustring(self): + """Gets the ustring of this UnitsSuggestBody. # noqa: E501 + + + :return: The ustring of this UnitsSuggestBody. # noqa: E501 + :rtype: str + """ + return self._ustring + + @ustring.setter + def ustring(self, ustring): + """Sets the ustring of this UnitsSuggestBody. + + + :param ustring: The ustring of this UnitsSuggestBody. # noqa: E501 + :type: str + """ + + self._ustring = ustring + + 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(UnitsSuggestBody, 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, UnitsSuggestBody): + 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/swagger/api/api_units/rest.py b/swagger/api/api_units/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..a4b96071cbd53eb501a9fc5eac1909569705d449 --- /dev/null +++ b/swagger/api/api_units/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + units + + powered by Flasgger # noqa: E501 + + OpenAPI spec version: 0.0.1 + + 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/swagger/api/client/AmqpClient.py b/swagger/api/client/AmqpClient.py new file mode 100644 index 0000000000000000000000000000000000000000..5a0498adab65e33d6d2fbd337d7c53abf5ea930d --- /dev/null +++ b/swagger/api/client/AmqpClient.py @@ -0,0 +1,17 @@ +from api.api_broker.BrokerServiceClient import BrokerServiceClient + + +class AmqpClient: + + def __init__(self, hostname: str, port: int, username: str, password: str): + self.hostname = hostname + self.port = port + self.username = username + self.password = password + + def send(self, exchange: str, routing_key: str, payload: {}): + broker = BrokerServiceClient(exchange=exchange, routing_key=routing_key, host=self.hostname, + username=self.username, password=self.password) + response = broker.send(payload) + print("sent tuple to exchange with routing key {}".format(routing_key)) + return response diff --git a/swagger/api/client/RestClient.py b/swagger/api/client/RestClient.py new file mode 100644 index 0000000000000000000000000000000000000000..096349b35e232284b02d3f2231a6c88f3f6a703d --- /dev/null +++ b/swagger/api/client/RestClient.py @@ -0,0 +1,92 @@ +from api.api_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi +from api.api_container.api.container_endpoint_api import ContainerEndpointApi +from api.api_database.api.database_endpoint_api import DatabaseEndpointApi +from api.api_query.api.query_endpoint_api import QueryEndpointApi +from api.api_table.api.table_endpoint_api import TableEndpointApi + + +class RestClient: + + def __init__(self, hostname: str, username: str, password: str): + self.token = None + self.hostname = hostname + self.username = username + self.password = password + self.authentication = AuthenticationEndpointApi() + self.container = ContainerEndpointApi() + self.database = DatabaseEndpointApi() + self.table = TableEndpointApi() + self.query = QueryEndpointApi() + + def login(self) -> None: + """ + Authenticates the user with provided credentials from the constructor. Also sets the authentication for all + known services. + """ + response = self.authentication.authenticate_user1({ + "username": self.username, + "password": self.password + }) + print("authenticated user with id {}".format(response.id)) + self.token = response.token + self.container.api_client.default_headers = {"Authorization": "Bearer " + self.token} + self.container.api_client.configuration.host = self.hostname + self.database.api_client.default_headers = {"Authorization": "Bearer " + self.token} + self.database.api_client.configuration.host = self.hostname + self.table.api_client.default_headers = {"Authorization": "Bearer " + self.token} + self.table.api_client.configuration.host = self.hostname + self.query.api_client.default_headers = {"Authorization": "Bearer " + self.token} + self.query.api_client.configuration.host = self.hostname + + def find_database(self, container_id: int, database_id: int): + """ + Finds a database in DBRepo via the provided container id and database id. + :param: container_id: The container id. + :param: database_id: The database id. + :return: The database if successful. Exception otherwise. + """ + response = self.database.find_by_id(container_id, database_id) + print("found database with id {}".format(response.id)) + return response + + def create_table(self, container_id: int, database_id: int): + """ + Creates a table in the provided container id and database id. + :param: container_id: The container id. + :param: database_id: The database id. + :return: The created container, if successful. Exception otherwise. + """ + # table columns name for airquality data + col = ['stationid', 'component', 'time', 'unit', 'meantype', 'value', 'meta_name', 'meta_owner', + 'meta_location', 'x_coord', 'y_coord', 'z_coord'] + # table columns type for airquality data + col_type = ['string', 'string', 'number', 'string', 'string', 'decimal', 'string', 'string', 'string', + 'decimal', 'decimal', 'decimal'] + columns = [{ + "name": x, + "type": y, + "null_allowed": True, + "primary_key": False, + "check_expression": None, + "foreign_key": None, + "references": None, + "unique": False + } for x, y in zip(col, col_type)] + # send request + response = self.table.create({ + "name": "Data", + "description": "This table provides real-time air-data from around 170 air measuring stations in Austria", + "columns": columns + }, "Bearer " + self.token, container_id, database_id) + print("created table with id {}".format(response.id)) + + def find_tables(self, container_id: int, database_id: int) -> []: + """ + Finds all tables in a container id and database id + :param: container_id: The container id. + :param: database_id: The database id + :return: The list of tables + """ + response = self.table.find_all(container_id, database_id) + print("found {} tables".format(len(response))) + return response diff --git a/swagger/api/client/__init__.py b/swagger/api/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/swagger/generate.sh b/swagger/generate.sh index bfbd59172292efca8c3398e5d03517b8b6d25068..c50ce8f33906d231f39a1997b03e90fcbeef026b 100755 --- a/swagger/generate.sh +++ b/swagger/generate.sh @@ -25,22 +25,26 @@ function generate () { function remove () { echo "... removing old python api" - rm -rf "${HOME}/Projects/fda-services/.gitlab/tests/api_$1" + rm -rf "${HOME}/Projects/fda-services/.gitlab/api_$1" rm -rf "${HOME}/Projects/fda-services/.demo/api_$1" + rm -rf "./api/api_$1" } function copy () { echo "... copying python api" - cp -r "./api-$1/swagger_client" "${HOME}/Projects/fda-services/.gitlab/tests/api_$1" + cp -r "./api-$1/swagger_client" "${HOME}/Projects/fda-services/.gitlab/api_$1" cp -r "./api-$1/swagger_client" "${HOME}/Projects/fda-services/.demo/api_$1" + cp -r "./api-$1/swagger_client" "./api/api_$1" } function replace () { echo "... replacing swagger client package name and gateway" - find "${HOME}/Projects/fda-services/.gitlab/tests/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \; - find "${HOME}/Projects/fda-services/.gitlab/tests/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \; + find "${HOME}/Projects/fda-services/.gitlab/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \; + find "${HOME}/Projects/fda-services/.gitlab/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \; find "${HOME}/Projects/fda-services/.demo/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \; find "${HOME}/Projects/fda-services/.demo/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \; + find "./api/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \; + find "./api/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \; } for key in "${!services[@]}"; do @@ -51,3 +55,5 @@ for key in "${!services[@]}"; do copy "${services[$key]}" replace "$key" "${services[$key]}" done + +cp -r "./api" "${HOME}/Projects/dbrepo-tuw/worker-airquality/api/" \ No newline at end of file