diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 054639372..cfbd8efeb 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -9,6 +9,8 @@ docs/ActivesessionGenerateFederationTokenV1Response.md docs/ActivesessionGenerateFederationTokenV1ResponseMPayload.md docs/ActivesessionGetCurrentV1Response.md docs/ActivesessionGetCurrentV1ResponseMPayload.md +docs/ActivesessionGetCurrentV2Response.md +docs/ActivesessionGetCurrentV2ResponseMPayload.md docs/ActivesessionGetListV1Response.md docs/ActivesessionGetListV1ResponseMPayload.md docs/ActivesessionListElement.md @@ -1869,6 +1871,8 @@ eZmaxApi/models/activesession_generate_federation_token_v1_response.py eZmaxApi/models/activesession_generate_federation_token_v1_response_m_payload.py eZmaxApi/models/activesession_get_current_v1_response.py eZmaxApi/models/activesession_get_current_v1_response_m_payload.py +eZmaxApi/models/activesession_get_current_v2_response.py +eZmaxApi/models/activesession_get_current_v2_response_m_payload.py eZmaxApi/models/activesession_get_list_v1_response.py eZmaxApi/models/activesession_get_list_v1_response_m_payload.py eZmaxApi/models/activesession_list_element.py @@ -3513,6 +3517,8 @@ test/test_activesession_generate_federation_token_v1_response.py test/test_activesession_generate_federation_token_v1_response_m_payload.py test/test_activesession_get_current_v1_response.py test/test_activesession_get_current_v1_response_m_payload.py +test/test_activesession_get_current_v2_response.py +test/test_activesession_get_current_v2_response_m_payload.py test/test_activesession_get_list_v1_response.py test/test_activesession_get_list_v1_response_m_payload.py test/test_activesession_list_element.py diff --git a/README.md b/README.md index ed1d66c9e..8cee9a0b3 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ Class | Method | HTTP request | Description *ModuleUserApi* | [**user_create_ezsignuser_v1**](docs/ModuleUserApi.md#user_create_ezsignuser_v1) | **POST** /1/module/user/createezsignuser | Create a new User of type Ezsignuser *ObjectActivesessionApi* | [**activesession_generate_federation_token_v1**](docs/ObjectActivesessionApi.md#activesession_generate_federation_token_v1) | **POST** /1/object/activesession/generateFederationToken | Generate a federation token *ObjectActivesessionApi* | [**activesession_get_current_v1**](docs/ObjectActivesessionApi.md#activesession_get_current_v1) | **GET** /1/object/activesession/getCurrent | Get Current Activesession +*ObjectActivesessionApi* | [**activesession_get_current_v2**](docs/ObjectActivesessionApi.md#activesession_get_current_v2) | **GET** /2/object/activesession/getCurrent | Get Current Activesession *ObjectActivesessionApi* | [**activesession_get_list_v1**](docs/ObjectActivesessionApi.md#activesession_get_list_v1) | **GET** /1/object/activesession/getList | Retrieve Activesession list *ObjectApikeyApi* | [**apikey_create_object_v2**](docs/ObjectApikeyApi.md#apikey_create_object_v2) | **POST** /2/object/apikey | Create a new Apikey *ObjectApikeyApi* | [**apikey_edit_object_v1**](docs/ObjectApikeyApi.md#apikey_edit_object_v1) | **PUT** /1/object/apikey/{pkiApikeyID} | Edit an existing Apikey @@ -551,6 +552,8 @@ Class | Method | HTTP request | Description - [ActivesessionGenerateFederationTokenV1ResponseMPayload](docs/ActivesessionGenerateFederationTokenV1ResponseMPayload.md) - [ActivesessionGetCurrentV1Response](docs/ActivesessionGetCurrentV1Response.md) - [ActivesessionGetCurrentV1ResponseMPayload](docs/ActivesessionGetCurrentV1ResponseMPayload.md) + - [ActivesessionGetCurrentV2Response](docs/ActivesessionGetCurrentV2Response.md) + - [ActivesessionGetCurrentV2ResponseMPayload](docs/ActivesessionGetCurrentV2ResponseMPayload.md) - [ActivesessionGetListV1Response](docs/ActivesessionGetListV1Response.md) - [ActivesessionGetListV1ResponseMPayload](docs/ActivesessionGetListV1ResponseMPayload.md) - [ActivesessionListElement](docs/ActivesessionListElement.md) diff --git a/docs/ActivesessionGetCurrentV2Response.md b/docs/ActivesessionGetCurrentV2Response.md new file mode 100644 index 000000000..5c5951d96 --- /dev/null +++ b/docs/ActivesessionGetCurrentV2Response.md @@ -0,0 +1,32 @@ +# ActivesessionGetCurrentV2Response + +Response for GET /2/object/activesession/getCurrent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**obj_debug_payload** | [**CommonResponseObjDebugPayload**](CommonResponseObjDebugPayload.md) | | +**obj_debug** | [**CommonResponseObjDebug**](CommonResponseObjDebug.md) | | [optional] +**m_payload** | [**ActivesessionGetCurrentV2ResponseMPayload**](ActivesessionGetCurrentV2ResponseMPayload.md) | | + +## Example + +```python +from eZmaxApi.models.activesession_get_current_v2_response import ActivesessionGetCurrentV2Response + +# TODO update the JSON string below +json = "{}" +# create an instance of ActivesessionGetCurrentV2Response from a JSON string +activesession_get_current_v2_response_instance = ActivesessionGetCurrentV2Response.from_json(json) +# print the JSON string representation of the object +print(ActivesessionGetCurrentV2Response.to_json()) + +# convert the object into a dict +activesession_get_current_v2_response_dict = activesession_get_current_v2_response_instance.to_dict() +# create an instance of ActivesessionGetCurrentV2Response from a dict +activesession_get_current_v2_response_from_dict = ActivesessionGetCurrentV2Response.from_dict(activesession_get_current_v2_response_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/docs/ActivesessionGetCurrentV2ResponseMPayload.md b/docs/ActivesessionGetCurrentV2ResponseMPayload.md new file mode 100644 index 000000000..36677ed88 --- /dev/null +++ b/docs/ActivesessionGetCurrentV2ResponseMPayload.md @@ -0,0 +1,30 @@ +# ActivesessionGetCurrentV2ResponseMPayload + +Payload for GET /1/object/activesession/getCurrent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**obj_activesession** | [**ActivesessionResponseCompound**](ActivesessionResponseCompound.md) | | + +## Example + +```python +from eZmaxApi.models.activesession_get_current_v2_response_m_payload import ActivesessionGetCurrentV2ResponseMPayload + +# TODO update the JSON string below +json = "{}" +# create an instance of ActivesessionGetCurrentV2ResponseMPayload from a JSON string +activesession_get_current_v2_response_m_payload_instance = ActivesessionGetCurrentV2ResponseMPayload.from_json(json) +# print the JSON string representation of the object +print(ActivesessionGetCurrentV2ResponseMPayload.to_json()) + +# convert the object into a dict +activesession_get_current_v2_response_m_payload_dict = activesession_get_current_v2_response_m_payload_instance.to_dict() +# create an instance of ActivesessionGetCurrentV2ResponseMPayload from a dict +activesession_get_current_v2_response_m_payload_from_dict = ActivesessionGetCurrentV2ResponseMPayload.from_dict(activesession_get_current_v2_response_m_payload_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/docs/ObjectActivesessionApi.md b/docs/ObjectActivesessionApi.md index b496d61af..e1d65d24b 100644 --- a/docs/ObjectActivesessionApi.md +++ b/docs/ObjectActivesessionApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**activesession_generate_federation_token_v1**](ObjectActivesessionApi.md#activesession_generate_federation_token_v1) | **POST** /1/object/activesession/generateFederationToken | Generate a federation token [**activesession_get_current_v1**](ObjectActivesessionApi.md#activesession_get_current_v1) | **GET** /1/object/activesession/getCurrent | Get Current Activesession +[**activesession_get_current_v2**](ObjectActivesessionApi.md#activesession_get_current_v2) | **GET** /2/object/activesession/getCurrent | Get Current Activesession [**activesession_get_list_v1**](ObjectActivesessionApi.md#activesession_get_list_v1) | **GET** /1/object/activesession/getList | Retrieve Activesession list @@ -172,6 +173,88 @@ This endpoint does not need any parameter. [[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) +# **activesession_get_current_v2** +> ActivesessionGetCurrentV2Response activesession_get_current_v2() + +Get Current Activesession + +Retrieve the details about the current activesession + +### Example + +* Api Key Authentication (Authorization): + +```python +import eZmaxApi +from eZmaxApi.models.activesession_get_current_v2_response import ActivesessionGetCurrentV2Response +from eZmaxApi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://prod.api.appcluster01.ca-central-1.ezmax.com/rest +# See configuration.py for a list of all supported configuration parameters. +configuration = eZmaxApi.Configuration( + host = "https://prod.api.appcluster01.ca-central-1.ezmax.com/rest" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Authorization +configuration.api_key['Authorization'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Authorization'] = 'Bearer' + +# Enter a context with an instance of the API client +with eZmaxApi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = eZmaxApi.ObjectActivesessionApi(api_client) + + try: + # Get Current Activesession + api_response = api_instance.activesession_get_current_v2() + print("The response of ObjectActivesessionApi->activesession_get_current_v2:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ObjectActivesessionApi->activesession_get_current_v2: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ActivesessionGetCurrentV2Response**](ActivesessionGetCurrentV2Response.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**350** | The user must authenticate before he can continue with this request | - | +**351** | The user is configured with 2FA and needs to validate its phone number before he can continue with this request | - | +**352** | The user is configured with 2FA and needs to answer a Secretquestion before he can continue with this request | - | +**353** | The user must accept clauses before he can continue with this request | - | +**354** | The user's computer must be validated before he can continue with this request | - | +**355** | The user must change its password before he can continue with this request | - | +**356** | The user is not running the latest version of the native application. He must valide or update its version before he can continue with this request | - | + +[[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) + # **activesession_get_list_v1** > ActivesessionGetListV1Response activesession_get_list_v1(e_order_by=e_order_by, i_row_max=i_row_max, i_row_offset=i_row_offset, accept_language=accept_language, s_filter=s_filter) diff --git a/docs/WebhookGetHistoryV1Response.md b/docs/WebhookGetHistoryV1Response.md index 2c5193ce9..b58ba4f65 100644 --- a/docs/WebhookGetHistoryV1Response.md +++ b/docs/WebhookGetHistoryV1Response.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **obj_debug_payload** | [**CommonResponseObjDebugPayload**](CommonResponseObjDebugPayload.md) | | **obj_debug** | [**CommonResponseObjDebug**](CommonResponseObjDebug.md) | | [optional] -**m_payload** | **object** | Payload for GET /1/object/webhook/{pkiWebhookID}/getHistory | +**m_payload** | [**WebhookGetHistoryV1ResponseMPayload**](WebhookGetHistoryV1ResponseMPayload.md) | | ## Example diff --git a/eZmaxApi/__init__.py b/eZmaxApi/__init__.py index 4a9888056..3160e73f9 100644 --- a/eZmaxApi/__init__.py +++ b/eZmaxApi/__init__.py @@ -145,6 +145,8 @@ from eZmaxApi.models.activesession_generate_federation_token_v1_response_m_payload import ActivesessionGenerateFederationTokenV1ResponseMPayload from eZmaxApi.models.activesession_get_current_v1_response import ActivesessionGetCurrentV1Response from eZmaxApi.models.activesession_get_current_v1_response_m_payload import ActivesessionGetCurrentV1ResponseMPayload +from eZmaxApi.models.activesession_get_current_v2_response import ActivesessionGetCurrentV2Response +from eZmaxApi.models.activesession_get_current_v2_response_m_payload import ActivesessionGetCurrentV2ResponseMPayload from eZmaxApi.models.activesession_get_list_v1_response import ActivesessionGetListV1Response from eZmaxApi.models.activesession_get_list_v1_response_m_payload import ActivesessionGetListV1ResponseMPayload from eZmaxApi.models.activesession_list_element import ActivesessionListElement diff --git a/eZmaxApi/api/object_activesession_api.py b/eZmaxApi/api/object_activesession_api.py index dffe0daf8..80bbabddd 100644 --- a/eZmaxApi/api/object_activesession_api.py +++ b/eZmaxApi/api/object_activesession_api.py @@ -23,6 +23,7 @@ from eZmaxApi.models.activesession_generate_federation_token_v1_request import ActivesessionGenerateFederationTokenV1Request from eZmaxApi.models.activesession_generate_federation_token_v1_response import ActivesessionGenerateFederationTokenV1Response from eZmaxApi.models.activesession_get_current_v1_response import ActivesessionGetCurrentV1Response +from eZmaxApi.models.activesession_get_current_v2_response import ActivesessionGetCurrentV2Response from eZmaxApi.models.activesession_get_list_v1_response import ActivesessionGetListV1Response from eZmaxApi.models.header_accept_language import HeaderAcceptLanguage @@ -337,7 +338,7 @@ def activesession_get_current_v1( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActivesessionGetCurrentV1Response: - """Get Current Activesession + """(Deprecated) Get Current Activesession Retrieve the details about the current activesession @@ -362,6 +363,7 @@ def activesession_get_current_v1( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /1/object/activesession/getCurrent is deprecated.", DeprecationWarning) _param = self._activesession_get_current_v1_serialize( _request_auth=_request_auth, @@ -407,7 +409,7 @@ def activesession_get_current_v1_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ActivesessionGetCurrentV1Response]: - """Get Current Activesession + """(Deprecated) Get Current Activesession Retrieve the details about the current activesession @@ -432,6 +434,7 @@ def activesession_get_current_v1_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /1/object/activesession/getCurrent is deprecated.", DeprecationWarning) _param = self._activesession_get_current_v1_serialize( _request_auth=_request_auth, @@ -477,7 +480,7 @@ def activesession_get_current_v1_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Current Activesession + """(Deprecated) Get Current Activesession Retrieve the details about the current activesession @@ -502,6 +505,7 @@ def activesession_get_current_v1_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /1/object/activesession/getCurrent is deprecated.", DeprecationWarning) _param = self._activesession_get_current_v1_serialize( _request_auth=_request_auth, @@ -588,6 +592,273 @@ def _activesession_get_current_v1_serialize( + @validate_call + def activesession_get_current_v2( + 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, + ) -> ActivesessionGetCurrentV2Response: + """Get Current Activesession + + Retrieve the details about the current activesession + + :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._activesession_get_current_v2_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActivesessionGetCurrentV2Response", + '350': None, + '351': None, + '352': "CommonResponseRedirectSSecretquestionTextX", + '353': None, + '354': None, + '355': None, + '356': None, + } + 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 activesession_get_current_v2_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[ActivesessionGetCurrentV2Response]: + """Get Current Activesession + + Retrieve the details about the current activesession + + :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._activesession_get_current_v2_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActivesessionGetCurrentV2Response", + '350': None, + '351': None, + '352': "CommonResponseRedirectSSecretquestionTextX", + '353': None, + '354': None, + '355': None, + '356': None, + } + 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 activesession_get_current_v2_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 Current Activesession + + Retrieve the details about the current activesession + + :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._activesession_get_current_v2_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActivesessionGetCurrentV2Response", + '350': None, + '351': None, + '352': "CommonResponseRedirectSSecretquestionTextX", + '353': None, + '354': None, + '355': None, + '356': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _activesession_get_current_v2_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] = [ + 'Authorization' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/2/object/activesession/getCurrent', + 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 activesession_get_list_v1( self, diff --git a/eZmaxApi/models/__init__.py b/eZmaxApi/models/__init__.py index 135852696..73dec6ccf 100644 --- a/eZmaxApi/models/__init__.py +++ b/eZmaxApi/models/__init__.py @@ -20,6 +20,8 @@ from eZmaxApi.models.activesession_generate_federation_token_v1_response_m_payload import ActivesessionGenerateFederationTokenV1ResponseMPayload from eZmaxApi.models.activesession_get_current_v1_response import ActivesessionGetCurrentV1Response from eZmaxApi.models.activesession_get_current_v1_response_m_payload import ActivesessionGetCurrentV1ResponseMPayload +from eZmaxApi.models.activesession_get_current_v2_response import ActivesessionGetCurrentV2Response +from eZmaxApi.models.activesession_get_current_v2_response_m_payload import ActivesessionGetCurrentV2ResponseMPayload from eZmaxApi.models.activesession_get_list_v1_response import ActivesessionGetListV1Response from eZmaxApi.models.activesession_get_list_v1_response_m_payload import ActivesessionGetListV1ResponseMPayload from eZmaxApi.models.activesession_list_element import ActivesessionListElement diff --git a/eZmaxApi/models/activesession_get_current_v2_response.py b/eZmaxApi/models/activesession_get_current_v2_response.py new file mode 100644 index 000000000..8db5f7bd5 --- /dev/null +++ b/eZmaxApi/models/activesession_get_current_v2_response.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + eZmax API Definition (Full) + + This API expose all the functionnalities for the eZmax and eZsign applications. + + The version of the OpenAPI document: 1.2.1 + Contact: support-api@ezmax.ca + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from eZmaxApi.models.activesession_get_current_v2_response_m_payload import ActivesessionGetCurrentV2ResponseMPayload +from eZmaxApi.models.common_response_obj_debug import CommonResponseObjDebug +from eZmaxApi.models.common_response_obj_debug_payload import CommonResponseObjDebugPayload +from typing import Optional, Set +from typing_extensions import Self + +class ActivesessionGetCurrentV2Response(BaseModel): + """ + Response for GET /2/object/activesession/getCurrent + """ # noqa: E501 + obj_debug_payload: CommonResponseObjDebugPayload = Field(alias="objDebugPayload") + obj_debug: Optional[CommonResponseObjDebug] = Field(default=None, alias="objDebug") + m_payload: ActivesessionGetCurrentV2ResponseMPayload = Field(alias="mPayload") + __properties: ClassVar[List[str]] = ["objDebugPayload", "objDebug", "mPayload"] + + 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 ActivesessionGetCurrentV2Response 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 obj_debug_payload + if self.obj_debug_payload: + _dict['objDebugPayload'] = self.obj_debug_payload.to_dict() + # override the default output from pydantic by calling `to_dict()` of obj_debug + if self.obj_debug: + _dict['objDebug'] = self.obj_debug.to_dict() + # override the default output from pydantic by calling `to_dict()` of m_payload + if self.m_payload: + _dict['mPayload'] = self.m_payload.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ActivesessionGetCurrentV2Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "objDebugPayload": CommonResponseObjDebugPayload.from_dict(obj["objDebugPayload"]) if obj.get("objDebugPayload") is not None else None, + "objDebug": CommonResponseObjDebug.from_dict(obj["objDebug"]) if obj.get("objDebug") is not None else None, + "mPayload": ActivesessionGetCurrentV2ResponseMPayload.from_dict(obj["mPayload"]) if obj.get("mPayload") is not None else None + }) + return _obj + + diff --git a/eZmaxApi/models/activesession_get_current_v2_response_m_payload.py b/eZmaxApi/models/activesession_get_current_v2_response_m_payload.py new file mode 100644 index 000000000..7818bb3e2 --- /dev/null +++ b/eZmaxApi/models/activesession_get_current_v2_response_m_payload.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + eZmax API Definition (Full) + + This API expose all the functionnalities for the eZmax and eZsign applications. + + The version of the OpenAPI document: 1.2.1 + Contact: support-api@ezmax.ca + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from eZmaxApi.models.activesession_response_compound import ActivesessionResponseCompound +from typing import Optional, Set +from typing_extensions import Self + +class ActivesessionGetCurrentV2ResponseMPayload(BaseModel): + """ + Payload for GET /1/object/activesession/getCurrent + """ # noqa: E501 + obj_activesession: ActivesessionResponseCompound = Field(alias="objActivesession") + __properties: ClassVar[List[str]] = ["objActivesession"] + + 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 ActivesessionGetCurrentV2ResponseMPayload 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 obj_activesession + if self.obj_activesession: + _dict['objActivesession'] = self.obj_activesession.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ActivesessionGetCurrentV2ResponseMPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "objActivesession": ActivesessionResponseCompound.from_dict(obj["objActivesession"]) if obj.get("objActivesession") is not None else None + }) + return _obj + + diff --git a/eZmaxApi/models/webhook_get_history_v1_response.py b/eZmaxApi/models/webhook_get_history_v1_response.py index 0ebc09388..40baab7e9 100644 --- a/eZmaxApi/models/webhook_get_history_v1_response.py +++ b/eZmaxApi/models/webhook_get_history_v1_response.py @@ -22,7 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional from eZmaxApi.models.common_response_obj_debug import CommonResponseObjDebug from eZmaxApi.models.common_response_obj_debug_payload import CommonResponseObjDebugPayload -from eZmaxApi.models.object import object +from eZmaxApi.models.webhook_get_history_v1_response_m_payload import WebhookGetHistoryV1ResponseMPayload from typing import Optional, Set from typing_extensions import Self @@ -32,7 +32,7 @@ class WebhookGetHistoryV1Response(BaseModel): """ # noqa: E501 obj_debug_payload: CommonResponseObjDebugPayload = Field(alias="objDebugPayload") obj_debug: Optional[CommonResponseObjDebug] = Field(default=None, alias="objDebug") - m_payload: object = Field(description="Payload for GET /1/object/webhook/{pkiWebhookID}/getHistory", alias="mPayload") + m_payload: WebhookGetHistoryV1ResponseMPayload = Field(alias="mPayload") __properties: ClassVar[List[str]] = ["objDebugPayload", "objDebug", "mPayload"] model_config = ConfigDict( @@ -80,6 +80,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of obj_debug if self.obj_debug: _dict['objDebug'] = self.obj_debug.to_dict() + # override the default output from pydantic by calling `to_dict()` of m_payload + if self.m_payload: + _dict['mPayload'] = self.m_payload.to_dict() return _dict @classmethod @@ -94,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "objDebugPayload": CommonResponseObjDebugPayload.from_dict(obj["objDebugPayload"]) if obj.get("objDebugPayload") is not None else None, "objDebug": CommonResponseObjDebug.from_dict(obj["objDebug"]) if obj.get("objDebug") is not None else None, - "mPayload": obj.get("mPayload") + "mPayload": WebhookGetHistoryV1ResponseMPayload.from_dict(obj["mPayload"]) if obj.get("mPayload") is not None else None }) return _obj diff --git a/test/test_activesession_get_current_v2_response.py b/test/test_activesession_get_current_v2_response.py new file mode 100644 index 000000000..a056f40f1 --- /dev/null +++ b/test/test_activesession_get_current_v2_response.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + eZmax API Definition (Full) + + This API expose all the functionnalities for the eZmax and eZsign applications. + + The version of the OpenAPI document: 1.2.1 + Contact: support-api@ezmax.ca + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from eZmaxApi.models.activesession_get_current_v2_response import ActivesessionGetCurrentV2Response + +class TestActivesessionGetCurrentV2Response(unittest.TestCase): + """ActivesessionGetCurrentV2Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ActivesessionGetCurrentV2Response: + """Test ActivesessionGetCurrentV2Response + 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 `ActivesessionGetCurrentV2Response` + """ + model = ActivesessionGetCurrentV2Response() + if include_optional: + return ActivesessionGetCurrentV2Response( + obj_debug_payload = eZmaxApi.models.common_response_obj_debug_payload.Common-Response-objDebugPayload( + i_version_min = 1, + i_version_max = 2, + a_required_permission = [ + 117 + ], + b_version_deprecated = False, + dt_response_date = '2020-12-31 23:59:59', ), + obj_debug = {"sMemoryUsage":"11,923MB","sRunTime":"0.6084s","iSQLSelects":3,"iSQLQueries":6,"a_objSQLQuery":[{"sQuery":"SELECT * FROM table","fDuration":1.0E-4},{"sQuery":"SELECT * FROM table","fDuration":1.0E-4}]}, + m_payload = eZmaxApi.models.activesession_get_current_v2_response_m_payload.activesession-getCurrent-v2-Response-mPayload( + obj_activesession = eZmaxApi.models.activesession_response_compound.activesession-ResponseCompound(), ) + ) + else: + return ActivesessionGetCurrentV2Response( + obj_debug_payload = eZmaxApi.models.common_response_obj_debug_payload.Common-Response-objDebugPayload( + i_version_min = 1, + i_version_max = 2, + a_required_permission = [ + 117 + ], + b_version_deprecated = False, + dt_response_date = '2020-12-31 23:59:59', ), + m_payload = eZmaxApi.models.activesession_get_current_v2_response_m_payload.activesession-getCurrent-v2-Response-mPayload( + obj_activesession = eZmaxApi.models.activesession_response_compound.activesession-ResponseCompound(), ), + ) + """ + + def testActivesessionGetCurrentV2Response(self): + """Test ActivesessionGetCurrentV2Response""" + # 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/test/test_activesession_get_current_v2_response_m_payload.py b/test/test_activesession_get_current_v2_response_m_payload.py new file mode 100644 index 000000000..50a0dd2a7 --- /dev/null +++ b/test/test_activesession_get_current_v2_response_m_payload.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + eZmax API Definition (Full) + + This API expose all the functionnalities for the eZmax and eZsign applications. + + The version of the OpenAPI document: 1.2.1 + Contact: support-api@ezmax.ca + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from eZmaxApi.models.activesession_get_current_v2_response_m_payload import ActivesessionGetCurrentV2ResponseMPayload + +class TestActivesessionGetCurrentV2ResponseMPayload(unittest.TestCase): + """ActivesessionGetCurrentV2ResponseMPayload unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ActivesessionGetCurrentV2ResponseMPayload: + """Test ActivesessionGetCurrentV2ResponseMPayload + 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 `ActivesessionGetCurrentV2ResponseMPayload` + """ + model = ActivesessionGetCurrentV2ResponseMPayload() + if include_optional: + return ActivesessionGetCurrentV2ResponseMPayload( + obj_activesession = eZmaxApi.models.activesession_response_compound.activesession-ResponseCompound() + ) + else: + return ActivesessionGetCurrentV2ResponseMPayload( + obj_activesession = eZmaxApi.models.activesession_response_compound.activesession-ResponseCompound(), + ) + """ + + def testActivesessionGetCurrentV2ResponseMPayload(self): + """Test ActivesessionGetCurrentV2ResponseMPayload""" + # 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/test/test_object_activesession_api.py b/test/test_object_activesession_api.py index 4dabc26ef..0310d7a7f 100644 --- a/test/test_object_activesession_api.py +++ b/test/test_object_activesession_api.py @@ -41,6 +41,13 @@ def test_activesession_get_current_v1(self) -> None: """ pass + def test_activesession_get_current_v2(self) -> None: + """Test case for activesession_get_current_v2 + + Get Current Activesession + """ + pass + def test_activesession_get_list_v1(self) -> None: """Test case for activesession_get_list_v1 diff --git a/test/test_webhook_get_history_v1_response.py b/test/test_webhook_get_history_v1_response.py index 1f62303a7..655e21f11 100644 --- a/test/test_webhook_get_history_v1_response.py +++ b/test/test_webhook_get_history_v1_response.py @@ -45,7 +45,10 @@ def make_instance(self, include_optional) -> WebhookGetHistoryV1Response: b_version_deprecated = False, dt_response_date = '2020-12-31 23:59:59', ), obj_debug = {"sMemoryUsage":"11,923MB","sRunTime":"0.6084s","iSQLSelects":3,"iSQLQueries":6,"a_objSQLQuery":[{"sQuery":"SELECT * FROM table","fDuration":1.0E-4},{"sQuery":"SELECT * FROM table","fDuration":1.0E-4}]}, - m_payload = None + m_payload = eZmaxApi.models.webhook_get_history_v1_response_m_payload.webhook-getHistory-v1-Response-mPayload( + a_obj_webhooklog = [ + eZmaxApi.models.custom_webhooklog_response.Custom-Webhooklog-Response() + ], ) ) else: return WebhookGetHistoryV1Response( @@ -57,7 +60,10 @@ def make_instance(self, include_optional) -> WebhookGetHistoryV1Response: ], b_version_deprecated = False, dt_response_date = '2020-12-31 23:59:59', ), - m_payload = None, + m_payload = eZmaxApi.models.webhook_get_history_v1_response_m_payload.webhook-getHistory-v1-Response-mPayload( + a_obj_webhooklog = [ + eZmaxApi.models.custom_webhooklog_response.Custom-Webhooklog-Response() + ], ), ) """