diff --git a/python/generate.sh b/python/generate.sh index 45702e8..13ca928 100755 --- a/python/generate.sh +++ b/python/generate.sh @@ -15,10 +15,12 @@ rm -rf ${PACKAGING_DIR}/starwit_aic_api/ mkdir -p ${GENERATOR_TARGET} -INPUT_FILES="" -for file in spec_files/*.yaml; do - INPUT_FILES+="-i $file " -done +#INPUT_FILES="" +#for file in spec_files/*.yaml; do +# INPUT_FILES+="-i $file " +#done + +INPUT_FILES="-i spec_files/decision-api.yaml" echo "using input file parameters: ${INPUT_FILES}" diff --git a/python/generated-library/starwit_aic_api/__init__.py b/python/generated-library/starwit_aic_api/__init__.py index e63d5d6..528f314 100644 --- a/python/generated-library/starwit_aic_api/__init__.py +++ b/python/generated-library/starwit_aic_api/__init__.py @@ -3,7 +3,7 @@ # flake8: noqa """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ @@ -30,7 +30,9 @@ "ApiException", "AIModel", "AIModelType", + "Action", "ActionType", + "Decision", "DecisionType", "Info", "Module", @@ -54,7 +56,9 @@ # import models into sdk package from starwit_aic_api.models.ai_model import AIModel as AIModel from starwit_aic_api.models.ai_model_type import AIModelType as AIModelType +from starwit_aic_api.models.action import Action as Action from starwit_aic_api.models.action_type import ActionType as ActionType +from starwit_aic_api.models.decision import Decision as Decision from starwit_aic_api.models.decision_type import DecisionType as DecisionType from starwit_aic_api.models.info import Info as Info from starwit_aic_api.models.module import Module as Module diff --git a/python/generated-library/starwit_aic_api/api/default_api.py b/python/generated-library/starwit_aic_api/api/default_api.py index a2709e1..5171291 100644 --- a/python/generated-library/starwit_aic_api/api/default_api.py +++ b/python/generated-library/starwit_aic_api/api/default_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ @@ -16,11 +16,11 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt +from pydantic import StrictInt from typing import List -from typing_extensions import Annotated +from starwit_aic_api.models.action import Action +from starwit_aic_api.models.decision import Decision from starwit_aic_api.models.info import Info -from starwit_aic_api.models.module import Module from starwit_aic_api.api_client import ApiClient, RequestSerialized from starwit_aic_api.api_response import ApiResponse @@ -41,8 +41,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def get_info( + def create_decision( self, + decision: Decision, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -55,11 +56,12 @@ def get_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[Info]: - """get_info + ) -> Decision: + """Create decision - shall deliver info on interface version and hosting system, readonly + :param decision: (required) + :type decision: Decision :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 @@ -82,7 +84,8 @@ def get_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_info_serialize( + _param = self._create_decision_serialize( + decision=decision, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -90,7 +93,7 @@ def get_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Info]", + '200': "Decision", } response_data = self.api_client.call_api( *_param, @@ -104,8 +107,9 @@ def get_info( @validate_call - def get_info_with_http_info( + def create_decision_with_http_info( self, + decision: Decision, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -118,11 +122,12 @@ def get_info_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[Info]]: - """get_info + ) -> ApiResponse[Decision]: + """Create decision - shall deliver info on interface version and hosting system, readonly + :param decision: (required) + :type decision: Decision :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 @@ -145,7 +150,8 @@ def get_info_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_info_serialize( + _param = self._create_decision_serialize( + decision=decision, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -153,7 +159,7 @@ def get_info_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Info]", + '200': "Decision", } response_data = self.api_client.call_api( *_param, @@ -167,8 +173,9 @@ def get_info_with_http_info( @validate_call - def get_info_without_preload_content( + def create_decision_without_preload_content( self, + decision: Decision, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -182,10 +189,11 @@ def get_info_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_info + """Create decision - shall deliver info on interface version and hosting system, readonly + :param decision: (required) + :type decision: Decision :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 @@ -208,7 +216,8 @@ def get_info_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_info_serialize( + _param = self._create_decision_serialize( + decision=decision, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -216,7 +225,7 @@ def get_info_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Info]", + '200': "Decision", } response_data = self.api_client.call_api( *_param, @@ -225,8 +234,9 @@ def get_info_without_preload_content( return response_data.response - def _get_info_serialize( + def _create_decision_serialize( self, + decision, _request_auth, _content_type, _headers, @@ -252,24 +262,39 @@ def _get_info_serialize( # process the header parameters # process the form parameters # process the body parameter + if decision is not None: + _body_params = decision # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ - 'application/json' + 'application/hal+json' ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/info', + method='POST', + resource_path='/decision', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -286,9 +311,9 @@ def _get_info_serialize( @validate_call - def get_module( + def get_actions_by_id( self, - id: Annotated[StrictInt, Field(description="Numeric ID of module")], + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -301,12 +326,11 @@ def get_module( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[Module]: - """get_module + ) -> Action: + """Get action by id - delivers components/modules with provided id - :param id: Numeric ID of module (required) + :param id: (required) :type id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -330,7 +354,7 @@ def get_module( :return: Returns the result object. """ # noqa: E501 - _param = self._get_module_serialize( + _param = self._get_actions_by_id_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, @@ -339,7 +363,7 @@ def get_module( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Module]", + '200': "Action", } response_data = self.api_client.call_api( *_param, @@ -353,9 +377,9 @@ def get_module( @validate_call - def get_module_with_http_info( + def get_actions_by_id_with_http_info( self, - id: Annotated[StrictInt, Field(description="Numeric ID of module")], + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -368,12 +392,11 @@ def get_module_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[Module]]: - """get_module + ) -> ApiResponse[Action]: + """Get action by id - delivers components/modules with provided id - :param id: Numeric ID of module (required) + :param id: (required) :type id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -397,7 +420,7 @@ def get_module_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_module_serialize( + _param = self._get_actions_by_id_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, @@ -406,7 +429,7 @@ def get_module_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Module]", + '200': "Action", } response_data = self.api_client.call_api( *_param, @@ -420,9 +443,9 @@ def get_module_with_http_info( @validate_call - def get_module_without_preload_content( + def get_actions_by_id_without_preload_content( self, - id: Annotated[StrictInt, Field(description="Numeric ID of module")], + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -436,11 +459,10 @@ def get_module_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_module + """Get action by id - delivers components/modules with provided id - :param id: Numeric ID of module (required) + :param id: (required) :type id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -464,7 +486,7 @@ def get_module_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_module_serialize( + _param = self._get_actions_by_id_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, @@ -473,7 +495,7 @@ def get_module_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Module]", + '200': "Action", } response_data = self.api_client.call_api( *_param, @@ -482,7 +504,7 @@ def get_module_without_preload_content( return response_data.response - def _get_module_serialize( + def _get_actions_by_id_serialize( self, id, _request_auth, @@ -518,7 +540,7 @@ def _get_module_serialize( if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ - 'application/json' + 'application/hal+json' ] ) @@ -529,7 +551,7 @@ def _get_module_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/modules/{id}', + resource_path='/action/{id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -546,7 +568,7 @@ def _get_module_serialize( @validate_call - def get_modules( + def get_all_actions( self, _request_timeout: Union[ None, @@ -560,10 +582,9 @@ def get_modules( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[Module]: - """get_modules + ) -> List[Action]: + """Get all actions - delivers a list of components/modules of which AI system is composed :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -587,7 +608,7 @@ def get_modules( :return: Returns the result object. """ # noqa: E501 - _param = self._get_modules_serialize( + _param = self._get_all_actions_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -595,7 +616,7 @@ def get_modules( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Module]", + '200': "List[Action]", } response_data = self.api_client.call_api( *_param, @@ -609,7 +630,7 @@ def get_modules( @validate_call - def get_modules_with_http_info( + def get_all_actions_with_http_info( self, _request_timeout: Union[ None, @@ -623,10 +644,9 @@ def get_modules_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[Module]]: - """get_modules + ) -> ApiResponse[List[Action]]: + """Get all actions - delivers a list of components/modules of which AI system is composed :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -650,7 +670,7 @@ def get_modules_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_modules_serialize( + _param = self._get_all_actions_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -658,7 +678,7 @@ def get_modules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Module]", + '200': "List[Action]", } response_data = self.api_client.call_api( *_param, @@ -672,7 +692,7 @@ def get_modules_with_http_info( @validate_call - def get_modules_without_preload_content( + def get_all_actions_without_preload_content( self, _request_timeout: Union[ None, @@ -687,9 +707,8 @@ def get_modules_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_modules + """Get all actions - delivers a list of components/modules of which AI system is composed :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -713,7 +732,7 @@ def get_modules_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_modules_serialize( + _param = self._get_all_actions_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -721,7 +740,7 @@ def get_modules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Module]", + '200': "List[Action]", } response_data = self.api_client.call_api( *_param, @@ -730,7 +749,7 @@ def get_modules_without_preload_content( return response_data.response - def _get_modules_serialize( + def _get_all_actions_serialize( self, _request_auth, _content_type, @@ -763,7 +782,7 @@ def _get_modules_serialize( if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ - 'application/json' + 'application/hal+json' ] ) @@ -774,7 +793,7 @@ def _get_modules_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/modules', + resource_path='/action', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -791,9 +810,8 @@ def _get_modules_serialize( @validate_call - def register_module( + def get_all_decisions( self, - module: Annotated[Module, Field(description="Module test to be registered")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -806,13 +824,10 @@ def register_module( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """register_module + ) -> List[Decision]: + """Get all decisions - register a new module - :param module: Module test to be registered (required) - :type module: Module :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 @@ -835,8 +850,7 @@ def register_module( :return: Returns the result object. """ # noqa: E501 - _param = self._register_module_serialize( - module=module, + _param = self._get_all_decisions_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -844,7 +858,7 @@ def register_module( ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, + '200': "List[Decision]", } response_data = self.api_client.call_api( *_param, @@ -858,9 +872,8 @@ def register_module( @validate_call - def register_module_with_http_info( + def get_all_decisions_with_http_info( self, - module: Annotated[Module, Field(description="Module test to be registered")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -873,13 +886,10 @@ def register_module_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """register_module + ) -> ApiResponse[List[Decision]]: + """Get all decisions - register a new module - :param module: Module test to be registered (required) - :type module: Module :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 @@ -902,8 +912,7 @@ def register_module_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._register_module_serialize( - module=module, + _param = self._get_all_decisions_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -911,7 +920,7 @@ def register_module_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, + '200': "List[Decision]", } response_data = self.api_client.call_api( *_param, @@ -925,9 +934,8 @@ def register_module_with_http_info( @validate_call - def register_module_without_preload_content( + def get_all_decisions_without_preload_content( self, - module: Annotated[Module, Field(description="Module test to be registered")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -941,12 +949,9 @@ def register_module_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """register_module + """Get all decisions - register a new module - :param module: Module test to be registered (required) - :type module: Module :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 @@ -969,8 +974,7 @@ def register_module_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._register_module_serialize( - module=module, + _param = self._get_all_decisions_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -978,7 +982,7 @@ def register_module_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, + '200': "List[Decision]", } response_data = self.api_client.call_api( *_param, @@ -987,9 +991,8 @@ def register_module_without_preload_content( return response_data.response - def _register_module_serialize( + def _get_all_decisions_serialize( self, - module, _request_auth, _content_type, _headers, @@ -1015,32 +1018,24 @@ def _register_module_serialize( # process the header parameters # process the form parameters # process the body parameter - if module is not None: - _body_params = module - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json' + ] ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/modules/register', + method='GET', + resource_path='/decision', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1057,10 +1052,9 @@ def _register_module_serialize( @validate_call - def update_module( + def get_decisions_by_id( self, - id: Annotated[StrictInt, Field(description="Numeric ID of module test to be updated")], - module: Annotated[Module, Field(description="Module test to be updated")], + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1073,15 +1067,12 @@ def update_module( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """update_module + ) -> Decision: + """Get decisions by id - update a module - :param id: Numeric ID of module test to be updated (required) + :param id: (required) :type id: int - :param module: Module test to be updated (required) - :type module: Module :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 @@ -1104,9 +1095,8 @@ def update_module( :return: Returns the result object. """ # noqa: E501 - _param = self._update_module_serialize( + _param = self._get_decisions_by_id_serialize( id=id, - module=module, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1114,7 +1104,7 @@ def update_module( ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, + '200': "Decision", } response_data = self.api_client.call_api( *_param, @@ -1128,10 +1118,9 @@ def update_module( @validate_call - def update_module_with_http_info( + def get_decisions_by_id_with_http_info( self, - id: Annotated[StrictInt, Field(description="Numeric ID of module test to be updated")], - module: Annotated[Module, Field(description="Module test to be updated")], + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1144,15 +1133,12 @@ def update_module_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """update_module + ) -> ApiResponse[Decision]: + """Get decisions by id - update a module - :param id: Numeric ID of module test to be updated (required) + :param id: (required) :type id: int - :param module: Module test to be updated (required) - :type module: Module :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 @@ -1175,9 +1161,8 @@ def update_module_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_module_serialize( + _param = self._get_decisions_by_id_serialize( id=id, - module=module, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1185,7 +1170,7 @@ def update_module_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, + '200': "Decision", } response_data = self.api_client.call_api( *_param, @@ -1199,10 +1184,9 @@ def update_module_with_http_info( @validate_call - def update_module_without_preload_content( + def get_decisions_by_id_without_preload_content( self, - id: Annotated[StrictInt, Field(description="Numeric ID of module test to be updated")], - module: Annotated[Module, Field(description="Module test to be updated")], + id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1216,14 +1200,11 @@ def update_module_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_module + """Get decisions by id - update a module - :param id: Numeric ID of module test to be updated (required) + :param id: (required) :type id: int - :param module: Module test to be updated (required) - :type module: Module :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 @@ -1246,9 +1227,8 @@ def update_module_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_module_serialize( + _param = self._get_decisions_by_id_serialize( id=id, - module=module, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1256,7 +1236,7 @@ def update_module_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, + '200': "Decision", } response_data = self.api_client.call_api( *_param, @@ -1265,10 +1245,9 @@ def update_module_without_preload_content( return response_data.response - def _update_module_serialize( + def _get_decisions_by_id_serialize( self, id, - module, _request_auth, _content_type, _headers, @@ -1296,32 +1275,539 @@ def _update_module_serialize( # process the header parameters # process the form parameters # process the body parameter - if module is not None: - _body_params = module - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json' + ] ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='PUT', - resource_path='/modules/register/{id}', + method='GET', + resource_path='/decision/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Info]: + """get_info + + shall deliver info on interface version and hosting system, readonly + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Info]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_info_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Info]]: + """get_info + + shall deliver info on interface version and hosting system, readonly + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Info]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_info_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_info + + shall deliver info on interface version and hosting system, readonly + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Info]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_info_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/info', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def save3( + self, + action: Action, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Action: + """Create action + + + :param action: (required) + :type action: Action + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._save3_serialize( + action=action, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Action", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def save3_with_http_info( + self, + action: Action, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Action]: + """Create action + + + :param action: (required) + :type action: Action + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._save3_serialize( + action=action, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Action", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def save3_without_preload_content( + self, + action: Action, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create action + + + :param action: (required) + :type action: Action + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._save3_serialize( + action=action, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Action", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _save3_serialize( + self, + action, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if action is not None: + _body_params = action + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/action', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/generated-library/starwit_aic_api/api_client.py b/python/generated-library/starwit_aic_api/api_client.py index 96bc078..2dc5091 100644 --- a/python/generated-library/starwit_aic_api/api_client.py +++ b/python/generated-library/starwit_aic_api/api_client.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/configuration.py b/python/generated-library/starwit_aic_api/configuration.py index 79704dd..7904674 100644 --- a/python/generated-library/starwit_aic_api/configuration.py +++ b/python/generated-library/starwit_aic_api/configuration.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ @@ -188,7 +188,7 @@ def __init__( ) -> None: """Constructor """ - self._base_path = "http://localhost:8080/api/v0" if host is None else host + self._base_path = "http://localhost:8081/api/v0" if host is None else host """Default Base url """ self.server_index = 0 if server_index is None and host is None else server_index @@ -511,7 +511,7 @@ def get_host_settings(self) -> List[HostSetting]: """ return [ { - 'url': "http://localhost:8080/api/v0", + 'url': "http://localhost:8081/api/v0", 'description': "No description provided", } ] diff --git a/python/generated-library/starwit_aic_api/docs/Action.md b/python/generated-library/starwit_aic_api/docs/Action.md new file mode 100644 index 0000000..12f5161 --- /dev/null +++ b/python/generated-library/starwit_aic_api/docs/Action.md @@ -0,0 +1,35 @@ +# Action + +An actual action that a system executes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**creation_time** | **datetime** | | [optional] +**name** | **str** | | [optional] +**description** | **str** | | [optional] +**action_type** | [**ActionType**](ActionType.md) | | [optional] +**metadata** | **str** | | [optional] + +## Example + +```python +from starwit_aic_api.models.action import Action + +# TODO update the JSON string below +json = "{}" +# create an instance of Action from a JSON string +action_instance = Action.from_json(json) +# print the JSON string representation of the object +print(Action.to_json()) + +# convert the object into a dict +action_dict = action_instance.to_dict() +# create an instance of Action from a dict +action_from_dict = Action.from_dict(action_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/generated-library/starwit_aic_api/docs/Decision.md b/python/generated-library/starwit_aic_api/docs/Decision.md new file mode 100644 index 0000000..0f97e9e --- /dev/null +++ b/python/generated-library/starwit_aic_api/docs/Decision.md @@ -0,0 +1,40 @@ +# Decision + +An actual decision that a system made + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**acquisition_time** | **datetime** | Timestamp when the decision was made | [optional] +**media_url** | **str** | Media the decision was based on | [optional] +**action_visualization_url** | **str** | Media the decision was based on | [optional] +**camera_latitude** | **float** | | [optional] +**camera_longitude** | **float** | | [optional] +**state** | **str** | | [optional] +**description** | **str** | | [optional] +**module** | [**Module**](Module.md) | | [optional] +**decision_type** | [**DecisionType**](DecisionType.md) | | [optional] +**actions** | [**List[Action]**](Action.md) | | [optional] + +## Example + +```python +from starwit_aic_api.models.decision import Decision + +# TODO update the JSON string below +json = "{}" +# create an instance of Decision from a JSON string +decision_instance = Decision.from_json(json) +# print the JSON string representation of the object +print(Decision.to_json()) + +# convert the object into a dict +decision_dict = decision_instance.to_dict() +# create an instance of Decision from a dict +decision_from_dict = Decision.from_dict(decision_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/generated-library/starwit_aic_api/docs/DefaultApi.md b/python/generated-library/starwit_aic_api/docs/DefaultApi.md index 1b4a63c..fbdcc1e 100644 --- a/python/generated-library/starwit_aic_api/docs/DefaultApi.md +++ b/python/generated-library/starwit_aic_api/docs/DefaultApi.md @@ -1,34 +1,36 @@ # starwit_aic_api.DefaultApi -All URIs are relative to *http://localhost:8080/api/v0* +All URIs are relative to *http://localhost:8081/api/v0* Method | HTTP request | Description ------------- | ------------- | ------------- +[**create_decision**](DefaultApi.md#create_decision) | **POST** /decision | Create decision +[**get_actions_by_id**](DefaultApi.md#get_actions_by_id) | **GET** /action/{id} | Get action by id +[**get_all_actions**](DefaultApi.md#get_all_actions) | **GET** /action | Get all actions +[**get_all_decisions**](DefaultApi.md#get_all_decisions) | **GET** /decision | Get all decisions +[**get_decisions_by_id**](DefaultApi.md#get_decisions_by_id) | **GET** /decision/{id} | Get decisions by id [**get_info**](DefaultApi.md#get_info) | **GET** /info | -[**get_module**](DefaultApi.md#get_module) | **GET** /modules/{id} | -[**get_modules**](DefaultApi.md#get_modules) | **GET** /modules | -[**register_module**](DefaultApi.md#register_module) | **POST** /modules/register | -[**update_module**](DefaultApi.md#update_module) | **PUT** /modules/register/{id} | +[**save3**](DefaultApi.md#save3) | **POST** /action | Create action -# **get_info** -> List[Info] get_info() +# **create_decision** +> Decision create_decision(decision) -shall deliver info on interface version and hosting system, readonly +Create decision ### Example ```python import starwit_aic_api -from starwit_aic_api.models.info import Info +from starwit_aic_api.models.decision import Decision from starwit_aic_api.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost:8080/api/v0 +# Defining the host is optional and defaults to http://localhost:8081/api/v0 # See configuration.py for a list of all supported configuration parameters. configuration = starwit_aic_api.Configuration( - host = "http://localhost:8080/api/v0" + host = "http://localhost:8081/api/v0" ) @@ -36,24 +38,29 @@ configuration = starwit_aic_api.Configuration( with starwit_aic_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = starwit_aic_api.DefaultApi(api_client) + decision = starwit_aic_api.Decision() # Decision | try: - api_response = api_instance.get_info() - print("The response of DefaultApi->get_info:\n") + # Create decision + api_response = api_instance.create_decision(decision) + print("The response of DefaultApi->create_decision:\n") pprint(api_response) except Exception as e: - print("Exception when calling DefaultApi->get_info: %s\n" % e) + print("Exception when calling DefaultApi->create_decision: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **decision** | [**Decision**](Decision.md)| | ### Return type -[**List[Info]**](Info.md) +[**Decision**](Decision.md) ### Authorization @@ -61,35 +68,35 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json + - **Content-Type**: application/json + - **Accept**: application/hal+json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | base info | - | +**200** | OK | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_module** -> List[Module] get_module(id) +# **get_actions_by_id** +> Action get_actions_by_id(id) -delivers components/modules with provided id +Get action by id ### Example ```python import starwit_aic_api -from starwit_aic_api.models.module import Module +from starwit_aic_api.models.action import Action from starwit_aic_api.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost:8080/api/v0 +# Defining the host is optional and defaults to http://localhost:8081/api/v0 # See configuration.py for a list of all supported configuration parameters. configuration = starwit_aic_api.Configuration( - host = "http://localhost:8080/api/v0" + host = "http://localhost:8081/api/v0" ) @@ -97,14 +104,15 @@ configuration = starwit_aic_api.Configuration( with starwit_aic_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = starwit_aic_api.DefaultApi(api_client) - id = 56 # int | Numeric ID of module + id = 56 # int | try: - api_response = api_instance.get_module(id) - print("The response of DefaultApi->get_module:\n") + # Get action by id + api_response = api_instance.get_actions_by_id(id) + print("The response of DefaultApi->get_actions_by_id:\n") pprint(api_response) except Exception as e: - print("Exception when calling DefaultApi->get_module: %s\n" % e) + print("Exception when calling DefaultApi->get_actions_by_id: %s\n" % e) ``` @@ -114,11 +122,11 @@ with starwit_aic_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int**| Numeric ID of module | + **id** | **int**| | ### Return type -[**List[Module]**](Module.md) +[**Action**](Action.md) ### Authorization @@ -127,34 +135,34 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: application/hal+json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | get single module | - | +**200** | OK | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_modules** -> List[Module] get_modules() +# **get_all_actions** +> List[Action] get_all_actions() -delivers a list of components/modules of which AI system is composed +Get all actions ### Example ```python import starwit_aic_api -from starwit_aic_api.models.module import Module +from starwit_aic_api.models.action import Action from starwit_aic_api.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost:8080/api/v0 +# Defining the host is optional and defaults to http://localhost:8081/api/v0 # See configuration.py for a list of all supported configuration parameters. configuration = starwit_aic_api.Configuration( - host = "http://localhost:8080/api/v0" + host = "http://localhost:8081/api/v0" ) @@ -164,11 +172,12 @@ with starwit_aic_api.ApiClient(configuration) as api_client: api_instance = starwit_aic_api.DefaultApi(api_client) try: - api_response = api_instance.get_modules() - print("The response of DefaultApi->get_modules:\n") + # Get all actions + api_response = api_instance.get_all_actions() + print("The response of DefaultApi->get_all_actions:\n") pprint(api_response) except Exception as e: - print("Exception when calling DefaultApi->get_modules: %s\n" % e) + print("Exception when calling DefaultApi->get_all_actions: %s\n" % e) ``` @@ -179,7 +188,7 @@ This endpoint does not need any parameter. ### Return type -[**List[Module]**](Module.md) +[**List[Action]**](Action.md) ### Authorization @@ -188,34 +197,96 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: application/hal+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_all_decisions** +> List[Decision] get_all_decisions() + +Get all decisions + +### Example + + +```python +import starwit_aic_api +from starwit_aic_api.models.decision import Decision +from starwit_aic_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:8081/api/v0 +# See configuration.py for a list of all supported configuration parameters. +configuration = starwit_aic_api.Configuration( + host = "http://localhost:8081/api/v0" +) + + +# Enter a context with an instance of the API client +with starwit_aic_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = starwit_aic_api.DefaultApi(api_client) + + try: + # Get all decisions + api_response = api_instance.get_all_decisions() + print("The response of DefaultApi->get_all_decisions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DefaultApi->get_all_decisions: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[Decision]**](Decision.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | module list | - | +**200** | OK | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **register_module** -> register_module(module) +# **get_decisions_by_id** +> Decision get_decisions_by_id(id) -register a new module +Get decisions by id ### Example ```python import starwit_aic_api -from starwit_aic_api.models.module import Module +from starwit_aic_api.models.decision import Decision from starwit_aic_api.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost:8080/api/v0 +# Defining the host is optional and defaults to http://localhost:8081/api/v0 # See configuration.py for a list of all supported configuration parameters. configuration = starwit_aic_api.Configuration( - host = "http://localhost:8080/api/v0" + host = "http://localhost:8081/api/v0" ) @@ -223,12 +294,15 @@ configuration = starwit_aic_api.Configuration( with starwit_aic_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = starwit_aic_api.DefaultApi(api_client) - module = starwit_aic_api.Module() # Module | Module test to be registered + id = 56 # int | try: - api_instance.register_module(module) + # Get decisions by id + api_response = api_instance.get_decisions_by_id(id) + print("The response of DefaultApi->get_decisions_by_id:\n") + pprint(api_response) except Exception as e: - print("Exception when calling DefaultApi->register_module: %s\n" % e) + print("Exception when calling DefaultApi->get_decisions_by_id: %s\n" % e) ``` @@ -238,11 +312,11 @@ with starwit_aic_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **module** | [**Module**](Module.md)| Module test to be registered | + **id** | **int**| | ### Return type -void (empty response body) +[**Decision**](Decision.md) ### Authorization @@ -250,35 +324,35 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: application/hal+json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | created a new module | - | +**200** | OK | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_module** -> update_module(id, module) +# **get_info** +> List[Info] get_info() -update a module +shall deliver info on interface version and hosting system, readonly ### Example ```python import starwit_aic_api -from starwit_aic_api.models.module import Module +from starwit_aic_api.models.info import Info from starwit_aic_api.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost:8080/api/v0 +# Defining the host is optional and defaults to http://localhost:8081/api/v0 # See configuration.py for a list of all supported configuration parameters. configuration = starwit_aic_api.Configuration( - host = "http://localhost:8080/api/v0" + host = "http://localhost:8081/api/v0" ) @@ -286,13 +360,76 @@ configuration = starwit_aic_api.Configuration( with starwit_aic_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = starwit_aic_api.DefaultApi(api_client) - id = 56 # int | Numeric ID of module test to be updated - module = starwit_aic_api.Module() # Module | Module test to be updated try: - api_instance.update_module(id, module) + api_response = api_instance.get_info() + print("The response of DefaultApi->get_info:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DefaultApi->get_info: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[Info]**](Info.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | base info | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **save3** +> Action save3(action) + +Create action + +### Example + + +```python +import starwit_aic_api +from starwit_aic_api.models.action import Action +from starwit_aic_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:8081/api/v0 +# See configuration.py for a list of all supported configuration parameters. +configuration = starwit_aic_api.Configuration( + host = "http://localhost:8081/api/v0" +) + + +# Enter a context with an instance of the API client +with starwit_aic_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = starwit_aic_api.DefaultApi(api_client) + action = starwit_aic_api.Action() # Action | + + try: + # Create action + api_response = api_instance.save3(action) + print("The response of DefaultApi->save3:\n") + pprint(api_response) except Exception as e: - print("Exception when calling DefaultApi->update_module: %s\n" % e) + print("Exception when calling DefaultApi->save3: %s\n" % e) ``` @@ -302,12 +439,11 @@ with starwit_aic_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int**| Numeric ID of module test to be updated | - **module** | [**Module**](Module.md)| Module test to be updated | + **action** | [**Action**](Action.md)| | ### Return type -void (empty response body) +[**Action**](Action.md) ### Authorization @@ -316,13 +452,13 @@ No authorization required ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: application/hal+json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | updated a module | - | +**200** | OK | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/python/generated-library/starwit_aic_api/exceptions.py b/python/generated-library/starwit_aic_api/exceptions.py index fa5a04a..f943f33 100644 --- a/python/generated-library/starwit_aic_api/exceptions.py +++ b/python/generated-library/starwit_aic_api/exceptions.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/models/__init__.py b/python/generated-library/starwit_aic_api/models/__init__.py index 7bf8b84..9f27b21 100644 --- a/python/generated-library/starwit_aic_api/models/__init__.py +++ b/python/generated-library/starwit_aic_api/models/__init__.py @@ -2,7 +2,7 @@ # flake8: noqa """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ @@ -16,7 +16,9 @@ # import models into model package from starwit_aic_api.models.ai_model import AIModel from starwit_aic_api.models.ai_model_type import AIModelType +from starwit_aic_api.models.action import Action from starwit_aic_api.models.action_type import ActionType +from starwit_aic_api.models.decision import Decision from starwit_aic_api.models.decision_type import DecisionType from starwit_aic_api.models.info import Info from starwit_aic_api.models.module import Module diff --git a/python/generated-library/starwit_aic_api/models/action.py b/python/generated-library/starwit_aic_api/models/action.py new file mode 100644 index 0000000..c59ce83 --- /dev/null +++ b/python/generated-library/starwit_aic_api/models/action.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + AI Cockpit Decisions + + This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ + + The version of the OpenAPI document: 0.0.3 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from starwit_aic_api.models.action_type import ActionType +from typing import Optional, Set +from typing_extensions import Self + +class Action(BaseModel): + """ + An actual action that a system executes + """ # noqa: E501 + id: Optional[StrictInt] = None + creation_time: Optional[datetime] = Field(default=None, alias="creationTime") + name: Optional[StrictStr] = None + description: Optional[StrictStr] = None + action_type: Optional[ActionType] = Field(default=None, alias="actionType") + metadata: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "creationTime", "name", "description", "actionType", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Action from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of action_type + if self.action_type: + _dict['actionType'] = self.action_type.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Action from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "creationTime": obj.get("creationTime"), + "name": obj.get("name"), + "description": obj.get("description"), + "actionType": ActionType.from_dict(obj["actionType"]) if obj.get("actionType") is not None else None, + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/python/generated-library/starwit_aic_api/models/action_type.py b/python/generated-library/starwit_aic_api/models/action_type.py index 75c59d0..fc699d8 100644 --- a/python/generated-library/starwit_aic_api/models/action_type.py +++ b/python/generated-library/starwit_aic_api/models/action_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/models/ai_model.py b/python/generated-library/starwit_aic_api/models/ai_model.py index 85139e2..f467c2a 100644 --- a/python/generated-library/starwit_aic_api/models/ai_model.py +++ b/python/generated-library/starwit_aic_api/models/ai_model.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/models/ai_model_type.py b/python/generated-library/starwit_aic_api/models/ai_model_type.py index 7ee09be..2584b15 100644 --- a/python/generated-library/starwit_aic_api/models/ai_model_type.py +++ b/python/generated-library/starwit_aic_api/models/ai_model_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/models/decision.py b/python/generated-library/starwit_aic_api/models/decision.py new file mode 100644 index 0000000..ac07a5c --- /dev/null +++ b/python/generated-library/starwit_aic_api/models/decision.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + AI Cockpit Decisions + + This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ + + The version of the OpenAPI document: 0.0.3 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from starwit_aic_api.models.action import Action +from starwit_aic_api.models.decision_type import DecisionType +from starwit_aic_api.models.module import Module +from typing import Optional, Set +from typing_extensions import Self + +class Decision(BaseModel): + """ + An actual decision that a system made + """ # noqa: E501 + id: Optional[StrictInt] = None + acquisition_time: Optional[datetime] = Field(default=None, description="Timestamp when the decision was made", alias="acquisitionTime") + media_url: Optional[StrictStr] = Field(default=None, description="Media the decision was based on", alias="mediaUrl") + action_visualization_url: Optional[StrictStr] = Field(default=None, description="Media the decision was based on", alias="actionVisualizationUrl") + camera_latitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="cameraLatitude") + camera_longitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="cameraLongitude") + state: Optional[StrictStr] = None + description: Optional[StrictStr] = None + module: Optional[Module] = None + decision_type: Optional[DecisionType] = Field(default=None, alias="decisionType") + actions: Optional[List[Action]] = None + __properties: ClassVar[List[str]] = ["id", "acquisitionTime", "mediaUrl", "actionVisualizationUrl", "cameraLatitude", "cameraLongitude", "state", "description", "module", "decisionType", "actions"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['NEW', 'ACCEPTED', 'REJECTED']): + raise ValueError("must be one of enum values ('NEW', 'ACCEPTED', 'REJECTED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Decision from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of module + if self.module: + _dict['module'] = self.module.to_dict() + # override the default output from pydantic by calling `to_dict()` of decision_type + if self.decision_type: + _dict['decisionType'] = self.decision_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + _items = [] + if self.actions: + for _item_actions in self.actions: + if _item_actions: + _items.append(_item_actions.to_dict()) + _dict['actions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Decision from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "acquisitionTime": obj.get("acquisitionTime"), + "mediaUrl": obj.get("mediaUrl"), + "actionVisualizationUrl": obj.get("actionVisualizationUrl"), + "cameraLatitude": obj.get("cameraLatitude"), + "cameraLongitude": obj.get("cameraLongitude"), + "state": obj.get("state"), + "description": obj.get("description"), + "module": Module.from_dict(obj["module"]) if obj.get("module") is not None else None, + "decisionType": DecisionType.from_dict(obj["decisionType"]) if obj.get("decisionType") is not None else None, + "actions": [Action.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None + }) + return _obj + + diff --git a/python/generated-library/starwit_aic_api/models/decision_type.py b/python/generated-library/starwit_aic_api/models/decision_type.py index 91fcc73..d2c119b 100644 --- a/python/generated-library/starwit_aic_api/models/decision_type.py +++ b/python/generated-library/starwit_aic_api/models/decision_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/models/info.py b/python/generated-library/starwit_aic_api/models/info.py index 3195a89..9bdd959 100644 --- a/python/generated-library/starwit_aic_api/models/info.py +++ b/python/generated-library/starwit_aic_api/models/info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/models/module.py b/python/generated-library/starwit_aic_api/models/module.py index 2a84156..022bafb 100644 --- a/python/generated-library/starwit_aic_api/models/module.py +++ b/python/generated-library/starwit_aic_api/models/module.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/models/module_sbom_location_value.py b/python/generated-library/starwit_aic_api/models/module_sbom_location_value.py index 13ac74f..b2d0a6d 100644 --- a/python/generated-library/starwit_aic_api/models/module_sbom_location_value.py +++ b/python/generated-library/starwit_aic_api/models/module_sbom_location_value.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/rest.py b/python/generated-library/starwit_aic_api/rest.py index 30bd142..1b7ae8c 100644 --- a/python/generated-library/starwit_aic_api/rest.py +++ b/python/generated-library/starwit_aic_api/rest.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/test/test_action.py b/python/generated-library/starwit_aic_api/test/test_action.py new file mode 100644 index 0000000..14ed3bf --- /dev/null +++ b/python/generated-library/starwit_aic_api/test/test_action.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + AI Cockpit Decisions + + This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ + + The version of the OpenAPI document: 0.0.3 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from starwit_aic_api.models.action import Action + +class TestAction(unittest.TestCase): + """Action unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Action: + """Test Action + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Action` + """ + model = Action() + if include_optional: + return Action( + id = 56, + creation_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + name = '', + description = '', + action_type = starwit_aic_api.models.action_type.ActionType( + id = 56, + name = '', + description = '', + endpoint = '', + execution_policy = 'MANUAL', + module = starwit_aic_api.models.module.Module( + id = 56, + version = '', + name = '', + application_identifier = '', + description = '', + use_ai = True, + model = starwit_aic_api.models.ai_model.AIModel( + name = '', + version = '', + last_deployment = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + model_type = 'LLM', + model_link = '', + public_training_data = True, + link_to_public_training_data = '', ), + action_types = [ + starwit_aic_api.models.action_type.ActionType( + id = 56, + name = '', + description = '', + endpoint = '', + execution_policy = 'MANUAL', ) + ], + decision_types = [ + starwit_aic_api.models.decision_type.DecisionType( + id = 56, + name = '', + description = '', ) + ], + s_bom_location = { + 'key' : starwit_aic_api.models.module_s_bom_location_value.Module_sBOMLocation_value( + url = '', ) + }, + successors = [ + starwit_aic_api.models.module.Module( + id = 56, + version = '', + name = '', + application_identifier = '', + description = '', + use_ai = True, ) + ], ), ), + metadata = '' + ) + else: + return Action( + ) + """ + + def testAction(self): + """Test Action""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/generated-library/starwit_aic_api/test/test_action_type.py b/python/generated-library/starwit_aic_api/test/test_action_type.py index c165b28..04ac268 100644 --- a/python/generated-library/starwit_aic_api/test/test_action_type.py +++ b/python/generated-library/starwit_aic_api/test/test_action_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/test/test_ai_model.py b/python/generated-library/starwit_aic_api/test/test_ai_model.py index d8b6ea1..0e71464 100644 --- a/python/generated-library/starwit_aic_api/test/test_ai_model.py +++ b/python/generated-library/starwit_aic_api/test/test_ai_model.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/test/test_ai_model_type.py b/python/generated-library/starwit_aic_api/test/test_ai_model_type.py index 158b6c7..445dc38 100644 --- a/python/generated-library/starwit_aic_api/test/test_ai_model_type.py +++ b/python/generated-library/starwit_aic_api/test/test_ai_model_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/test/test_decision.py b/python/generated-library/starwit_aic_api/test/test_decision.py new file mode 100644 index 0000000..2b447dd --- /dev/null +++ b/python/generated-library/starwit_aic_api/test/test_decision.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + AI Cockpit Decisions + + This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ + + The version of the OpenAPI document: 0.0.3 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from starwit_aic_api.models.decision import Decision + +class TestDecision(unittest.TestCase): + """Decision unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Decision: + """Test Decision + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Decision` + """ + model = Decision() + if include_optional: + return Decision( + id = 56, + acquisition_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + media_url = '', + action_visualization_url = '', + camera_latitude = 1.337, + camera_longitude = 1.337, + state = 'NEW', + description = '', + module = starwit_aic_api.models.module.Module( + id = 56, + version = '', + name = '', + application_identifier = '', + description = '', + use_ai = True, + model = starwit_aic_api.models.ai_model.AIModel( + name = '', + version = '', + last_deployment = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + model_type = 'LLM', + model_link = '', + public_training_data = True, + link_to_public_training_data = '', ), + action_types = [ + starwit_aic_api.models.action_type.ActionType( + id = 56, + name = '', + description = '', + endpoint = '', + execution_policy = 'MANUAL', + module = starwit_aic_api.models.module.Module( + id = 56, + version = '', + name = '', + application_identifier = '', + description = '', + use_ai = True, + decision_types = [ + starwit_aic_api.models.decision_type.DecisionType( + id = 56, + name = '', + description = '', ) + ], + s_bom_location = { + 'key' : starwit_aic_api.models.module_s_bom_location_value.Module_sBOMLocation_value( + url = '', ) + }, + successors = [ + + ], ), ) + ], + decision_types = [ + starwit_aic_api.models.decision_type.DecisionType( + id = 56, + name = '', + description = '', ) + ], + s_bom_location = { + 'key' : starwit_aic_api.models.module_s_bom_location_value.Module_sBOMLocation_value( + url = '', ) + }, + successors = [ + + ], ), + decision_type = starwit_aic_api.models.decision_type.DecisionType( + id = 56, + name = '', + description = '', + action_types = [ + starwit_aic_api.models.action_type.ActionType( + id = 56, + name = '', + description = '', + endpoint = '', + execution_policy = 'MANUAL', + module = starwit_aic_api.models.module.Module( + id = 56, + version = '', + name = '', + application_identifier = '', + description = '', + use_ai = True, + model = starwit_aic_api.models.ai_model.AIModel( + name = '', + version = '', + last_deployment = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + model_type = 'LLM', + model_link = '', + public_training_data = True, + link_to_public_training_data = '', ), + decision_types = [ + starwit_aic_api.models.decision_type.DecisionType( + id = 56, + name = '', + description = '', ) + ], + s_bom_location = { + 'key' : starwit_aic_api.models.module_s_bom_location_value.Module_sBOMLocation_value( + url = '', ) + }, + successors = [ + starwit_aic_api.models.module.Module( + id = 56, + version = '', + name = '', + application_identifier = '', + description = '', + use_ai = True, ) + ], ), ) + ], + module = , ), + actions = [ + starwit_aic_api.models.action.Action( + id = 56, + creation_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + name = '', + description = '', + action_type = starwit_aic_api.models.action_type.ActionType( + id = 56, + name = '', + description = '', + endpoint = '', + execution_policy = 'MANUAL', + module = starwit_aic_api.models.module.Module( + id = 56, + version = '', + name = '', + application_identifier = '', + description = '', + use_ai = True, + model = starwit_aic_api.models.ai_model.AIModel( + name = '', + version = '', + last_deployment = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + model_type = 'LLM', + model_link = '', + public_training_data = True, + link_to_public_training_data = '', ), + action_types = [ + starwit_aic_api.models.action_type.ActionType( + id = 56, + name = '', + description = '', + endpoint = '', + execution_policy = 'MANUAL', ) + ], + decision_types = [ + starwit_aic_api.models.decision_type.DecisionType( + id = 56, + name = '', + description = '', ) + ], + s_bom_location = { + 'key' : starwit_aic_api.models.module_s_bom_location_value.Module_sBOMLocation_value( + url = '', ) + }, + successors = [ + starwit_aic_api.models.module.Module( + id = 56, + version = '', + name = '', + application_identifier = '', + description = '', + use_ai = True, ) + ], ), ), + metadata = '', ) + ] + ) + else: + return Decision( + ) + """ + + def testDecision(self): + """Test Decision""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/generated-library/starwit_aic_api/test/test_decision_type.py b/python/generated-library/starwit_aic_api/test/test_decision_type.py index 0f531da..0f367bf 100644 --- a/python/generated-library/starwit_aic_api/test/test_decision_type.py +++ b/python/generated-library/starwit_aic_api/test/test_decision_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ @@ -60,14 +60,6 @@ def make_instance(self, include_optional) -> DecisionType: model_link = '', public_training_data = True, link_to_public_training_data = '', ), - action_types = [ - starwit_aic_api.models.action_type.ActionType( - id = 56, - name = '', - description = '', - endpoint = '', - execution_policy = 'MANUAL', ) - ], decision_types = [ starwit_aic_api.models.decision_type.DecisionType( id = 56, diff --git a/python/generated-library/starwit_aic_api/test/test_default_api.py b/python/generated-library/starwit_aic_api/test/test_default_api.py index d1cf038..f7f9283 100644 --- a/python/generated-library/starwit_aic_api/test/test_default_api.py +++ b/python/generated-library/starwit_aic_api/test/test_default_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ @@ -26,33 +26,51 @@ def setUp(self) -> None: def tearDown(self) -> None: pass - def test_get_info(self) -> None: - """Test case for get_info + def test_create_decision(self) -> None: + """Test case for create_decision + + Create decision + """ + pass + + def test_get_actions_by_id(self) -> None: + """Test case for get_actions_by_id + Get action by id """ pass - def test_get_module(self) -> None: - """Test case for get_module + def test_get_all_actions(self) -> None: + """Test case for get_all_actions + Get all actions """ pass - def test_get_modules(self) -> None: - """Test case for get_modules + def test_get_all_decisions(self) -> None: + """Test case for get_all_decisions + Get all decisions """ pass - def test_register_module(self) -> None: - """Test case for register_module + def test_get_decisions_by_id(self) -> None: + """Test case for get_decisions_by_id + + Get decisions by id + """ + pass + + def test_get_info(self) -> None: + """Test case for get_info """ pass - def test_update_module(self) -> None: - """Test case for update_module + def test_save3(self) -> None: + """Test case for save3 + Create action """ pass diff --git a/python/generated-library/starwit_aic_api/test/test_info.py b/python/generated-library/starwit_aic_api/test/test_info.py index 3d293ba..9394f85 100644 --- a/python/generated-library/starwit_aic_api/test/test_info.py +++ b/python/generated-library/starwit_aic_api/test/test_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ diff --git a/python/generated-library/starwit_aic_api/test/test_module.py b/python/generated-library/starwit_aic_api/test/test_module.py index c62704f..a6d4319 100644 --- a/python/generated-library/starwit_aic_api/test/test_module.py +++ b/python/generated-library/starwit_aic_api/test/test_module.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/ @@ -71,14 +71,6 @@ def make_instance(self, include_optional) -> Module: model_link = '', public_training_data = True, link_to_public_training_data = '', ), - action_types = [ - starwit_aic_api.models.action_type.ActionType( - id = 56, - name = '', - description = '', - endpoint = '', - execution_policy = 'MANUAL', ) - ], decision_types = [ starwit_aic_api.models.decision_type.DecisionType( id = 56, diff --git a/python/generated-library/starwit_aic_api/test/test_module_sbom_location_value.py b/python/generated-library/starwit_aic_api/test/test_module_sbom_location_value.py index a0f7209..c64fb1a 100644 --- a/python/generated-library/starwit_aic_api/test/test_module_sbom_location_value.py +++ b/python/generated-library/starwit_aic_api/test/test_module_sbom_location_value.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - AI Cockpit Transparency + AI Cockpit Decisions This API is part of project AI cockpit. For more details see: https://www.kicockpit.eu/