From 6e83db29268f0e4d1c22e36dbe9a1ee45bfbe8af Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 16 Jun 2025 21:57:59 +0300 Subject: [PATCH] chore: update generated output under .openapi markers --- zitadel_client/api/action_service_api.py | 3180 +--- zitadel_client/api/feature_service_api.py | 3654 ++-- .../api/identity_provider_service_api.py | 299 +- zitadel_client/api/oidc_service_api.py | 1222 +- .../api/organization_service_api.py | 634 +- zitadel_client/api/saml_service_api.py | 622 +- zitadel_client/api/session_service_api.py | 1647 +- zitadel_client/api/settings_service_api.py | 3471 +--- zitadel_client/api/user_service_api.py | 14634 +++++----------- zitadel_client/api/web_key_service_api.py | 1158 +- 10 files changed, 8594 insertions(+), 21927 deletions(-) diff --git a/zitadel_client/api/action_service_api.py b/zitadel_client/api/action_service_api.py index 5afad3ab..c4d125d1 100644 --- a/zitadel_client/api/action_service_api.py +++ b/zitadel_client/api/action_service_api.py @@ -16,40 +16,40 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from zitadel_client.models.action_service_beta_create_target_response import ActionServiceBetaCreateTargetResponse -from zitadel_client.models.action_service_beta_delete_target_response import ActionServiceBetaDeleteTargetResponse -from zitadel_client.models.action_service_beta_get_target_response import ActionServiceBetaGetTargetResponse -from zitadel_client.models.action_service_beta_list_execution_functions_response import ActionServiceBetaListExecutionFunctionsResponse -from zitadel_client.models.action_service_beta_list_execution_methods_response import ActionServiceBetaListExecutionMethodsResponse -from zitadel_client.models.action_service_beta_list_execution_services_response import ActionServiceBetaListExecutionServicesResponse -from zitadel_client.models.action_service_beta_list_executions_response import ActionServiceBetaListExecutionsResponse -from zitadel_client.models.action_service_beta_list_targets_response import ActionServiceBetaListTargetsResponse -from zitadel_client.models.action_service_beta_set_execution_response import ActionServiceBetaSetExecutionResponse -from zitadel_client.models.action_service_beta_update_target_response import ActionServiceBetaUpdateTargetResponse -from zitadel_client.models.action_service_create_target_request import ActionServiceCreateTargetRequest -from zitadel_client.models.action_service_list_targets_request import ActionServiceListTargetsRequest -from zitadel_client.models.action_service_set_execution_request import ActionServiceSetExecutionRequest -from zitadel_client.models.action_service_update_target_request import ActionServiceUpdateTargetRequest + from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator + from typing import Optional + from typing_extensions import Annotated + from zitadel_client.models.action_service_beta_create_target_response import ActionServiceBetaCreateTargetResponse + from zitadel_client.models.action_service_beta_delete_target_response import ActionServiceBetaDeleteTargetResponse + from zitadel_client.models.action_service_beta_get_target_response import ActionServiceBetaGetTargetResponse + from zitadel_client.models.action_service_beta_list_execution_functions_response import ActionServiceBetaListExecutionFunctionsResponse + from zitadel_client.models.action_service_beta_list_execution_methods_response import ActionServiceBetaListExecutionMethodsResponse + from zitadel_client.models.action_service_beta_list_execution_services_response import ActionServiceBetaListExecutionServicesResponse + from zitadel_client.models.action_service_beta_list_executions_response import ActionServiceBetaListExecutionsResponse + from zitadel_client.models.action_service_beta_list_targets_response import ActionServiceBetaListTargetsResponse + from zitadel_client.models.action_service_beta_set_execution_response import ActionServiceBetaSetExecutionResponse + from zitadel_client.models.action_service_beta_update_target_response import ActionServiceBetaUpdateTargetResponse + from zitadel_client.models.action_service_create_target_request import ActionServiceCreateTargetRequest + from zitadel_client.models.action_service_list_targets_request import ActionServiceListTargetsRequest + from zitadel_client.models.action_service_set_execution_request import ActionServiceSetExecutionRequest + from zitadel_client.models.action_service_update_target_request import ActionServiceUpdateTargetRequest from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class ActionServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class ActionServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -69,7 +69,7 @@ def action_service_create_target( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceBetaCreateTargetResponse: - """Create Target + """Create Target Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions` @@ -97,7 +97,7 @@ def action_service_create_target( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_create_target_serialize( + _param = self.__action_service_create_target_serialize( action_service_create_target_request=action_service_create_target_request, _request_auth=_request_auth, _content_type=_content_type, @@ -112,21 +112,99 @@ def action_service_create_target( '404': "ActionServiceRpcStatus", '409': "object", } - 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 + 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 + + + + def __action_service_create_target_serialize( + self, + action_service_create_target_request, + _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_service_create_target_request is not None: + _body_params = action_service_create_target_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2beta/actions/targets', + 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 action_service_create_target_with_http_info( + def action_service_delete_target( self, - action_service_create_target_request: ActionServiceCreateTargetRequest, + id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -139,13 +217,13 @@ def action_service_create_target_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[ActionServiceBetaCreateTargetResponse]: - """Create Target + ) -> ActionServiceBetaDeleteTargetResponse: + """Delete Target - Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions` + Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` Required feature flag: - `actions` - :param action_service_create_target_request: (required) - :type action_service_create_target_request: ActionServiceCreateTargetRequest + :param id: (required) + :type id: str :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 @@ -168,8 +246,8 @@ def action_service_create_target_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_create_target_serialize( - action_service_create_target_request=action_service_create_target_request, + _param = self.__action_service_delete_target_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -177,27 +255,91 @@ def action_service_create_target_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaCreateTargetResponse", + '200': "ActionServiceBetaDeleteTargetResponse", '400': "object", '403': "ActionServiceRpcStatus", '404': "ActionServiceRpcStatus", - '409': "object", } - 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, - ) + 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 + + + + def __action_service_delete_target_serialize( + self, + id, + _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 + if id is not None: + _path_params['id'] = id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2beta/actions/targets/{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 action_service_create_target_without_preload_content( + def action_service_get_target( self, - action_service_create_target_request: ActionServiceCreateTargetRequest, + id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -210,13 +352,13 @@ def action_service_create_target_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create Target + ) -> ActionServiceBetaGetTargetResponse: + """Get Target - Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions` + Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions` - :param action_service_create_target_request: (required) - :type action_service_create_target_request: ActionServiceCreateTargetRequest + :param id: (required) + :type id: str :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 @@ -239,8 +381,8 @@ def action_service_create_target_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_create_target_serialize( - action_service_create_target_request=action_service_create_target_request, + _param = self.__action_service_get_target_serialize( + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -248,100 +390,90 @@ def action_service_create_target_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaCreateTargetResponse", + '200': "ActionServiceBetaGetTargetResponse", '400': "object", '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - '409': "object", + '404': "object", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_create_target_serialize( - self, - action_service_create_target_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __action_service_get_target_serialize( + self, + id, + _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_service_create_target_request is not None: - _body_params = action_service_create_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2beta/actions/targets', - 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 - ) + _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 + if id is not None: + _path_params['id'] = id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2beta/actions/targets/{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 action_service_delete_target( + def action_service_list_execution_functions( self, - id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -354,13 +486,11 @@ def action_service_delete_target( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ActionServiceBetaDeleteTargetResponse: - """Delete Target + ) -> ActionServiceBetaListExecutionFunctionsResponse: + """List Execution Functions - Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` Required feature flag: - `actions` + List all available functions which can be used as condition for executions. - :param id: (required) - :type id: str :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 @@ -383,8 +513,7 @@ def action_service_delete_target( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_delete_target_serialize( - id=id, + _param = self.__action_service_list_execution_functions_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -392,26 +521,86 @@ def action_service_delete_target( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaDeleteTargetResponse", - '400': "object", + '200': "ActionServiceBetaListExecutionFunctionsResponse", '403': "ActionServiceRpcStatus", '404': "ActionServiceRpcStatus", } - 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 + 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 + + + + def __action_service_list_execution_functions_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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2beta/actions/executions/functions', + 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 action_service_delete_target_with_http_info( + def action_service_list_execution_methods( self, - id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -424,13 +613,11 @@ def action_service_delete_target_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[ActionServiceBetaDeleteTargetResponse]: - """Delete Target + ) -> ActionServiceBetaListExecutionMethodsResponse: + """List Execution Methods - Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` Required feature flag: - `actions` + List all available methods which can be used as condition for executions. - :param id: (required) - :type id: str :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 @@ -453,8 +640,7 @@ def action_service_delete_target_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_delete_target_serialize( - id=id, + _param = self.__action_service_list_execution_methods_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -462,26 +648,86 @@ def action_service_delete_target_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaDeleteTargetResponse", - '400': "object", + '200': "ActionServiceBetaListExecutionMethodsResponse", '403': "ActionServiceRpcStatus", '404': "ActionServiceRpcStatus", } - 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, - ) + 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 + + + + def __action_service_list_execution_methods_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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2beta/actions/executions/methods', + 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 action_service_delete_target_without_preload_content( + def action_service_list_execution_services( self, - id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -494,13 +740,11 @@ def action_service_delete_target_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete Target + ) -> ActionServiceBetaListExecutionServicesResponse: + """List Execution Services - Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` Required feature flag: - `actions` + List all available services which can be used as condition for executions. - :param id: (required) - :type id: str :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 @@ -523,8 +767,7 @@ def action_service_delete_target_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_delete_target_serialize( - id=id, + _param = self.__action_service_list_execution_services_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -532,86 +775,90 @@ def action_service_delete_target_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaDeleteTargetResponse", - '400': "object", + '200': "ActionServiceBetaListExecutionServicesResponse", '403': "ActionServiceRpcStatus", '404': "ActionServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 + + + + def __action_service_list_execution_services_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - def _action_service_delete_target_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: + _collection_formats: Dict[str, str] = { + } - _host = None + _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 - _collection_formats: Dict[str, str] = { - } + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter - _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 - if id is not None: - _path_params['id'] = id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2beta/actions/targets/{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 - ) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2beta/actions/executions/services', + 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 action_service_get_target( + def action_service_list_executions( self, - id: StrictStr, + pagination_offset: Annotated[Optional[StrictStr], Field(description="Starting point for retrieval, in combination of offset used to query a set list of objects.")] = None, + pagination_limit: Annotated[Optional[StrictInt], Field(description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.")] = None, + pagination_asc: Annotated[Optional[StrictBool], Field(description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.")] = None, + sorting_column: Annotated[Optional[StrictStr], Field(description="The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -624,13 +871,19 @@ def action_service_get_target( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ActionServiceBetaGetTargetResponse: - """Get Target + ) -> ActionServiceBetaListExecutionsResponse: + """List Executions - Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions` + List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` Required feature flag: - `actions` - :param id: (required) - :type id: str + :param pagination_offset: Starting point for retrieval, in combination of offset used to query a set list of objects. + :type pagination_offset: str + :param pagination_limit: limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + :type pagination_limit: int + :param pagination_asc: Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + :type pagination_asc: bool + :param sorting_column: The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent. + :type sorting_column: str :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 @@ -653,8 +906,11 @@ def action_service_get_target( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_get_target_serialize( - id=id, + _param = self.__action_service_list_executions_serialize( + pagination_offset=pagination_offset, + pagination_limit=pagination_limit, + pagination_asc=pagination_asc, + sorting_column=sorting_column, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -662,26 +918,108 @@ def action_service_get_target( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaGetTargetResponse", + '200': "ActionServiceBetaListExecutionsResponse", '400': "object", '403': "ActionServiceRpcStatus", - '404': "object", + '404': "ActionServiceRpcStatus", } - 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 + 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 + + + + def __action_service_list_executions_serialize( + self, + pagination_offset, + pagination_limit, + pagination_asc, + sorting_column, + _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 + if pagination_offset is not None: + + _query_params.append(('pagination.offset', pagination_offset)) + + if pagination_limit is not None: + + _query_params.append(('pagination.limit', pagination_limit)) + + if pagination_asc is not None: + + _query_params.append(('pagination.asc', pagination_asc)) + + if sorting_column is not None: + + _query_params.append(('sortingColumn', sorting_column)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2beta/actions/executions/_search', + 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 action_service_get_target_with_http_info( + def action_service_list_targets( self, - id: StrictStr, + action_service_list_targets_request: ActionServiceListTargetsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -694,13 +1032,13 @@ def action_service_get_target_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[ActionServiceBetaGetTargetResponse]: - """Get Target + ) -> ActionServiceBetaListTargetsResponse: + """List targets - Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions` + List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` Required feature flag: - `actions` - :param id: (required) - :type id: str + :param action_service_list_targets_request: (required) + :type action_service_list_targets_request: ActionServiceListTargetsRequest :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 @@ -723,8 +1061,8 @@ def action_service_get_target_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_get_target_serialize( - id=id, + _param = self.__action_service_list_targets_serialize( + action_service_list_targets_request=action_service_list_targets_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -732,26 +1070,104 @@ def action_service_get_target_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaGetTargetResponse", + '200': "ActionServiceBetaListTargetsResponse", '400': "object", '403': "ActionServiceRpcStatus", - '404': "object", + '404': "ActionServiceRpcStatus", } - 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, - ) + 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 + + + + def __action_service_list_targets_serialize( + self, + action_service_list_targets_request, + _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_service_list_targets_request is not None: + _body_params = action_service_list_targets_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2beta/actions/targets/_search', + 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 action_service_get_target_without_preload_content( + def action_service_set_execution( self, - id: StrictStr, + action_service_set_execution_request: ActionServiceSetExecutionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -764,13 +1180,13 @@ def action_service_get_target_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Target + ) -> ActionServiceBetaSetExecutionResponse: + """Set Execution - Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions` + Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` Required feature flag: - `actions` - :param id: (required) - :type id: str + :param action_service_set_execution_request: (required) + :type action_service_set_execution_request: ActionServiceSetExecutionRequest :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 @@ -793,8 +1209,8 @@ def action_service_get_target_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_get_target_serialize( - id=id, + _param = self.__action_service_set_execution_serialize( + action_service_set_execution_request=action_service_set_execution_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -802,85 +1218,105 @@ def action_service_get_target_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaGetTargetResponse", + '200': "ActionServiceBetaSetExecutionResponse", '400': "object", '403': "ActionServiceRpcStatus", - '404': "object", + '404': "ActionServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_get_target_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __action_service_set_execution_serialize( + self, + action_service_set_execution_request, + _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 - if id is not None: - _path_params['id'] = id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2beta/actions/targets/{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 - ) + _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_service_set_execution_request is not None: + _body_params = action_service_set_execution_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v2beta/actions/executions', + 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 action_service_list_execution_functions( + def action_service_update_target( self, + id: StrictStr, + action_service_update_target_request: ActionServiceUpdateTargetRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -893,11 +1329,15 @@ def action_service_list_execution_functions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ActionServiceBetaListExecutionFunctionsResponse: - """List Execution Functions + ) -> ActionServiceBetaUpdateTargetResponse: + """Update Target - List all available functions which can be used as condition for executions. + Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions` + :param id: (required) + :type id: str + :param action_service_update_target_request: (required) + :type action_service_update_target_request: ActionServiceUpdateTargetRequest :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 @@ -920,7 +1360,9 @@ def action_service_list_execution_functions( :return: Returns the result object. """ # noqa: E501 - _param = self._action_service_list_execution_functions_serialize( + _param = self.__action_service_update_target_serialize( + id=id, + action_service_update_target_request=action_service_update_target_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -928,1894 +1370,98 @@ def action_service_list_execution_functions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionFunctionsResponse", + '200': "ActionServiceBetaUpdateTargetResponse", + '400': "object", '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", + '404': "object", } - 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 action_service_list_execution_functions_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[ActionServiceBetaListExecutionFunctionsResponse]: - """List Execution Functions - - List all available functions which can be used as condition for executions. + 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 + + + + def __action_service_update_target_serialize( + self, + id, + action_service_update_target_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - :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._action_service_list_execution_functions_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionFunctionsResponse", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_execution_functions_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: - """List Execution Functions - - List all available functions which can be used as condition for executions. - - :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._action_service_list_execution_functions_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionFunctionsResponse", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_list_execution_functions_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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2beta/actions/executions/functions', - 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 action_service_list_execution_methods( - 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, - ) -> ActionServiceBetaListExecutionMethodsResponse: - """List Execution Methods - - List all available methods which can be used as condition for executions. - - :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._action_service_list_execution_methods_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionMethodsResponse", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_execution_methods_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[ActionServiceBetaListExecutionMethodsResponse]: - """List Execution Methods - - List all available methods which can be used as condition for executions. - - :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._action_service_list_execution_methods_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionMethodsResponse", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_execution_methods_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: - """List Execution Methods - - List all available methods which can be used as condition for executions. - - :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._action_service_list_execution_methods_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionMethodsResponse", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_list_execution_methods_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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2beta/actions/executions/methods', - 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 action_service_list_execution_services( - 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, - ) -> ActionServiceBetaListExecutionServicesResponse: - """List Execution Services - - List all available services which can be used as condition for executions. - - :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._action_service_list_execution_services_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionServicesResponse", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_execution_services_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[ActionServiceBetaListExecutionServicesResponse]: - """List Execution Services - - List all available services which can be used as condition for executions. - - :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._action_service_list_execution_services_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionServicesResponse", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_execution_services_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: - """List Execution Services - - List all available services which can be used as condition for executions. - - :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._action_service_list_execution_services_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionServicesResponse", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_list_execution_services_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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2beta/actions/executions/services', - 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 action_service_list_executions( - self, - pagination_offset: Annotated[Optional[StrictStr], Field(description="Starting point for retrieval, in combination of offset used to query a set list of objects.")] = None, - pagination_limit: Annotated[Optional[StrictInt], Field(description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.")] = None, - pagination_asc: Annotated[Optional[StrictBool], Field(description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.")] = None, - sorting_column: Annotated[Optional[StrictStr], Field(description="The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.")] = None, - _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, - ) -> ActionServiceBetaListExecutionsResponse: - """List Executions - - List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` Required feature flag: - `actions` - - :param pagination_offset: Starting point for retrieval, in combination of offset used to query a set list of objects. - :type pagination_offset: str - :param pagination_limit: limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - :type pagination_limit: int - :param pagination_asc: Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - :type pagination_asc: bool - :param sorting_column: The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent. - :type sorting_column: str - :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._action_service_list_executions_serialize( - pagination_offset=pagination_offset, - pagination_limit=pagination_limit, - pagination_asc=pagination_asc, - sorting_column=sorting_column, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionsResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_executions_with_http_info( - self, - pagination_offset: Annotated[Optional[StrictStr], Field(description="Starting point for retrieval, in combination of offset used to query a set list of objects.")] = None, - pagination_limit: Annotated[Optional[StrictInt], Field(description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.")] = None, - pagination_asc: Annotated[Optional[StrictBool], Field(description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.")] = None, - sorting_column: Annotated[Optional[StrictStr], Field(description="The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.")] = None, - _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[ActionServiceBetaListExecutionsResponse]: - """List Executions - - List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` Required feature flag: - `actions` - - :param pagination_offset: Starting point for retrieval, in combination of offset used to query a set list of objects. - :type pagination_offset: str - :param pagination_limit: limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - :type pagination_limit: int - :param pagination_asc: Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - :type pagination_asc: bool - :param sorting_column: The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent. - :type sorting_column: str - :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._action_service_list_executions_serialize( - pagination_offset=pagination_offset, - pagination_limit=pagination_limit, - pagination_asc=pagination_asc, - sorting_column=sorting_column, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionsResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_executions_without_preload_content( - self, - pagination_offset: Annotated[Optional[StrictStr], Field(description="Starting point for retrieval, in combination of offset used to query a set list of objects.")] = None, - pagination_limit: Annotated[Optional[StrictInt], Field(description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.")] = None, - pagination_asc: Annotated[Optional[StrictBool], Field(description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.")] = None, - sorting_column: Annotated[Optional[StrictStr], Field(description="The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.")] = None, - _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: - """List Executions - - List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` Required feature flag: - `actions` - - :param pagination_offset: Starting point for retrieval, in combination of offset used to query a set list of objects. - :type pagination_offset: str - :param pagination_limit: limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - :type pagination_limit: int - :param pagination_asc: Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - :type pagination_asc: bool - :param sorting_column: The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent. - :type sorting_column: str - :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._action_service_list_executions_serialize( - pagination_offset=pagination_offset, - pagination_limit=pagination_limit, - pagination_asc=pagination_asc, - sorting_column=sorting_column, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListExecutionsResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_list_executions_serialize( - self, - pagination_offset, - pagination_limit, - pagination_asc, - sorting_column, - _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 - if pagination_offset is not None: - - _query_params.append(('pagination.offset', pagination_offset)) - - if pagination_limit is not None: - - _query_params.append(('pagination.limit', pagination_limit)) - - if pagination_asc is not None: - - _query_params.append(('pagination.asc', pagination_asc)) - - if sorting_column is not None: - - _query_params.append(('sortingColumn', sorting_column)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2beta/actions/executions/_search', - 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 action_service_list_targets( - self, - action_service_list_targets_request: ActionServiceListTargetsRequest, - _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, - ) -> ActionServiceBetaListTargetsResponse: - """List targets - - List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` Required feature flag: - `actions` - - :param action_service_list_targets_request: (required) - :type action_service_list_targets_request: ActionServiceListTargetsRequest - :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._action_service_list_targets_serialize( - action_service_list_targets_request=action_service_list_targets_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListTargetsResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_targets_with_http_info( - self, - action_service_list_targets_request: ActionServiceListTargetsRequest, - _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[ActionServiceBetaListTargetsResponse]: - """List targets - - List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` Required feature flag: - `actions` - - :param action_service_list_targets_request: (required) - :type action_service_list_targets_request: ActionServiceListTargetsRequest - :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._action_service_list_targets_serialize( - action_service_list_targets_request=action_service_list_targets_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListTargetsResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_list_targets_without_preload_content( - self, - action_service_list_targets_request: ActionServiceListTargetsRequest, - _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: - """List targets - - List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` Required feature flag: - `actions` - - :param action_service_list_targets_request: (required) - :type action_service_list_targets_request: ActionServiceListTargetsRequest - :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._action_service_list_targets_serialize( - action_service_list_targets_request=action_service_list_targets_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaListTargetsResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_list_targets_serialize( - self, - action_service_list_targets_request, - _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_service_list_targets_request is not None: - _body_params = action_service_list_targets_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2beta/actions/targets/_search', - 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 action_service_set_execution( - self, - action_service_set_execution_request: ActionServiceSetExecutionRequest, - _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, - ) -> ActionServiceBetaSetExecutionResponse: - """Set Execution - - Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` Required feature flag: - `actions` - - :param action_service_set_execution_request: (required) - :type action_service_set_execution_request: ActionServiceSetExecutionRequest - :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._action_service_set_execution_serialize( - action_service_set_execution_request=action_service_set_execution_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaSetExecutionResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_set_execution_with_http_info( - self, - action_service_set_execution_request: ActionServiceSetExecutionRequest, - _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[ActionServiceBetaSetExecutionResponse]: - """Set Execution - - Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` Required feature flag: - `actions` - - :param action_service_set_execution_request: (required) - :type action_service_set_execution_request: ActionServiceSetExecutionRequest - :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._action_service_set_execution_serialize( - action_service_set_execution_request=action_service_set_execution_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaSetExecutionResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - 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 action_service_set_execution_without_preload_content( - self, - action_service_set_execution_request: ActionServiceSetExecutionRequest, - _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: - """Set Execution - - Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` Required feature flag: - `actions` - - :param action_service_set_execution_request: (required) - :type action_service_set_execution_request: ActionServiceSetExecutionRequest - :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._action_service_set_execution_serialize( - action_service_set_execution_request=action_service_set_execution_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaSetExecutionResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "ActionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_set_execution_serialize( - self, - action_service_set_execution_request, - _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_service_set_execution_request is not None: - _body_params = action_service_set_execution_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v2beta/actions/executions', - 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 action_service_update_target( - self, - id: StrictStr, - action_service_update_target_request: ActionServiceUpdateTargetRequest, - _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, - ) -> ActionServiceBetaUpdateTargetResponse: - """Update Target - - Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions` - - :param id: (required) - :type id: str - :param action_service_update_target_request: (required) - :type action_service_update_target_request: ActionServiceUpdateTargetRequest - :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._action_service_update_target_serialize( - id=id, - action_service_update_target_request=action_service_update_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaUpdateTargetResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "object", - } - 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 action_service_update_target_with_http_info( - self, - id: StrictStr, - action_service_update_target_request: ActionServiceUpdateTargetRequest, - _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[ActionServiceBetaUpdateTargetResponse]: - """Update Target - - Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions` - - :param id: (required) - :type id: str - :param action_service_update_target_request: (required) - :type action_service_update_target_request: ActionServiceUpdateTargetRequest - :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._action_service_update_target_serialize( - id=id, - action_service_update_target_request=action_service_update_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaUpdateTargetResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "object", - } - 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 action_service_update_target_without_preload_content( - self, - id: StrictStr, - action_service_update_target_request: ActionServiceUpdateTargetRequest, - _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: - """Update Target - - Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions` - - :param id: (required) - :type id: str - :param action_service_update_target_request: (required) - :type action_service_update_target_request: ActionServiceUpdateTargetRequest - :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._action_service_update_target_serialize( - id=id, - action_service_update_target_request=action_service_update_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceBetaUpdateTargetResponse", - '400': "object", - '403': "ActionServiceRpcStatus", - '404': "object", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _action_service_update_target_serialize( - self, - id, - action_service_update_target_request, - _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 - if id is not None: - _path_params['id'] = id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_update_target_request is not None: - _body_params = action_service_update_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2beta/actions/targets/{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 - ) + _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 + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if action_service_update_target_request is not None: + _body_params = action_service_update_target_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2beta/actions/targets/{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 + ) diff --git a/zitadel_client/api/feature_service_api.py b/zitadel_client/api/feature_service_api.py index 9d60962b..935ebd64 100644 --- a/zitadel_client/api/feature_service_api.py +++ b/zitadel_client/api/feature_service_api.py @@ -16,40 +16,40 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr -from typing import Optional -from typing_extensions import Annotated -from zitadel_client.models.feature_service_get_instance_features_response import FeatureServiceGetInstanceFeaturesResponse -from zitadel_client.models.feature_service_get_organization_features_response import FeatureServiceGetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_get_system_features_response import FeatureServiceGetSystemFeaturesResponse -from zitadel_client.models.feature_service_get_user_features_response import FeatureServiceGetUserFeaturesResponse -from zitadel_client.models.feature_service_reset_instance_features_response import FeatureServiceResetInstanceFeaturesResponse -from zitadel_client.models.feature_service_reset_organization_features_response import FeatureServiceResetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_reset_system_features_response import FeatureServiceResetSystemFeaturesResponse -from zitadel_client.models.feature_service_reset_user_features_response import FeatureServiceResetUserFeaturesResponse -from zitadel_client.models.feature_service_set_instance_features_request import FeatureServiceSetInstanceFeaturesRequest -from zitadel_client.models.feature_service_set_instance_features_response import FeatureServiceSetInstanceFeaturesResponse -from zitadel_client.models.feature_service_set_organization_features_response import FeatureServiceSetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_set_system_features_request import FeatureServiceSetSystemFeaturesRequest -from zitadel_client.models.feature_service_set_system_features_response import FeatureServiceSetSystemFeaturesResponse -from zitadel_client.models.feature_service_set_user_features_response import FeatureServiceSetUserFeaturesResponse + from pydantic import Field, StrictBool, StrictStr + from typing import Optional + from typing_extensions import Annotated + from zitadel_client.models.feature_service_get_instance_features_response import FeatureServiceGetInstanceFeaturesResponse + from zitadel_client.models.feature_service_get_organization_features_response import FeatureServiceGetOrganizationFeaturesResponse + from zitadel_client.models.feature_service_get_system_features_response import FeatureServiceGetSystemFeaturesResponse + from zitadel_client.models.feature_service_get_user_features_response import FeatureServiceGetUserFeaturesResponse + from zitadel_client.models.feature_service_reset_instance_features_response import FeatureServiceResetInstanceFeaturesResponse + from zitadel_client.models.feature_service_reset_organization_features_response import FeatureServiceResetOrganizationFeaturesResponse + from zitadel_client.models.feature_service_reset_system_features_response import FeatureServiceResetSystemFeaturesResponse + from zitadel_client.models.feature_service_reset_user_features_response import FeatureServiceResetUserFeaturesResponse + from zitadel_client.models.feature_service_set_instance_features_request import FeatureServiceSetInstanceFeaturesRequest + from zitadel_client.models.feature_service_set_instance_features_response import FeatureServiceSetInstanceFeaturesResponse + from zitadel_client.models.feature_service_set_organization_features_response import FeatureServiceSetOrganizationFeaturesResponse + from zitadel_client.models.feature_service_set_system_features_request import FeatureServiceSetSystemFeaturesRequest + from zitadel_client.models.feature_service_set_system_features_response import FeatureServiceSetSystemFeaturesResponse + from zitadel_client.models.feature_service_set_user_features_response import FeatureServiceSetUserFeaturesResponse from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class FeatureServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class FeatureServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -69,7 +69,7 @@ def feature_service_get_instance_features( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceGetInstanceFeaturesResponse: - """Get Instance Features + """Get Instance Features Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none @@ -97,7 +97,7 @@ def feature_service_get_instance_features( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_instance_features_serialize( + _param = self.__feature_service_get_instance_features_serialize( inheritance=inheritance, _request_auth=_request_auth, _content_type=_content_type, @@ -110,21 +110,89 @@ def feature_service_get_instance_features( '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - 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 + 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 + + + + def __feature_service_get_instance_features_serialize( + self, + inheritance, + _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 + if inheritance is not None: + + _query_params.append(('inheritance', inheritance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/features/instance', + 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 feature_service_get_instance_features_with_http_info( + def feature_service_get_organization_features( self, - inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the instance, it will be omitted from the response or Not Found is returned when the instance has no features flags at all.")] = None, + organization_id: StrictStr, + inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -137,12 +205,14 @@ def feature_service_get_instance_features_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[FeatureServiceGetInstanceFeaturesResponse]: - """Get Instance Features + ) -> FeatureServiceGetOrganizationFeaturesResponse: + """Get Organization Features - Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none + Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to - :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the instance, it will be omitted from the response or Not Found is returned when the instance has no features flags at all. + :param organization_id: (required) + :type organization_id: str + :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all. :type inheritance: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -166,7 +236,8 @@ def feature_service_get_instance_features_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_instance_features_serialize( + _param = self.__feature_service_get_organization_features_serialize( + organization_id=organization_id, inheritance=inheritance, _request_auth=_request_auth, _content_type=_content_type, @@ -175,25 +246,94 @@ def feature_service_get_instance_features_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetInstanceFeaturesResponse", + '200': "FeatureServiceGetOrganizationFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - 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, - ) + 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 + + + + def __feature_service_get_organization_features_serialize( + self, + organization_id, + inheritance, + _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 + if organization_id is not None: + _path_params['organizationId'] = organization_id + # process the query parameters + if inheritance is not None: + + _query_params.append(('inheritance', inheritance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/features/organization/{organizationId}', + 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 feature_service_get_instance_features_without_preload_content( + def feature_service_get_system_features( self, - inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the instance, it will be omitted from the response or Not Found is returned when the instance has no features flags at all.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -206,13 +346,11 @@ def feature_service_get_instance_features_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Instance Features + ) -> FeatureServiceGetSystemFeaturesResponse: + """Get System Features - Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none + Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none - :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the instance, it will be omitted from the response or Not Found is returned when the instance has no features flags at all. - :type inheritance: bool :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 @@ -235,8 +373,7 @@ def feature_service_get_instance_features_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_instance_features_serialize( - inheritance=inheritance, + _param = self.__feature_service_get_system_features_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -244,88 +381,88 @@ def feature_service_get_instance_features_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetInstanceFeaturesResponse", + '200': "FeatureServiceGetSystemFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 + + + + def __feature_service_get_system_features_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - def _feature_service_get_instance_features_serialize( - self, - inheritance, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: + _collection_formats: Dict[str, str] = { + } - _host = None + _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 - _collection_formats: Dict[str, str] = { - } + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter - _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 - if inheritance is not None: - - _query_params.append(('inheritance', inheritance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/features/instance', - 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 - ) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/features/system', + 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 feature_service_get_organization_features( + def feature_service_get_user_features( self, - organization_id: StrictStr, - inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all.")] = None, + user_id: StrictStr, + inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -338,14 +475,14 @@ def feature_service_get_organization_features( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FeatureServiceGetOrganizationFeaturesResponse: - """Get Organization Features + ) -> FeatureServiceGetUserFeaturesResponse: + """Get User Features - Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to + Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user - :param organization_id: (required) - :type organization_id: str - :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all. + :param user_id: (required) + :type user_id: str + :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all. :type inheritance: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -369,8 +506,8 @@ def feature_service_get_organization_features( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_organization_features_serialize( - organization_id=organization_id, + _param = self.__feature_service_get_user_features_serialize( + user_id=user_id, inheritance=inheritance, _request_auth=_request_auth, _content_type=_content_type, @@ -379,26 +516,94 @@ def feature_service_get_organization_features( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetOrganizationFeaturesResponse", + '200': "FeatureServiceGetUserFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - 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 + 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 + + + + def __feature_service_get_user_features_serialize( + self, + user_id, + inheritance, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if inheritance is not None: + + _query_params.append(('inheritance', inheritance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/features/user/{userId}', + 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 feature_service_get_organization_features_with_http_info( + def feature_service_reset_instance_features( self, - organization_id: StrictStr, - inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -411,15 +616,11 @@ def feature_service_get_organization_features_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[FeatureServiceGetOrganizationFeaturesResponse]: - """Get Organization Features + ) -> FeatureServiceResetInstanceFeaturesResponse: + """Reset Instance Features - Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to + Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete - :param organization_id: (required) - :type organization_id: str - :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all. - :type inheritance: bool :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 @@ -442,9 +643,7 @@ def feature_service_get_organization_features_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_organization_features_serialize( - organization_id=organization_id, - inheritance=inheritance, + _param = self.__feature_service_reset_instance_features_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -452,26 +651,87 @@ def feature_service_get_organization_features_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetOrganizationFeaturesResponse", + '200': "FeatureServiceResetInstanceFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - 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, - ) + 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 + + + + def __feature_service_reset_instance_features_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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/features/instance', + 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 feature_service_get_organization_features_without_preload_content( + def feature_service_reset_organization_features( self, organization_id: StrictStr, - inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -484,15 +744,13 @@ def feature_service_get_organization_features_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Organization Features + ) -> FeatureServiceResetOrganizationFeaturesResponse: + """Reset Organization Features - Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to + Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete :param organization_id: (required) :type organization_id: str - :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all. - :type inheritance: bool :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 @@ -515,9 +773,8 @@ def feature_service_get_organization_features_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_organization_features_serialize( + _param = self.__feature_service_reset_organization_features_serialize( organization_id=organization_id, - inheritance=inheritance, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -525,88 +782,88 @@ def feature_service_get_organization_features_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetOrganizationFeaturesResponse", + '200': "FeatureServiceResetOrganizationFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_get_organization_features_serialize( - self, - organization_id, - inheritance, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __feature_service_reset_organization_features_serialize( + self, + organization_id, + _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 - if organization_id is not None: - _path_params['organizationId'] = organization_id - # process the query parameters - if inheritance is not None: - - _query_params.append(('inheritance', inheritance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/features/organization/{organizationId}', - 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 - ) + _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 + if organization_id is not None: + _path_params['organizationId'] = organization_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/features/organization/{organizationId}', + 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 feature_service_get_system_features( + def feature_service_reset_system_features( self, _request_timeout: Union[ None, @@ -620,10 +877,10 @@ def feature_service_get_system_features( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FeatureServiceGetSystemFeaturesResponse: - """Get System Features + ) -> FeatureServiceResetSystemFeaturesResponse: + """Reset System Features - Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -647,7 +904,7 @@ def feature_service_get_system_features( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_system_features_serialize( + _param = self.__feature_service_reset_system_features_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -655,24 +912,87 @@ def feature_service_get_system_features( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetSystemFeaturesResponse", + '200': "FeatureServiceResetSystemFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - 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 + 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 + + + + def __feature_service_reset_system_features_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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/features/system', + 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 feature_service_get_system_features_with_http_info( + def feature_service_reset_user_features( self, + user_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -685,11 +1005,13 @@ def feature_service_get_system_features_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[FeatureServiceGetSystemFeaturesResponse]: - """Get System Features + ) -> FeatureServiceResetUserFeaturesResponse: + """Reset User Features - Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete + :param user_id: (required) + :type user_id: str :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 @@ -712,7 +1034,8 @@ def feature_service_get_system_features_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_system_features_serialize( + _param = self.__feature_service_reset_user_features_serialize( + user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -720,24 +1043,90 @@ def feature_service_get_system_features_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetSystemFeaturesResponse", + '200': "FeatureServiceResetUserFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - 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, - ) + 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 + + + + def __feature_service_reset_user_features_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/features/user/{userId}', + 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 feature_service_get_system_features_without_preload_content( + def feature_service_set_instance_features( self, + feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -750,11 +1139,13 @@ def feature_service_get_system_features_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get System Features + ) -> FeatureServiceSetInstanceFeaturesResponse: + """Set Instance Features - Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write + :param feature_service_set_instance_features_request: (required) + :type feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest :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 @@ -777,7 +1168,8 @@ def feature_service_get_system_features_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_system_features_serialize( + _param = self.__feature_service_set_instance_features_serialize( + feature_service_set_instance_features_request=feature_service_set_instance_features_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -785,83 +1177,103 @@ def feature_service_get_system_features_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetSystemFeaturesResponse", + '200': "FeatureServiceSetInstanceFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_get_system_features_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __feature_service_set_instance_features_serialize( + self, + feature_service_set_instance_features_request, + _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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/features/system', - 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 - ) + _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 feature_service_set_instance_features_request is not None: + _body_params = feature_service_set_instance_features_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v2/features/instance', + 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 feature_service_get_user_features( + def feature_service_set_organization_features( self, - user_id: StrictStr, - inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all.")] = None, + organization_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -874,15 +1286,13 @@ def feature_service_get_user_features( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FeatureServiceGetUserFeaturesResponse: - """Get User Features + ) -> FeatureServiceSetOrganizationFeaturesResponse: + """Set Organization Features - Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user + Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write - :param user_id: (required) - :type user_id: str - :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all. - :type inheritance: bool + :param organization_id: (required) + :type organization_id: str :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 @@ -905,9 +1315,8 @@ def feature_service_get_user_features( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_user_features_serialize( - user_id=user_id, - inheritance=inheritance, + _param = self.__feature_service_set_organization_features_serialize( + organization_id=organization_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -915,26 +1324,90 @@ def feature_service_get_user_features( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetUserFeaturesResponse", + '200': "FeatureServiceSetOrganizationFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - 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 + 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 + + + + def __feature_service_set_organization_features_serialize( + self, + organization_id, + _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 + if organization_id is not None: + _path_params['organizationId'] = organization_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v2/features/organization/{organizationId}', + 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 feature_service_get_user_features_with_http_info( + def feature_service_set_system_features( self, - user_id: StrictStr, - inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all.")] = None, + feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -947,15 +1420,13 @@ def feature_service_get_user_features_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[FeatureServiceGetUserFeaturesResponse]: - """Get User Features + ) -> FeatureServiceSetSystemFeaturesResponse: + """Set System Features - Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user + Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write - :param user_id: (required) - :type user_id: str - :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all. - :type inheritance: bool + :param feature_service_set_system_features_request: (required) + :type feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest :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 @@ -978,9 +1449,8 @@ def feature_service_get_user_features_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_user_features_serialize( - user_id=user_id, - inheritance=inheritance, + _param = self.__feature_service_set_system_features_serialize( + feature_service_set_system_features_request=feature_service_set_system_features_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -988,26 +1458,103 @@ def feature_service_get_user_features_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetUserFeaturesResponse", + '200': "FeatureServiceSetSystemFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - 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, - ) + 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 + + + + def __feature_service_set_system_features_serialize( + self, + feature_service_set_system_features_request, + _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 feature_service_set_system_features_request is not None: + _body_params = feature_service_set_system_features_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v2/features/system', + 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 feature_service_get_user_features_without_preload_content( + def feature_service_set_user_features( self, user_id: StrictStr, - inheritance: Annotated[Optional[StrictBool], Field(description="Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1020,15 +1567,13 @@ def feature_service_get_user_features_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get User Features + ) -> FeatureServiceSetUserFeaturesResponse: + """Set User Features - Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user + Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write :param user_id: (required) :type user_id: str - :param inheritance: Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all. - :type inheritance: bool :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 @@ -1051,9 +1596,8 @@ def feature_service_get_user_features_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._feature_service_get_user_features_serialize( + _param = self.__feature_service_set_user_features_serialize( user_id=user_id, - inheritance=inheritance, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1061,2239 +1605,81 @@ def feature_service_get_user_features_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetUserFeaturesResponse", + '200': "FeatureServiceSetUserFeaturesResponse", '403': "FeatureServiceRpcStatus", '404': "FeatureServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_get_user_features_serialize( - self, - user_id, - inheritance, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __feature_service_set_user_features_serialize( + self, + user_id, + _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - if inheritance is not None: - - _query_params.append(('inheritance', inheritance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/features/user/{userId}', - 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 feature_service_reset_instance_features( - 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, - ) -> FeatureServiceResetInstanceFeaturesResponse: - """Reset Instance Features - - Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete - - :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._feature_service_reset_instance_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetInstanceFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_reset_instance_features_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[FeatureServiceResetInstanceFeaturesResponse]: - """Reset Instance Features - - Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete - - :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._feature_service_reset_instance_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetInstanceFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_reset_instance_features_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: - """Reset Instance Features - - Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete - - :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._feature_service_reset_instance_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetInstanceFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_reset_instance_features_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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/features/instance', - 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 feature_service_reset_organization_features( - self, - organization_id: StrictStr, - _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, - ) -> FeatureServiceResetOrganizationFeaturesResponse: - """Reset Organization Features - - Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete - - :param organization_id: (required) - :type organization_id: str - :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._feature_service_reset_organization_features_serialize( - organization_id=organization_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetOrganizationFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_reset_organization_features_with_http_info( - self, - organization_id: StrictStr, - _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[FeatureServiceResetOrganizationFeaturesResponse]: - """Reset Organization Features - - Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete - - :param organization_id: (required) - :type organization_id: str - :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._feature_service_reset_organization_features_serialize( - organization_id=organization_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetOrganizationFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_reset_organization_features_without_preload_content( - self, - organization_id: StrictStr, - _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: - """Reset Organization Features - - Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete - - :param organization_id: (required) - :type organization_id: str - :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._feature_service_reset_organization_features_serialize( - organization_id=organization_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetOrganizationFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_reset_organization_features_serialize( - self, - organization_id, - _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 - if organization_id is not None: - _path_params['organizationId'] = organization_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/features/organization/{organizationId}', - 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 feature_service_reset_system_features( - 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, - ) -> FeatureServiceResetSystemFeaturesResponse: - """Reset System Features - - Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete - - :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._feature_service_reset_system_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetSystemFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_reset_system_features_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[FeatureServiceResetSystemFeaturesResponse]: - """Reset System Features - - Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete - - :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._feature_service_reset_system_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetSystemFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_reset_system_features_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: - """Reset System Features - - Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete - - :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._feature_service_reset_system_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetSystemFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_reset_system_features_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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/features/system', - 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 feature_service_reset_user_features( - self, - user_id: StrictStr, - _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, - ) -> FeatureServiceResetUserFeaturesResponse: - """Reset User Features - - Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete - - :param user_id: (required) - :type user_id: str - :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._feature_service_reset_user_features_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetUserFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_reset_user_features_with_http_info( - self, - user_id: StrictStr, - _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[FeatureServiceResetUserFeaturesResponse]: - """Reset User Features - - Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete - - :param user_id: (required) - :type user_id: str - :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._feature_service_reset_user_features_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetUserFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_reset_user_features_without_preload_content( - self, - user_id: StrictStr, - _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: - """Reset User Features - - Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete - - :param user_id: (required) - :type user_id: str - :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._feature_service_reset_user_features_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetUserFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_reset_user_features_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/features/user/{userId}', - 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 feature_service_set_instance_features( - self, - feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest, - _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, - ) -> FeatureServiceSetInstanceFeaturesResponse: - """Set Instance Features - - Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write - - :param feature_service_set_instance_features_request: (required) - :type feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest - :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._feature_service_set_instance_features_serialize( - feature_service_set_instance_features_request=feature_service_set_instance_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetInstanceFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_set_instance_features_with_http_info( - self, - feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest, - _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[FeatureServiceSetInstanceFeaturesResponse]: - """Set Instance Features - - Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write - - :param feature_service_set_instance_features_request: (required) - :type feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest - :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._feature_service_set_instance_features_serialize( - feature_service_set_instance_features_request=feature_service_set_instance_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetInstanceFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_set_instance_features_without_preload_content( - self, - feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest, - _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: - """Set Instance Features - - Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write - - :param feature_service_set_instance_features_request: (required) - :type feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest - :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._feature_service_set_instance_features_serialize( - feature_service_set_instance_features_request=feature_service_set_instance_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetInstanceFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_set_instance_features_serialize( - self, - feature_service_set_instance_features_request, - _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 feature_service_set_instance_features_request is not None: - _body_params = feature_service_set_instance_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/features/instance', - 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 feature_service_set_organization_features( - self, - organization_id: StrictStr, - _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, - ) -> FeatureServiceSetOrganizationFeaturesResponse: - """Set Organization Features - - Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write - - :param organization_id: (required) - :type organization_id: str - :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._feature_service_set_organization_features_serialize( - organization_id=organization_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetOrganizationFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_set_organization_features_with_http_info( - self, - organization_id: StrictStr, - _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[FeatureServiceSetOrganizationFeaturesResponse]: - """Set Organization Features - - Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write - - :param organization_id: (required) - :type organization_id: str - :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._feature_service_set_organization_features_serialize( - organization_id=organization_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetOrganizationFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_set_organization_features_without_preload_content( - self, - organization_id: StrictStr, - _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: - """Set Organization Features - - Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write - - :param organization_id: (required) - :type organization_id: str - :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._feature_service_set_organization_features_serialize( - organization_id=organization_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetOrganizationFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_set_organization_features_serialize( - self, - organization_id, - _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 - if organization_id is not None: - _path_params['organizationId'] = organization_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/features/organization/{organizationId}', - 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 feature_service_set_system_features( - self, - feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest, - _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, - ) -> FeatureServiceSetSystemFeaturesResponse: - """Set System Features - - Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write - - :param feature_service_set_system_features_request: (required) - :type feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest - :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._feature_service_set_system_features_serialize( - feature_service_set_system_features_request=feature_service_set_system_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetSystemFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_set_system_features_with_http_info( - self, - feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest, - _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[FeatureServiceSetSystemFeaturesResponse]: - """Set System Features - - Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write - - :param feature_service_set_system_features_request: (required) - :type feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest - :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._feature_service_set_system_features_serialize( - feature_service_set_system_features_request=feature_service_set_system_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetSystemFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_set_system_features_without_preload_content( - self, - feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest, - _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: - """Set System Features - - Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write - - :param feature_service_set_system_features_request: (required) - :type feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest - :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._feature_service_set_system_features_serialize( - feature_service_set_system_features_request=feature_service_set_system_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetSystemFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_set_system_features_serialize( - self, - feature_service_set_system_features_request, - _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 feature_service_set_system_features_request is not None: - _body_params = feature_service_set_system_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/features/system', - 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 feature_service_set_user_features( - self, - user_id: StrictStr, - _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, - ) -> FeatureServiceSetUserFeaturesResponse: - """Set User Features - - Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write - - :param user_id: (required) - :type user_id: str - :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._feature_service_set_user_features_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetUserFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_set_user_features_with_http_info( - self, - user_id: StrictStr, - _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[FeatureServiceSetUserFeaturesResponse]: - """Set User Features - - Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write - - :param user_id: (required) - :type user_id: str - :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._feature_service_set_user_features_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetUserFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - 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 feature_service_set_user_features_without_preload_content( - self, - user_id: StrictStr, - _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: - """Set User Features - - Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write - - :param user_id: (required) - :type user_id: str - :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._feature_service_set_user_features_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetUserFeaturesResponse", - '403': "FeatureServiceRpcStatus", - '404': "FeatureServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _feature_service_set_user_features_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/features/user/{userId}', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v2/features/user/{userId}', + 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 + ) diff --git a/zitadel_client/api/identity_provider_service_api.py b/zitadel_client/api/identity_provider_service_api.py index f8c82b16..36e096e5 100644 --- a/zitadel_client/api/identity_provider_service_api.py +++ b/zitadel_client/api/identity_provider_service_api.py @@ -16,25 +16,25 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr -from zitadel_client.models.identity_provider_service_get_idpby_id_response import IdentityProviderServiceGetIDPByIDResponse + from pydantic import StrictStr + from zitadel_client.models.identity_provider_service_get_idpby_id_response import IdentityProviderServiceGetIDPByIDResponse from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class IdentityProviderServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class IdentityProviderServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -54,145 +54,7 @@ def identity_provider_service_get_idpby_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> IdentityProviderServiceGetIDPByIDResponse: - """Get identity provider (IdP) by ID - - Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. - - :param id: (required) - :type id: str - :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._identity_provider_service_get_idpby_id_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IdentityProviderServiceGetIDPByIDResponse", - '403': "IdentityProviderServiceRpcStatus", - '404': "IdentityProviderServiceRpcStatus", - } - 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 identity_provider_service_get_idpby_id_with_http_info( - self, - id: StrictStr, - _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[IdentityProviderServiceGetIDPByIDResponse]: - """Get identity provider (IdP) by ID - - Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. - - :param id: (required) - :type id: str - :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._identity_provider_service_get_idpby_id_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IdentityProviderServiceGetIDPByIDResponse", - '403': "IdentityProviderServiceRpcStatus", - '404': "IdentityProviderServiceRpcStatus", - } - 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 identity_provider_service_get_idpby_id_without_preload_content( - self, - id: StrictStr, - _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 identity provider (IdP) by ID + """Get identity provider (IdP) by ID Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. @@ -220,7 +82,7 @@ def identity_provider_service_get_idpby_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._identity_provider_service_get_idpby_id_serialize( + _param = self.__identity_provider_service_get_idpby_id_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, @@ -233,72 +95,77 @@ def identity_provider_service_get_idpby_id_without_preload_content( '403': "IdentityProviderServiceRpcStatus", '404': "IdentityProviderServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _identity_provider_service_get_idpby_id_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __identity_provider_service_get_idpby_id_serialize( + self, + id, + _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 - if id is not None: - _path_params['id'] = id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/idps/{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 - ) + _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 + if id is not None: + _path_params['id'] = id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/idps/{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 + ) diff --git a/zitadel_client/api/oidc_service_api.py b/zitadel_client/api/oidc_service_api.py index 44789c09..f147cdc0 100644 --- a/zitadel_client/api/oidc_service_api.py +++ b/zitadel_client/api/oidc_service_api.py @@ -16,31 +16,31 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import Any, Dict -from typing_extensions import Annotated -from zitadel_client.models.oidc_service_authorize_or_deny_device_authorization_request import OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest -from zitadel_client.models.oidc_service_create_callback_request import OIDCServiceCreateCallbackRequest -from zitadel_client.models.oidc_service_create_callback_response import OIDCServiceCreateCallbackResponse -from zitadel_client.models.oidc_service_get_auth_request_response import OIDCServiceGetAuthRequestResponse -from zitadel_client.models.oidc_service_get_device_authorization_request_response import OIDCServiceGetDeviceAuthorizationRequestResponse + from pydantic import Field, StrictStr + from typing import Any, Dict + from typing_extensions import Annotated + from zitadel_client.models.oidc_service_authorize_or_deny_device_authorization_request import OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest + from zitadel_client.models.oidc_service_create_callback_request import OIDCServiceCreateCallbackRequest + from zitadel_client.models.oidc_service_create_callback_response import OIDCServiceCreateCallbackResponse + from zitadel_client.models.oidc_service_get_auth_request_response import OIDCServiceGetAuthRequestResponse + from zitadel_client.models.oidc_service_get_device_authorization_request_response import OIDCServiceGetDeviceAuthorizationRequestResponse from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class OIDCServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class OIDCServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -61,153 +61,7 @@ def o_idc_service_authorize_or_deny_device_authorization( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> object: - """Authorize or deny device authorization - - Authorize or deny the device authorization request based on the provided device authorization id. - - :param device_authorization_id: The device authorization id returned when submitting the user code. (required) - :type device_authorization_id: str - :param oidc_service_authorize_or_deny_device_authorization_request: (required) - :type oidc_service_authorize_or_deny_device_authorization_request: OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest - :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._o_idc_service_authorize_or_deny_device_authorization_serialize( - device_authorization_id=device_authorization_id, - oidc_service_authorize_or_deny_device_authorization_request=oidc_service_authorize_or_deny_device_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '403': "OIDCServiceRpcStatus", - '404': "OIDCServiceRpcStatus", - } - 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 o_idc_service_authorize_or_deny_device_authorization_with_http_info( - self, - device_authorization_id: Annotated[StrictStr, Field(description="The device authorization id returned when submitting the user code.")], - oidc_service_authorize_or_deny_device_authorization_request: OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest, - _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[object]: - """Authorize or deny device authorization - - Authorize or deny the device authorization request based on the provided device authorization id. - - :param device_authorization_id: The device authorization id returned when submitting the user code. (required) - :type device_authorization_id: str - :param oidc_service_authorize_or_deny_device_authorization_request: (required) - :type oidc_service_authorize_or_deny_device_authorization_request: OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest - :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._o_idc_service_authorize_or_deny_device_authorization_serialize( - device_authorization_id=device_authorization_id, - oidc_service_authorize_or_deny_device_authorization_request=oidc_service_authorize_or_deny_device_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '403': "OIDCServiceRpcStatus", - '404': "OIDCServiceRpcStatus", - } - 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 o_idc_service_authorize_or_deny_device_authorization_without_preload_content( - self, - device_authorization_id: Annotated[StrictStr, Field(description="The device authorization id returned when submitting the user code.")], - oidc_service_authorize_or_deny_device_authorization_request: OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest, - _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: - """Authorize or deny device authorization + """Authorize or deny device authorization Authorize or deny the device authorization request based on the provided device authorization id. @@ -237,7 +91,7 @@ def o_idc_service_authorize_or_deny_device_authorization_without_preload_content :return: Returns the result object. """ # noqa: E501 - _param = self._o_idc_service_authorize_or_deny_device_authorization_serialize( + _param = self.__o_idc_service_authorize_or_deny_device_authorization_serialize( device_authorization_id=device_authorization_id, oidc_service_authorize_or_deny_device_authorization_request=oidc_service_authorize_or_deny_device_authorization_request, _request_auth=_request_auth, @@ -251,89 +105,94 @@ def o_idc_service_authorize_or_deny_device_authorization_without_preload_content '403': "OIDCServiceRpcStatus", '404': "OIDCServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _o_idc_service_authorize_or_deny_device_authorization_serialize( - self, - device_authorization_id, - oidc_service_authorize_or_deny_device_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __o_idc_service_authorize_or_deny_device_authorization_serialize( + self, + device_authorization_id, + oidc_service_authorize_or_deny_device_authorization_request, + _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 - if device_authorization_id is not None: - _path_params['deviceAuthorizationId'] = device_authorization_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if oidc_service_authorize_or_deny_device_authorization_request is not None: - _body_params = oidc_service_authorize_or_deny_device_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/oidc/device_authorization/{deviceAuthorizationId}', - 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 - ) + _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 + if device_authorization_id is not None: + _path_params['deviceAuthorizationId'] = device_authorization_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if oidc_service_authorize_or_deny_device_authorization_request is not None: + _body_params = oidc_service_authorize_or_deny_device_authorization_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/oidc/device_authorization/{deviceAuthorizationId}', + 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 + ) @@ -356,153 +215,7 @@ def o_idc_service_create_callback( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OIDCServiceCreateCallbackResponse: - """Finalize an Auth Request and get the callback URL. - - Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. - - :param auth_request_id: ID of the Auth Request. (required) - :type auth_request_id: str - :param oidc_service_create_callback_request: (required) - :type oidc_service_create_callback_request: OIDCServiceCreateCallbackRequest - :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._o_idc_service_create_callback_serialize( - auth_request_id=auth_request_id, - oidc_service_create_callback_request=oidc_service_create_callback_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceCreateCallbackResponse", - '403': "OIDCServiceRpcStatus", - '404': "OIDCServiceRpcStatus", - } - 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 o_idc_service_create_callback_with_http_info( - self, - auth_request_id: Annotated[StrictStr, Field(description="ID of the Auth Request.")], - oidc_service_create_callback_request: OIDCServiceCreateCallbackRequest, - _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[OIDCServiceCreateCallbackResponse]: - """Finalize an Auth Request and get the callback URL. - - Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. - - :param auth_request_id: ID of the Auth Request. (required) - :type auth_request_id: str - :param oidc_service_create_callback_request: (required) - :type oidc_service_create_callback_request: OIDCServiceCreateCallbackRequest - :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._o_idc_service_create_callback_serialize( - auth_request_id=auth_request_id, - oidc_service_create_callback_request=oidc_service_create_callback_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceCreateCallbackResponse", - '403': "OIDCServiceRpcStatus", - '404': "OIDCServiceRpcStatus", - } - 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 o_idc_service_create_callback_without_preload_content( - self, - auth_request_id: Annotated[StrictStr, Field(description="ID of the Auth Request.")], - oidc_service_create_callback_request: OIDCServiceCreateCallbackRequest, - _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: - """Finalize an Auth Request and get the callback URL. + """Finalize an Auth Request and get the callback URL. Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. @@ -532,7 +245,7 @@ def o_idc_service_create_callback_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._o_idc_service_create_callback_serialize( + _param = self.__o_idc_service_create_callback_serialize( auth_request_id=auth_request_id, oidc_service_create_callback_request=oidc_service_create_callback_request, _request_auth=_request_auth, @@ -546,89 +259,94 @@ def o_idc_service_create_callback_without_preload_content( '403': "OIDCServiceRpcStatus", '404': "OIDCServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _o_idc_service_create_callback_serialize( - self, - auth_request_id, - oidc_service_create_callback_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __o_idc_service_create_callback_serialize( + self, + auth_request_id, + oidc_service_create_callback_request, + _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 - if auth_request_id is not None: - _path_params['authRequestId'] = auth_request_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if oidc_service_create_callback_request is not None: - _body_params = oidc_service_create_callback_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/oidc/auth_requests/{authRequestId}', - 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 - ) + _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 + if auth_request_id is not None: + _path_params['authRequestId'] = auth_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if oidc_service_create_callback_request is not None: + _body_params = oidc_service_create_callback_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/oidc/auth_requests/{authRequestId}', + 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 + ) @@ -650,145 +368,7 @@ def o_idc_service_get_auth_request( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OIDCServiceGetAuthRequestResponse: - """Get OIDC Auth Request details - - Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. - - :param auth_request_id: ID of the Auth Request, as obtained from the redirect URL. (required) - :type auth_request_id: str - :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._o_idc_service_get_auth_request_serialize( - auth_request_id=auth_request_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceGetAuthRequestResponse", - '403': "OIDCServiceRpcStatus", - '404': "OIDCServiceRpcStatus", - } - 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 o_idc_service_get_auth_request_with_http_info( - self, - auth_request_id: Annotated[StrictStr, Field(description="ID of the Auth Request, as obtained from the redirect URL.")], - _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[OIDCServiceGetAuthRequestResponse]: - """Get OIDC Auth Request details - - Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. - - :param auth_request_id: ID of the Auth Request, as obtained from the redirect URL. (required) - :type auth_request_id: str - :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._o_idc_service_get_auth_request_serialize( - auth_request_id=auth_request_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceGetAuthRequestResponse", - '403': "OIDCServiceRpcStatus", - '404': "OIDCServiceRpcStatus", - } - 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 o_idc_service_get_auth_request_without_preload_content( - self, - auth_request_id: Annotated[StrictStr, Field(description="ID of the Auth Request, as obtained from the redirect URL.")], - _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 OIDC Auth Request details + """Get OIDC Auth Request details Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. @@ -816,7 +396,7 @@ def o_idc_service_get_auth_request_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._o_idc_service_get_auth_request_serialize( + _param = self.__o_idc_service_get_auth_request_serialize( auth_request_id=auth_request_id, _request_auth=_request_auth, _content_type=_content_type, @@ -829,73 +409,78 @@ def o_idc_service_get_auth_request_without_preload_content( '403': "OIDCServiceRpcStatus", '404': "OIDCServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _o_idc_service_get_auth_request_serialize( - self, - auth_request_id, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __o_idc_service_get_auth_request_serialize( + self, + auth_request_id, + _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 - if auth_request_id is not None: - _path_params['authRequestId'] = auth_request_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/oidc/auth_requests/{authRequestId}', - 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 - ) + _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 + if auth_request_id is not None: + _path_params['authRequestId'] = auth_request_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/oidc/auth_requests/{authRequestId}', + 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 + ) @@ -917,76 +502,7 @@ def o_idc_service_get_device_authorization_request( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OIDCServiceGetDeviceAuthorizationRequestResponse: - """Get device authorization request - - Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. - - :param user_code: The user_code returned by the device authorization request and provided to the user by the device. (required) - :type user_code: str - :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._o_idc_service_get_device_authorization_request_serialize( - user_code=user_code, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceGetDeviceAuthorizationRequestResponse", - '403': "OIDCServiceRpcStatus", - '404': "OIDCServiceRpcStatus", - } - 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 o_idc_service_get_device_authorization_request_with_http_info( - self, - user_code: Annotated[StrictStr, Field(description="The user_code returned by the device authorization request and provided to the user by the device.")], - _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[OIDCServiceGetDeviceAuthorizationRequestResponse]: - """Get device authorization request + """Get device authorization request Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. @@ -1014,7 +530,7 @@ def o_idc_service_get_device_authorization_request_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._o_idc_service_get_device_authorization_request_serialize( + _param = self.__o_idc_service_get_device_authorization_request_serialize( user_code=user_code, _request_auth=_request_auth, _content_type=_content_type, @@ -1027,141 +543,77 @@ def o_idc_service_get_device_authorization_request_with_http_info( '403': "OIDCServiceRpcStatus", '404': "OIDCServiceRpcStatus", } - 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 o_idc_service_get_device_authorization_request_without_preload_content( - self, - user_code: Annotated[StrictStr, Field(description="The user_code returned by the device authorization request and provided to the user by the device.")], - _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 device authorization request - - Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. - - :param user_code: The user_code returned by the device authorization request and provided to the user by the device. (required) - :type user_code: str - :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._o_idc_service_get_device_authorization_request_serialize( - user_code=user_code, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceGetDeviceAuthorizationRequestResponse", - '403': "OIDCServiceRpcStatus", - '404': "OIDCServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _o_idc_service_get_device_authorization_request_serialize( - self, - user_code, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __o_idc_service_get_device_authorization_request_serialize( + self, + user_code, + _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 - if user_code is not None: - _path_params['userCode'] = user_code - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/oidc/device_authorization/{userCode}', - 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 - ) + _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 + if user_code is not None: + _path_params['userCode'] = user_code + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/oidc/device_authorization/{userCode}', + 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 + ) diff --git a/zitadel_client/api/organization_service_api.py b/zitadel_client/api/organization_service_api.py index cbf423e9..98737fef 100644 --- a/zitadel_client/api/organization_service_api.py +++ b/zitadel_client/api/organization_service_api.py @@ -16,27 +16,27 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from zitadel_client.models.organization_service_add_organization_request import OrganizationServiceAddOrganizationRequest -from zitadel_client.models.organization_service_add_organization_response import OrganizationServiceAddOrganizationResponse -from zitadel_client.models.organization_service_list_organizations_request import OrganizationServiceListOrganizationsRequest -from zitadel_client.models.organization_service_list_organizations_response import OrganizationServiceListOrganizationsResponse + from zitadel_client.models.organization_service_add_organization_request import OrganizationServiceAddOrganizationRequest + from zitadel_client.models.organization_service_add_organization_response import OrganizationServiceAddOrganizationResponse + from zitadel_client.models.organization_service_list_organizations_request import OrganizationServiceListOrganizationsRequest + from zitadel_client.models.organization_service_list_organizations_response import OrganizationServiceListOrganizationsResponse from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class OrganizationServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class OrganizationServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -56,7 +56,7 @@ def organization_service_add_organization( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceAddOrganizationResponse: - """Create an Organization + """Create an Organization Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. @@ -84,7 +84,7 @@ def organization_service_add_organization( :return: Returns the result object. """ # noqa: E501 - _param = self._organization_service_add_organization_serialize( + _param = self.__organization_service_add_organization_serialize( organization_service_add_organization_request=organization_service_add_organization_request, _request_auth=_request_auth, _content_type=_content_type, @@ -97,224 +97,91 @@ def organization_service_add_organization( '403': "OrganizationServiceRpcStatus", '404': "OrganizationServiceRpcStatus", } - 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 organization_service_add_organization_with_http_info( - self, - organization_service_add_organization_request: OrganizationServiceAddOrganizationRequest, - _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[OrganizationServiceAddOrganizationResponse]: - """Create an Organization - - Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. - - :param organization_service_add_organization_request: (required) - :type organization_service_add_organization_request: OrganizationServiceAddOrganizationRequest - :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._organization_service_add_organization_serialize( - organization_service_add_organization_request=organization_service_add_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceAddOrganizationResponse", - '403': "OrganizationServiceRpcStatus", - '404': "OrganizationServiceRpcStatus", - } - 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 organization_service_add_organization_without_preload_content( - self, - organization_service_add_organization_request: OrganizationServiceAddOrganizationRequest, - _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 an Organization - - Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. - - :param organization_service_add_organization_request: (required) - :type organization_service_add_organization_request: OrganizationServiceAddOrganizationRequest - :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._organization_service_add_organization_serialize( - organization_service_add_organization_request=organization_service_add_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceAddOrganizationResponse", - '403': "OrganizationServiceRpcStatus", - '404': "OrganizationServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _organization_service_add_organization_serialize( - self, - organization_service_add_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __organization_service_add_organization_serialize( + self, + organization_service_add_organization_request, + _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 organization_service_add_organization_request is not None: - _body_params = organization_service_add_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/organizations', - 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 - ) + _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 organization_service_add_organization_request is not None: + _body_params = organization_service_add_organization_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/organizations', + 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 + ) @@ -336,7 +203,7 @@ def organization_service_list_organizations( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceListOrganizationsResponse: - """Search Organizations + """Search Organizations Search for Organizations. By default, we will return all organization of the instance. Make sure to include a limit and sorting for pagination.. @@ -364,7 +231,7 @@ def organization_service_list_organizations( :return: Returns the result object. """ # noqa: E501 - _param = self._organization_service_list_organizations_serialize( + _param = self.__organization_service_list_organizations_serialize( organization_service_list_organizations_request=organization_service_list_organizations_request, _request_auth=_request_auth, _content_type=_content_type, @@ -378,225 +245,90 @@ def organization_service_list_organizations( '403': "OrganizationServiceRpcStatus", '404': "OrganizationServiceRpcStatus", } - 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 organization_service_list_organizations_with_http_info( - self, - organization_service_list_organizations_request: OrganizationServiceListOrganizationsRequest, - _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[OrganizationServiceListOrganizationsResponse]: - """Search Organizations - - Search for Organizations. By default, we will return all organization of the instance. Make sure to include a limit and sorting for pagination.. - - :param organization_service_list_organizations_request: (required) - :type organization_service_list_organizations_request: OrganizationServiceListOrganizationsRequest - :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._organization_service_list_organizations_serialize( - organization_service_list_organizations_request=organization_service_list_organizations_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceListOrganizationsResponse", - '400': "OrganizationServiceRpcStatus", - '403': "OrganizationServiceRpcStatus", - '404': "OrganizationServiceRpcStatus", - } - 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 organization_service_list_organizations_without_preload_content( - self, - organization_service_list_organizations_request: OrganizationServiceListOrganizationsRequest, - _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: - """Search Organizations - - Search for Organizations. By default, we will return all organization of the instance. Make sure to include a limit and sorting for pagination.. - - :param organization_service_list_organizations_request: (required) - :type organization_service_list_organizations_request: OrganizationServiceListOrganizationsRequest - :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._organization_service_list_organizations_serialize( - organization_service_list_organizations_request=organization_service_list_organizations_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceListOrganizationsResponse", - '400': "OrganizationServiceRpcStatus", - '403': "OrganizationServiceRpcStatus", - '404': "OrganizationServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _organization_service_list_organizations_serialize( - self, - organization_service_list_organizations_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __organization_service_list_organizations_serialize( + self, + organization_service_list_organizations_request, + _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 organization_service_list_organizations_request is not None: - _body_params = organization_service_list_organizations_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/organizations/_search', - 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 - ) + _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 organization_service_list_organizations_request is not None: + _body_params = organization_service_list_organizations_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/organizations/_search', + 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 + ) diff --git a/zitadel_client/api/saml_service_api.py b/zitadel_client/api/saml_service_api.py index b0476a2c..982bbf25 100644 --- a/zitadel_client/api/saml_service_api.py +++ b/zitadel_client/api/saml_service_api.py @@ -16,28 +16,28 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from zitadel_client.models.saml_service_create_response_request import SAMLServiceCreateResponseRequest -from zitadel_client.models.saml_service_create_response_response import SAMLServiceCreateResponseResponse -from zitadel_client.models.saml_service_get_saml_request_response import SAMLServiceGetSAMLRequestResponse + from pydantic import Field, StrictStr + from typing_extensions import Annotated + from zitadel_client.models.saml_service_create_response_request import SAMLServiceCreateResponseRequest + from zitadel_client.models.saml_service_create_response_response import SAMLServiceCreateResponseResponse + from zitadel_client.models.saml_service_get_saml_request_response import SAMLServiceGetSAMLRequestResponse from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class SAMLServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class SAMLServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -58,153 +58,7 @@ def s_aml_service_create_response( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SAMLServiceCreateResponseResponse: - """Finalize a SAML Request and get the response. - - Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. - - :param saml_request_id: ID of the SAML Request. (required) - :type saml_request_id: str - :param saml_service_create_response_request: (required) - :type saml_service_create_response_request: SAMLServiceCreateResponseRequest - :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._s_aml_service_create_response_serialize( - saml_request_id=saml_request_id, - saml_service_create_response_request=saml_service_create_response_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SAMLServiceCreateResponseResponse", - '403': "SAMLServiceRpcStatus", - '404': "SAMLServiceRpcStatus", - } - 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 s_aml_service_create_response_with_http_info( - self, - saml_request_id: Annotated[StrictStr, Field(description="ID of the SAML Request.")], - saml_service_create_response_request: SAMLServiceCreateResponseRequest, - _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[SAMLServiceCreateResponseResponse]: - """Finalize a SAML Request and get the response. - - Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. - - :param saml_request_id: ID of the SAML Request. (required) - :type saml_request_id: str - :param saml_service_create_response_request: (required) - :type saml_service_create_response_request: SAMLServiceCreateResponseRequest - :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._s_aml_service_create_response_serialize( - saml_request_id=saml_request_id, - saml_service_create_response_request=saml_service_create_response_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SAMLServiceCreateResponseResponse", - '403': "SAMLServiceRpcStatus", - '404': "SAMLServiceRpcStatus", - } - 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 s_aml_service_create_response_without_preload_content( - self, - saml_request_id: Annotated[StrictStr, Field(description="ID of the SAML Request.")], - saml_service_create_response_request: SAMLServiceCreateResponseRequest, - _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: - """Finalize a SAML Request and get the response. + """Finalize a SAML Request and get the response. Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. @@ -234,7 +88,7 @@ def s_aml_service_create_response_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._s_aml_service_create_response_serialize( + _param = self.__s_aml_service_create_response_serialize( saml_request_id=saml_request_id, saml_service_create_response_request=saml_service_create_response_request, _request_auth=_request_auth, @@ -248,89 +102,94 @@ def s_aml_service_create_response_without_preload_content( '403': "SAMLServiceRpcStatus", '404': "SAMLServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _s_aml_service_create_response_serialize( - self, - saml_request_id, - saml_service_create_response_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __s_aml_service_create_response_serialize( + self, + saml_request_id, + saml_service_create_response_request, + _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 - if saml_request_id is not None: - _path_params['samlRequestId'] = saml_request_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if saml_service_create_response_request is not None: - _body_params = saml_service_create_response_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/saml/saml_requests/{samlRequestId}', - 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 - ) + _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 + if saml_request_id is not None: + _path_params['samlRequestId'] = saml_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if saml_service_create_response_request is not None: + _body_params = saml_service_create_response_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/saml/saml_requests/{samlRequestId}', + 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 + ) @@ -352,145 +211,7 @@ def s_aml_service_get_saml_request( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SAMLServiceGetSAMLRequestResponse: - """Get SAML Request details - - Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. - - :param saml_request_id: ID of the SAML Request, as obtained from the redirect URL. (required) - :type saml_request_id: str - :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._s_aml_service_get_saml_request_serialize( - saml_request_id=saml_request_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SAMLServiceGetSAMLRequestResponse", - '403': "SAMLServiceRpcStatus", - '404': "SAMLServiceRpcStatus", - } - 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 s_aml_service_get_saml_request_with_http_info( - self, - saml_request_id: Annotated[StrictStr, Field(description="ID of the SAML Request, as obtained from the redirect URL.")], - _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[SAMLServiceGetSAMLRequestResponse]: - """Get SAML Request details - - Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. - - :param saml_request_id: ID of the SAML Request, as obtained from the redirect URL. (required) - :type saml_request_id: str - :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._s_aml_service_get_saml_request_serialize( - saml_request_id=saml_request_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SAMLServiceGetSAMLRequestResponse", - '403': "SAMLServiceRpcStatus", - '404': "SAMLServiceRpcStatus", - } - 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 s_aml_service_get_saml_request_without_preload_content( - self, - saml_request_id: Annotated[StrictStr, Field(description="ID of the SAML Request, as obtained from the redirect URL.")], - _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 SAML Request details + """Get SAML Request details Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. @@ -518,7 +239,7 @@ def s_aml_service_get_saml_request_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._s_aml_service_get_saml_request_serialize( + _param = self.__s_aml_service_get_saml_request_serialize( saml_request_id=saml_request_id, _request_auth=_request_auth, _content_type=_content_type, @@ -531,72 +252,77 @@ def s_aml_service_get_saml_request_without_preload_content( '403': "SAMLServiceRpcStatus", '404': "SAMLServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _s_aml_service_get_saml_request_serialize( - self, - saml_request_id, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __s_aml_service_get_saml_request_serialize( + self, + saml_request_id, + _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 - if saml_request_id is not None: - _path_params['samlRequestId'] = saml_request_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/saml/saml_requests/{samlRequestId}', - 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 - ) + _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 + if saml_request_id is not None: + _path_params['samlRequestId'] = saml_request_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/saml/saml_requests/{samlRequestId}', + 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 + ) diff --git a/zitadel_client/api/session_service_api.py b/zitadel_client/api/session_service_api.py index f7de7684..42d94a2c 100644 --- a/zitadel_client/api/session_service_api.py +++ b/zitadel_client/api/session_service_api.py @@ -16,35 +16,35 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import Optional -from typing_extensions import Annotated -from zitadel_client.models.session_service_create_session_request import SessionServiceCreateSessionRequest -from zitadel_client.models.session_service_create_session_response import SessionServiceCreateSessionResponse -from zitadel_client.models.session_service_delete_session_request import SessionServiceDeleteSessionRequest -from zitadel_client.models.session_service_delete_session_response import SessionServiceDeleteSessionResponse -from zitadel_client.models.session_service_get_session_response import SessionServiceGetSessionResponse -from zitadel_client.models.session_service_list_sessions_request import SessionServiceListSessionsRequest -from zitadel_client.models.session_service_list_sessions_response import SessionServiceListSessionsResponse -from zitadel_client.models.session_service_set_session_request import SessionServiceSetSessionRequest -from zitadel_client.models.session_service_set_session_response import SessionServiceSetSessionResponse + from pydantic import Field, StrictStr + from typing import Optional + from typing_extensions import Annotated + from zitadel_client.models.session_service_create_session_request import SessionServiceCreateSessionRequest + from zitadel_client.models.session_service_create_session_response import SessionServiceCreateSessionResponse + from zitadel_client.models.session_service_delete_session_request import SessionServiceDeleteSessionRequest + from zitadel_client.models.session_service_delete_session_response import SessionServiceDeleteSessionResponse + from zitadel_client.models.session_service_get_session_response import SessionServiceGetSessionResponse + from zitadel_client.models.session_service_list_sessions_request import SessionServiceListSessionsRequest + from zitadel_client.models.session_service_list_sessions_response import SessionServiceListSessionsResponse + from zitadel_client.models.session_service_set_session_request import SessionServiceSetSessionRequest + from zitadel_client.models.session_service_set_session_response import SessionServiceSetSessionResponse from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class SessionServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class SessionServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -64,145 +64,7 @@ def session_service_create_session( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SessionServiceCreateSessionResponse: - """Create a new session - - Create a new session. A token will be returned, which is required for further updates of the session. - - :param session_service_create_session_request: (required) - :type session_service_create_session_request: SessionServiceCreateSessionRequest - :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._session_service_create_session_serialize( - session_service_create_session_request=session_service_create_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "SessionServiceCreateSessionResponse", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - 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 session_service_create_session_with_http_info( - self, - session_service_create_session_request: SessionServiceCreateSessionRequest, - _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[SessionServiceCreateSessionResponse]: - """Create a new session - - Create a new session. A token will be returned, which is required for further updates of the session. - - :param session_service_create_session_request: (required) - :type session_service_create_session_request: SessionServiceCreateSessionRequest - :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._session_service_create_session_serialize( - session_service_create_session_request=session_service_create_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "SessionServiceCreateSessionResponse", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - 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 session_service_create_session_without_preload_content( - self, - session_service_create_session_request: SessionServiceCreateSessionRequest, - _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 a new session + """Create a new session Create a new session. A token will be returned, which is required for further updates of the session. @@ -230,7 +92,7 @@ def session_service_create_session_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._session_service_create_session_serialize( + _param = self.__session_service_create_session_serialize( session_service_create_session_request=session_service_create_session_request, _request_auth=_request_auth, _content_type=_content_type, @@ -243,86 +105,91 @@ def session_service_create_session_without_preload_content( '403': "SessionServiceRpcStatus", '404': "SessionServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _session_service_create_session_serialize( - self, - session_service_create_session_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __session_service_create_session_serialize( + self, + session_service_create_session_request, + _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 session_service_create_session_request is not None: - _body_params = session_service_create_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/sessions', - 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 - ) + _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 session_service_create_session_request is not None: + _body_params = session_service_create_session_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/sessions', + 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 + ) @@ -345,7 +212,7 @@ def session_service_delete_session( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SessionServiceDeleteSessionResponse: - """Terminate an existing session + """Terminate an existing session Terminate your own session or if granted any other session. @@ -375,7 +242,7 @@ def session_service_delete_session( :return: Returns the result object. """ # noqa: E501 - _param = self._session_service_delete_session_serialize( + _param = self.__session_service_delete_session_serialize( session_id=session_id, session_service_delete_session_request=session_service_delete_session_request, _request_auth=_request_auth, @@ -389,95 +256,103 @@ def session_service_delete_session( '403': "SessionServiceRpcStatus", '404': "SessionServiceRpcStatus", } - 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 session_service_delete_session_with_http_info( - self, - session_id: Annotated[StrictStr, Field(description="\"id of the session to terminate\"")], - session_service_delete_session_request: SessionServiceDeleteSessionRequest, - _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[SessionServiceDeleteSessionResponse]: - """Terminate an existing session - - Terminate your own session or if granted any other session. + 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 + + + + def __session_service_delete_session_serialize( + self, + session_id, + session_service_delete_session_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - :param session_id: \"id of the session to terminate\" (required) - :type session_id: str - :param session_service_delete_session_request: (required) - :type session_service_delete_session_request: SessionServiceDeleteSessionRequest - :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 + _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 + if session_id is not None: + _path_params['sessionId'] = session_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if session_service_delete_session_request is not None: + _body_params = session_service_delete_session_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/sessions/{sessionId}', + 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 + ) - _param = self._session_service_delete_session_serialize( - session_id=session_id, - session_service_delete_session_request=session_service_delete_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceDeleteSessionResponse", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - 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 session_service_delete_session_without_preload_content( + def session_service_get_session( self, - session_id: Annotated[StrictStr, Field(description="\"id of the session to terminate\"")], - session_service_delete_session_request: SessionServiceDeleteSessionRequest, + session_id: StrictStr, + session_token: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -490,15 +365,15 @@ def session_service_delete_session_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Terminate an existing session + ) -> SessionServiceGetSessionResponse: + """Get a session - Terminate your own session or if granted any other session. + Get a session and all its information like the time of the user or password verification - :param session_id: \"id of the session to terminate\" (required) + :param session_id: (required) :type session_id: str - :param session_service_delete_session_request: (required) - :type session_service_delete_session_request: SessionServiceDeleteSessionRequest + :param session_token: + :type session_token: str :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 @@ -521,9 +396,9 @@ def session_service_delete_session_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._session_service_delete_session_serialize( + _param = self.__session_service_get_session_serialize( session_id=session_id, - session_service_delete_session_request=session_service_delete_session_request, + session_token=session_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -531,102 +406,95 @@ def session_service_delete_session_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceDeleteSessionResponse", + '200': "SessionServiceGetSessionResponse", '403': "SessionServiceRpcStatus", '404': "SessionServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _session_service_delete_session_serialize( - self, - session_id, - session_service_delete_session_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __session_service_get_session_serialize( + self, + session_id, + session_token, + _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 - if session_id is not None: - _path_params['sessionId'] = session_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if session_service_delete_session_request is not None: - _body_params = session_service_delete_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/sessions/{sessionId}', - 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 - ) + _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 + if session_id is not None: + _path_params['sessionId'] = session_id + # process the query parameters + if session_token is not None: + + _query_params.append(('sessionToken', session_token)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/sessions/{sessionId}', + 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 session_service_get_session( + def session_service_list_sessions( self, - session_id: StrictStr, - session_token: Optional[StrictStr] = None, + session_service_list_sessions_request: SessionServiceListSessionsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -639,15 +507,13 @@ def session_service_get_session( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SessionServiceGetSessionResponse: - """Get a session + ) -> SessionServiceListSessionsResponse: + """Search sessions - Get a session and all its information like the time of the user or password verification + Search for sessions - :param session_id: (required) - :type session_id: str - :param session_token: - :type session_token: str + :param session_service_list_sessions_request: (required) + :type session_service_list_sessions_request: SessionServiceListSessionsRequest :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 @@ -670,9 +536,8 @@ def session_service_get_session( :return: Returns the result object. """ # noqa: E501 - _param = self._session_service_get_session_serialize( - session_id=session_id, - session_token=session_token, + _param = self.__session_service_list_sessions_serialize( + session_service_list_sessions_request=session_service_list_sessions_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -680,26 +545,105 @@ def session_service_get_session( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceGetSessionResponse", + '200': "SessionServiceListSessionsResponse", + '400': "SessionServiceRpcStatus", '403': "SessionServiceRpcStatus", '404': "SessionServiceRpcStatus", } - 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 + 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 + + + + def __session_service_list_sessions_serialize( + self, + session_service_list_sessions_request, + _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 session_service_list_sessions_request is not None: + _body_params = session_service_list_sessions_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/sessions/search', + 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 session_service_get_session_with_http_info( + def session_service_set_session( self, - session_id: StrictStr, - session_token: Optional[StrictStr] = None, + session_id: Annotated[StrictStr, Field(description="\"id of the session to update\"")], + session_service_set_session_request: SessionServiceSetSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -712,15 +656,15 @@ def session_service_get_session_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[SessionServiceGetSessionResponse]: - """Get a session + ) -> SessionServiceSetSessionResponse: + """Update an existing session - Get a session and all its information like the time of the user or password verification + Update an existing session with new information. - :param session_id: (required) + :param session_id: \"id of the session to update\" (required) :type session_id: str - :param session_token: - :type session_token: str + :param session_service_set_session_request: (required) + :type session_service_set_session_request: SessionServiceSetSessionRequest :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 @@ -743,9 +687,9 @@ def session_service_get_session_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._session_service_get_session_serialize( + _param = self.__session_service_set_session_serialize( session_id=session_id, - session_token=session_token, + session_service_set_session_request=session_service_set_session_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -753,732 +697,97 @@ def session_service_get_session_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceGetSessionResponse", + '200': "SessionServiceSetSessionResponse", '403': "SessionServiceRpcStatus", '404': "SessionServiceRpcStatus", } - 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 session_service_get_session_without_preload_content( - self, - session_id: StrictStr, - session_token: Optional[StrictStr] = None, - _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 a session - - Get a session and all its information like the time of the user or password verification - - :param session_id: (required) - :type session_id: str - :param session_token: - :type session_token: str - :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._session_service_get_session_serialize( - session_id=session_id, - session_token=session_token, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceGetSessionResponse", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _session_service_get_session_serialize( - self, - session_id, - session_token, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __session_service_set_session_serialize( + self, + session_id, + session_service_set_session_request, + _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 - if session_id is not None: - _path_params['sessionId'] = session_id - # process the query parameters - if session_token is not None: - - _query_params.append(('sessionToken', session_token)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/sessions/{sessionId}', - 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 session_service_list_sessions( - self, - session_service_list_sessions_request: SessionServiceListSessionsRequest, - _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, - ) -> SessionServiceListSessionsResponse: - """Search sessions - - Search for sessions - - :param session_service_list_sessions_request: (required) - :type session_service_list_sessions_request: SessionServiceListSessionsRequest - :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._session_service_list_sessions_serialize( - session_service_list_sessions_request=session_service_list_sessions_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceListSessionsResponse", - '400': "SessionServiceRpcStatus", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - 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 session_service_list_sessions_with_http_info( - self, - session_service_list_sessions_request: SessionServiceListSessionsRequest, - _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[SessionServiceListSessionsResponse]: - """Search sessions - - Search for sessions - - :param session_service_list_sessions_request: (required) - :type session_service_list_sessions_request: SessionServiceListSessionsRequest - :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._session_service_list_sessions_serialize( - session_service_list_sessions_request=session_service_list_sessions_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceListSessionsResponse", - '400': "SessionServiceRpcStatus", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - 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 session_service_list_sessions_without_preload_content( - self, - session_service_list_sessions_request: SessionServiceListSessionsRequest, - _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: - """Search sessions - - Search for sessions - - :param session_service_list_sessions_request: (required) - :type session_service_list_sessions_request: SessionServiceListSessionsRequest - :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._session_service_list_sessions_serialize( - session_service_list_sessions_request=session_service_list_sessions_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceListSessionsResponse", - '400': "SessionServiceRpcStatus", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _session_service_list_sessions_serialize( - self, - session_service_list_sessions_request, - _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 session_service_list_sessions_request is not None: - _body_params = session_service_list_sessions_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/sessions/search', - 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 session_service_set_session( - self, - session_id: Annotated[StrictStr, Field(description="\"id of the session to update\"")], - session_service_set_session_request: SessionServiceSetSessionRequest, - _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, - ) -> SessionServiceSetSessionResponse: - """Update an existing session - - Update an existing session with new information. - - :param session_id: \"id of the session to update\" (required) - :type session_id: str - :param session_service_set_session_request: (required) - :type session_service_set_session_request: SessionServiceSetSessionRequest - :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._session_service_set_session_serialize( - session_id=session_id, - session_service_set_session_request=session_service_set_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceSetSessionResponse", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - 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 session_service_set_session_with_http_info( - self, - session_id: Annotated[StrictStr, Field(description="\"id of the session to update\"")], - session_service_set_session_request: SessionServiceSetSessionRequest, - _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[SessionServiceSetSessionResponse]: - """Update an existing session - - Update an existing session with new information. - - :param session_id: \"id of the session to update\" (required) - :type session_id: str - :param session_service_set_session_request: (required) - :type session_service_set_session_request: SessionServiceSetSessionRequest - :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._session_service_set_session_serialize( - session_id=session_id, - session_service_set_session_request=session_service_set_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceSetSessionResponse", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - 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 session_service_set_session_without_preload_content( - self, - session_id: Annotated[StrictStr, Field(description="\"id of the session to update\"")], - session_service_set_session_request: SessionServiceSetSessionRequest, - _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: - """Update an existing session - - Update an existing session with new information. - - :param session_id: \"id of the session to update\" (required) - :type session_id: str - :param session_service_set_session_request: (required) - :type session_service_set_session_request: SessionServiceSetSessionRequest - :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._session_service_set_session_serialize( - session_id=session_id, - session_service_set_session_request=session_service_set_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceSetSessionResponse", - '403': "SessionServiceRpcStatus", - '404': "SessionServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _session_service_set_session_serialize( - self, - session_id, - session_service_set_session_request, - _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 - if session_id is not None: - _path_params['sessionId'] = session_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if session_service_set_session_request is not None: - _body_params = session_service_set_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='PATCH', - resource_path='/v2/sessions/{sessionId}', - 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 - ) + _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 + if session_id is not None: + _path_params['sessionId'] = session_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if session_service_set_session_request is not None: + _body_params = session_service_set_session_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v2/sessions/{sessionId}', + 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 + ) diff --git a/zitadel_client/api/settings_service_api.py b/zitadel_client/api/settings_service_api.py index 2a59f07a..6fe51d98 100644 --- a/zitadel_client/api/settings_service_api.py +++ b/zitadel_client/api/settings_service_api.py @@ -16,37 +16,37 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictBool, StrictStr -from typing import Optional -from zitadel_client.models.settings_service_get_active_identity_providers_response import SettingsServiceGetActiveIdentityProvidersResponse -from zitadel_client.models.settings_service_get_branding_settings_response import SettingsServiceGetBrandingSettingsResponse -from zitadel_client.models.settings_service_get_domain_settings_response import SettingsServiceGetDomainSettingsResponse -from zitadel_client.models.settings_service_get_general_settings_response import SettingsServiceGetGeneralSettingsResponse -from zitadel_client.models.settings_service_get_legal_and_support_settings_response import SettingsServiceGetLegalAndSupportSettingsResponse -from zitadel_client.models.settings_service_get_lockout_settings_response import SettingsServiceGetLockoutSettingsResponse -from zitadel_client.models.settings_service_get_login_settings_response import SettingsServiceGetLoginSettingsResponse -from zitadel_client.models.settings_service_get_password_complexity_settings_response import SettingsServiceGetPasswordComplexitySettingsResponse -from zitadel_client.models.settings_service_get_password_expiry_settings_response import SettingsServiceGetPasswordExpirySettingsResponse -from zitadel_client.models.settings_service_get_security_settings_response import SettingsServiceGetSecuritySettingsResponse -from zitadel_client.models.settings_service_set_security_settings_request import SettingsServiceSetSecuritySettingsRequest -from zitadel_client.models.settings_service_set_security_settings_response import SettingsServiceSetSecuritySettingsResponse + from pydantic import StrictBool, StrictStr + from typing import Optional + from zitadel_client.models.settings_service_get_active_identity_providers_response import SettingsServiceGetActiveIdentityProvidersResponse + from zitadel_client.models.settings_service_get_branding_settings_response import SettingsServiceGetBrandingSettingsResponse + from zitadel_client.models.settings_service_get_domain_settings_response import SettingsServiceGetDomainSettingsResponse + from zitadel_client.models.settings_service_get_general_settings_response import SettingsServiceGetGeneralSettingsResponse + from zitadel_client.models.settings_service_get_legal_and_support_settings_response import SettingsServiceGetLegalAndSupportSettingsResponse + from zitadel_client.models.settings_service_get_lockout_settings_response import SettingsServiceGetLockoutSettingsResponse + from zitadel_client.models.settings_service_get_login_settings_response import SettingsServiceGetLoginSettingsResponse + from zitadel_client.models.settings_service_get_password_complexity_settings_response import SettingsServiceGetPasswordComplexitySettingsResponse + from zitadel_client.models.settings_service_get_password_expiry_settings_response import SettingsServiceGetPasswordExpirySettingsResponse + from zitadel_client.models.settings_service_get_security_settings_response import SettingsServiceGetSecuritySettingsResponse + from zitadel_client.models.settings_service_set_security_settings_request import SettingsServiceSetSecuritySettingsRequest + from zitadel_client.models.settings_service_set_security_settings_response import SettingsServiceSetSecuritySettingsResponse from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class SettingsServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class SettingsServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -71,7 +71,7 @@ def settings_service_get_active_identity_providers( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetActiveIdentityProvidersResponse: - """Get the current active identity providers + """Get the current active identity providers Return the current active identity providers for the requested context @@ -109,7 +109,7 @@ def settings_service_get_active_identity_providers( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_active_identity_providers_serialize( + _param = self.__settings_service_get_active_identity_providers_serialize( ctx_org_id=ctx_org_id, ctx_instance=ctx_instance, creation_allowed=creation_allowed, @@ -127,26 +127,114 @@ def settings_service_get_active_identity_providers( '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - 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 + 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 + + + + def __settings_service_get_active_identity_providers_serialize( + self, + ctx_org_id, + ctx_instance, + creation_allowed, + linking_allowed, + auto_creation, + auto_linking, + _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 + if ctx_org_id is not None: + + _query_params.append(('ctx.orgId', ctx_org_id)) + + if ctx_instance is not None: + + _query_params.append(('ctx.instance', ctx_instance)) + + if creation_allowed is not None: + + _query_params.append(('creationAllowed', creation_allowed)) + + if linking_allowed is not None: + + _query_params.append(('linkingAllowed', linking_allowed)) + + if auto_creation is not None: + + _query_params.append(('autoCreation', auto_creation)) + + if auto_linking is not None: + + _query_params.append(('autoLinking', auto_linking)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/login/idps', + 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 settings_service_get_active_identity_providers_with_http_info( + def settings_service_get_branding_settings( self, ctx_org_id: Optional[StrictStr] = None, ctx_instance: Optional[StrictBool] = None, - creation_allowed: Optional[StrictBool] = None, - linking_allowed: Optional[StrictBool] = None, - auto_creation: Optional[StrictBool] = None, - auto_linking: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -159,23 +247,15 @@ def settings_service_get_active_identity_providers_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[SettingsServiceGetActiveIdentityProvidersResponse]: - """Get the current active identity providers + ) -> SettingsServiceGetBrandingSettingsResponse: + """Get the current active branding settings - Return the current active identity providers for the requested context + Return the current active branding settings for the requested context :param ctx_org_id: :type ctx_org_id: str :param ctx_instance: :type ctx_instance: bool - :param creation_allowed: - :type creation_allowed: bool - :param linking_allowed: - :type linking_allowed: bool - :param auto_creation: - :type auto_creation: bool - :param auto_linking: - :type auto_linking: bool :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 @@ -198,13 +278,9 @@ def settings_service_get_active_identity_providers_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_active_identity_providers_serialize( + _param = self.__settings_service_get_branding_settings_serialize( ctx_org_id=ctx_org_id, ctx_instance=ctx_instance, - creation_allowed=creation_allowed, - linking_allowed=linking_allowed, - auto_creation=auto_creation, - auto_linking=auto_linking, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -212,30 +288,98 @@ def settings_service_get_active_identity_providers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetActiveIdentityProvidersResponse", + '200': "SettingsServiceGetBrandingSettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - 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, - ) + 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 + + + + def __settings_service_get_branding_settings_serialize( + self, + ctx_org_id, + ctx_instance, + _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 + if ctx_org_id is not None: + + _query_params.append(('ctx.orgId', ctx_org_id)) + + if ctx_instance is not None: + + _query_params.append(('ctx.instance', ctx_instance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/branding', + 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 settings_service_get_active_identity_providers_without_preload_content( + def settings_service_get_domain_settings( self, ctx_org_id: Optional[StrictStr] = None, ctx_instance: Optional[StrictBool] = None, - creation_allowed: Optional[StrictBool] = None, - linking_allowed: Optional[StrictBool] = None, - auto_creation: Optional[StrictBool] = None, - auto_linking: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -248,23 +392,15 @@ def settings_service_get_active_identity_providers_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current active identity providers + ) -> SettingsServiceGetDomainSettingsResponse: + """Get the domain settings - Return the current active identity providers for the requested context + Return the domain settings for the requested context :param ctx_org_id: :type ctx_org_id: str :param ctx_instance: :type ctx_instance: bool - :param creation_allowed: - :type creation_allowed: bool - :param linking_allowed: - :type linking_allowed: bool - :param auto_creation: - :type auto_creation: bool - :param auto_linking: - :type auto_linking: bool :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 @@ -287,13 +423,9 @@ def settings_service_get_active_identity_providers_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_active_identity_providers_serialize( + _param = self.__settings_service_get_domain_settings_serialize( ctx_org_id=ctx_org_id, ctx_instance=ctx_instance, - creation_allowed=creation_allowed, - linking_allowed=linking_allowed, - auto_creation=auto_creation, - auto_linking=auto_linking, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -301,113 +433,96 @@ def settings_service_get_active_identity_providers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetActiveIdentityProvidersResponse", + '200': "SettingsServiceGetDomainSettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_active_identity_providers_serialize( - self, - ctx_org_id, - ctx_instance, - creation_allowed, - linking_allowed, - auto_creation, - auto_linking, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __settings_service_get_domain_settings_serialize( + self, + ctx_org_id, + ctx_instance, + _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 - if ctx_org_id is not None: - - _query_params.append(('ctx.orgId', ctx_org_id)) - - if ctx_instance is not None: - - _query_params.append(('ctx.instance', ctx_instance)) - - if creation_allowed is not None: - - _query_params.append(('creationAllowed', creation_allowed)) - - if linking_allowed is not None: - - _query_params.append(('linkingAllowed', linking_allowed)) - - if auto_creation is not None: - - _query_params.append(('autoCreation', auto_creation)) - - if auto_linking is not None: - - _query_params.append(('autoLinking', auto_linking)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/login/idps', - 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 - ) + _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 + if ctx_org_id is not None: + + _query_params.append(('ctx.orgId', ctx_org_id)) + + if ctx_instance is not None: + + _query_params.append(('ctx.instance', ctx_instance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/domain', + 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 settings_service_get_branding_settings( + def settings_service_get_general_settings( self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -420,15 +535,11 @@ def settings_service_get_branding_settings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SettingsServiceGetBrandingSettingsResponse: - """Get the current active branding settings + ) -> SettingsServiceGetGeneralSettingsResponse: + """Get basic information over the instance - Return the current active branding settings for the requested context + Return the basic information of the instance for the requested context - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool :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 @@ -451,9 +562,7 @@ def settings_service_get_branding_settings( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_branding_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, + _param = self.__settings_service_get_general_settings_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -461,23 +570,85 @@ def settings_service_get_branding_settings( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetBrandingSettingsResponse", + '200': "SettingsServiceGetGeneralSettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - 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 + 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 + + + + def __settings_service_get_general_settings_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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings', + 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 settings_service_get_branding_settings_with_http_info( + def settings_service_get_legal_and_support_settings( self, ctx_org_id: Optional[StrictStr] = None, ctx_instance: Optional[StrictBool] = None, @@ -493,10 +664,10 @@ def settings_service_get_branding_settings_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[SettingsServiceGetBrandingSettingsResponse]: - """Get the current active branding settings + ) -> SettingsServiceGetLegalAndSupportSettingsResponse: + """Get the legal and support settings - Return the current active branding settings for the requested context + Return the legal settings for the requested context :param ctx_org_id: :type ctx_org_id: str @@ -524,7 +695,7 @@ def settings_service_get_branding_settings_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_branding_settings_serialize( + _param = self.__settings_service_get_legal_and_support_settings_serialize( ctx_org_id=ctx_org_id, ctx_instance=ctx_instance, _request_auth=_request_auth, @@ -534,23 +705,95 @@ def settings_service_get_branding_settings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetBrandingSettingsResponse", + '200': "SettingsServiceGetLegalAndSupportSettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - 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, - ) + 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 + + + + def __settings_service_get_legal_and_support_settings_serialize( + self, + ctx_org_id, + ctx_instance, + _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 + if ctx_org_id is not None: + + _query_params.append(('ctx.orgId', ctx_org_id)) + + if ctx_instance is not None: + + _query_params.append(('ctx.instance', ctx_instance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/legal_support', + 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 settings_service_get_branding_settings_without_preload_content( + def settings_service_get_lockout_settings( self, ctx_org_id: Optional[StrictStr] = None, ctx_instance: Optional[StrictBool] = None, @@ -566,10 +809,10 @@ def settings_service_get_branding_settings_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current active branding settings + ) -> SettingsServiceGetLockoutSettingsResponse: + """Get the lockout settings - Return the current active branding settings for the requested context + Return the lockout settings for the requested context, which define when a user will be locked :param ctx_org_id: :type ctx_org_id: str @@ -597,7 +840,7 @@ def settings_service_get_branding_settings_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_branding_settings_serialize( + _param = self.__settings_service_get_lockout_settings_serialize( ctx_org_id=ctx_org_id, ctx_instance=ctx_instance, _request_auth=_request_auth, @@ -607,90 +850,95 @@ def settings_service_get_branding_settings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetBrandingSettingsResponse", + '200': "SettingsServiceGetLockoutSettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_branding_settings_serialize( - self, - ctx_org_id, - ctx_instance, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __settings_service_get_lockout_settings_serialize( + self, + ctx_org_id, + ctx_instance, + _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 - if ctx_org_id is not None: - - _query_params.append(('ctx.orgId', ctx_org_id)) - - if ctx_instance is not None: - - _query_params.append(('ctx.instance', ctx_instance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/branding', - 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 - ) + _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 + if ctx_org_id is not None: + + _query_params.append(('ctx.orgId', ctx_org_id)) + + if ctx_instance is not None: + + _query_params.append(('ctx.instance', ctx_instance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/lockout', + 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 settings_service_get_domain_settings( + def settings_service_get_login_settings( self, ctx_org_id: Optional[StrictStr] = None, ctx_instance: Optional[StrictBool] = None, @@ -706,10 +954,10 @@ def settings_service_get_domain_settings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SettingsServiceGetDomainSettingsResponse: - """Get the domain settings + ) -> SettingsServiceGetLoginSettingsResponse: + """Get the login settings - Return the domain settings for the requested context + Return the settings for the requested context :param ctx_org_id: :type ctx_org_id: str @@ -737,7 +985,7 @@ def settings_service_get_domain_settings( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_domain_settings_serialize( + _param = self.__settings_service_get_login_settings_serialize( ctx_org_id=ctx_org_id, ctx_instance=ctx_instance, _request_auth=_request_auth, @@ -747,23 +995,95 @@ def settings_service_get_domain_settings( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetDomainSettingsResponse", + '200': "SettingsServiceGetLoginSettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - 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 + 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 + + + + def __settings_service_get_login_settings_serialize( + self, + ctx_org_id, + ctx_instance, + _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 + if ctx_org_id is not None: + + _query_params.append(('ctx.orgId', ctx_org_id)) + + if ctx_instance is not None: + + _query_params.append(('ctx.instance', ctx_instance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/login', + 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 settings_service_get_domain_settings_with_http_info( + def settings_service_get_password_complexity_settings( self, ctx_org_id: Optional[StrictStr] = None, ctx_instance: Optional[StrictBool] = None, @@ -779,10 +1099,10 @@ def settings_service_get_domain_settings_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[SettingsServiceGetDomainSettingsResponse]: - """Get the domain settings + ) -> SettingsServiceGetPasswordComplexitySettingsResponse: + """Get the password complexity settings - Return the domain settings for the requested context + Return the password complexity settings for the requested context :param ctx_org_id: :type ctx_org_id: str @@ -810,7 +1130,7 @@ def settings_service_get_domain_settings_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_domain_settings_serialize( + _param = self.__settings_service_get_password_complexity_settings_serialize( ctx_org_id=ctx_org_id, ctx_instance=ctx_instance, _request_auth=_request_auth, @@ -820,23 +1140,95 @@ def settings_service_get_domain_settings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetDomainSettingsResponse", + '200': "SettingsServiceGetPasswordComplexitySettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - 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, - ) + 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 + + + + def __settings_service_get_password_complexity_settings_serialize( + self, + ctx_org_id, + ctx_instance, + _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 + if ctx_org_id is not None: + + _query_params.append(('ctx.orgId', ctx_org_id)) + + if ctx_instance is not None: + + _query_params.append(('ctx.instance', ctx_instance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/password/complexity', + 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 settings_service_get_domain_settings_without_preload_content( + def settings_service_get_password_expiry_settings( self, ctx_org_id: Optional[StrictStr] = None, ctx_instance: Optional[StrictBool] = None, @@ -852,10 +1244,10 @@ def settings_service_get_domain_settings_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the domain settings + ) -> SettingsServiceGetPasswordExpirySettingsResponse: + """Get the password expiry settings - Return the domain settings for the requested context + Return the password expiry settings for the requested context :param ctx_org_id: :type ctx_org_id: str @@ -883,7 +1275,7 @@ def settings_service_get_domain_settings_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_domain_settings_serialize( + _param = self.__settings_service_get_password_expiry_settings_serialize( ctx_org_id=ctx_org_id, ctx_instance=ctx_instance, _request_auth=_request_auth, @@ -893,90 +1285,95 @@ def settings_service_get_domain_settings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetDomainSettingsResponse", + '200': "SettingsServiceGetPasswordExpirySettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_domain_settings_serialize( - self, - ctx_org_id, - ctx_instance, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __settings_service_get_password_expiry_settings_serialize( + self, + ctx_org_id, + ctx_instance, + _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 - if ctx_org_id is not None: - - _query_params.append(('ctx.orgId', ctx_org_id)) - - if ctx_instance is not None: - - _query_params.append(('ctx.instance', ctx_instance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/domain', - 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 - ) + _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 + if ctx_org_id is not None: + + _query_params.append(('ctx.orgId', ctx_org_id)) + + if ctx_instance is not None: + + _query_params.append(('ctx.instance', ctx_instance)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/password/expiry', + 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 settings_service_get_general_settings( + def settings_service_get_security_settings( self, _request_timeout: Union[ None, @@ -990,10 +1387,10 @@ def settings_service_get_general_settings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SettingsServiceGetGeneralSettingsResponse: - """Get basic information over the instance + ) -> SettingsServiceGetSecuritySettingsResponse: + """Get Security Settings - Return the basic information of the instance for the requested context + Returns the security settings of the ZITADEL instance. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1017,7 +1414,7 @@ def settings_service_get_general_settings( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_general_settings_serialize( + _param = self.__settings_service_get_security_settings_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1025,89 +1422,87 @@ def settings_service_get_general_settings( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetGeneralSettingsResponse", + '200': "SettingsServiceGetSecuritySettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - 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 + 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 + + + + def __settings_service_get_security_settings_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - @validate_call - def settings_service_get_general_settings_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[SettingsServiceGetGeneralSettingsResponse]: - """Get basic information over the instance + _collection_formats: Dict[str, str] = { + } - Return the basic information of the instance for the requested context + _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 - :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 + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/settings/security', + 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 + ) - _param = self._settings_service_get_general_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetGeneralSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_general_settings_without_preload_content( + def settings_service_set_security_settings( self, + settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1120,11 +1515,13 @@ def settings_service_get_general_settings_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get basic information over the instance + ) -> SettingsServiceSetSecuritySettingsResponse: + """Set Security Settings - Return the basic information of the instance for the requested context + Set the security settings of the ZITADEL instance. + :param settings_service_set_security_settings_request: (required) + :type settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest :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 @@ -1147,7 +1544,8 @@ def settings_service_get_general_settings_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._settings_service_get_general_settings_serialize( + _param = self.__settings_service_set_security_settings_serialize( + settings_service_set_security_settings_request=settings_service_set_security_settings_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1155,2035 +1553,94 @@ def settings_service_get_general_settings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetGeneralSettingsResponse", + '200': "SettingsServiceSetSecuritySettingsResponse", '403': "SettingsServiceRpcStatus", '404': "SettingsServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_general_settings_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __settings_service_set_security_settings_serialize( + self, + settings_service_set_security_settings_request, + _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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings', - 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 settings_service_get_legal_and_support_settings( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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, - ) -> SettingsServiceGetLegalAndSupportSettingsResponse: - """Get the legal and support settings - - Return the legal settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_legal_and_support_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLegalAndSupportSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_legal_and_support_settings_with_http_info( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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[SettingsServiceGetLegalAndSupportSettingsResponse]: - """Get the legal and support settings - - Return the legal settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_legal_and_support_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLegalAndSupportSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_legal_and_support_settings_without_preload_content( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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 the legal and support settings - - Return the legal settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_legal_and_support_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLegalAndSupportSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_legal_and_support_settings_serialize( - self, - ctx_org_id, - ctx_instance, - _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 - if ctx_org_id is not None: - - _query_params.append(('ctx.orgId', ctx_org_id)) - - if ctx_instance is not None: - - _query_params.append(('ctx.instance', ctx_instance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/legal_support', - 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 settings_service_get_lockout_settings( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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, - ) -> SettingsServiceGetLockoutSettingsResponse: - """Get the lockout settings - - Return the lockout settings for the requested context, which define when a user will be locked - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_lockout_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLockoutSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_lockout_settings_with_http_info( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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[SettingsServiceGetLockoutSettingsResponse]: - """Get the lockout settings - - Return the lockout settings for the requested context, which define when a user will be locked - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_lockout_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLockoutSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_lockout_settings_without_preload_content( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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 the lockout settings - - Return the lockout settings for the requested context, which define when a user will be locked - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_lockout_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLockoutSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_lockout_settings_serialize( - self, - ctx_org_id, - ctx_instance, - _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 - if ctx_org_id is not None: - - _query_params.append(('ctx.orgId', ctx_org_id)) - - if ctx_instance is not None: - - _query_params.append(('ctx.instance', ctx_instance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/lockout', - 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 settings_service_get_login_settings( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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, - ) -> SettingsServiceGetLoginSettingsResponse: - """Get the login settings - - Return the settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_login_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLoginSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_login_settings_with_http_info( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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[SettingsServiceGetLoginSettingsResponse]: - """Get the login settings - - Return the settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_login_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLoginSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_login_settings_without_preload_content( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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 the login settings - - Return the settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_login_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLoginSettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_login_settings_serialize( - self, - ctx_org_id, - ctx_instance, - _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 - if ctx_org_id is not None: - - _query_params.append(('ctx.orgId', ctx_org_id)) - - if ctx_instance is not None: - - _query_params.append(('ctx.instance', ctx_instance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/login', - 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 settings_service_get_password_complexity_settings( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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, - ) -> SettingsServiceGetPasswordComplexitySettingsResponse: - """Get the password complexity settings - - Return the password complexity settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_password_complexity_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetPasswordComplexitySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_password_complexity_settings_with_http_info( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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[SettingsServiceGetPasswordComplexitySettingsResponse]: - """Get the password complexity settings - - Return the password complexity settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_password_complexity_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetPasswordComplexitySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_password_complexity_settings_without_preload_content( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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 the password complexity settings - - Return the password complexity settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_password_complexity_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetPasswordComplexitySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_password_complexity_settings_serialize( - self, - ctx_org_id, - ctx_instance, - _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 - if ctx_org_id is not None: - - _query_params.append(('ctx.orgId', ctx_org_id)) - - if ctx_instance is not None: - - _query_params.append(('ctx.instance', ctx_instance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/password/complexity', - 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 settings_service_get_password_expiry_settings( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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, - ) -> SettingsServiceGetPasswordExpirySettingsResponse: - """Get the password expiry settings - - Return the password expiry settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_password_expiry_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetPasswordExpirySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_password_expiry_settings_with_http_info( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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[SettingsServiceGetPasswordExpirySettingsResponse]: - """Get the password expiry settings - - Return the password expiry settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_password_expiry_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetPasswordExpirySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_password_expiry_settings_without_preload_content( - self, - ctx_org_id: Optional[StrictStr] = None, - ctx_instance: Optional[StrictBool] = None, - _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 the password expiry settings - - Return the password expiry settings for the requested context - - :param ctx_org_id: - :type ctx_org_id: str - :param ctx_instance: - :type ctx_instance: bool - :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._settings_service_get_password_expiry_settings_serialize( - ctx_org_id=ctx_org_id, - ctx_instance=ctx_instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetPasswordExpirySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_password_expiry_settings_serialize( - self, - ctx_org_id, - ctx_instance, - _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 - if ctx_org_id is not None: - - _query_params.append(('ctx.orgId', ctx_org_id)) - - if ctx_instance is not None: - - _query_params.append(('ctx.instance', ctx_instance)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/password/expiry', - 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 settings_service_get_security_settings( - 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, - ) -> SettingsServiceGetSecuritySettingsResponse: - """Get Security Settings - - Returns the security settings of the ZITADEL instance. - - :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._settings_service_get_security_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetSecuritySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_security_settings_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[SettingsServiceGetSecuritySettingsResponse]: - """Get Security Settings - - Returns the security settings of the ZITADEL instance. - - :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._settings_service_get_security_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetSecuritySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_get_security_settings_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 Security Settings - - Returns the security settings of the ZITADEL instance. - - :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._settings_service_get_security_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetSecuritySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_get_security_settings_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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/settings/security', - 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 settings_service_set_security_settings( - self, - settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest, - _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, - ) -> SettingsServiceSetSecuritySettingsResponse: - """Set Security Settings - - Set the security settings of the ZITADEL instance. - - :param settings_service_set_security_settings_request: (required) - :type settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest - :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._settings_service_set_security_settings_serialize( - settings_service_set_security_settings_request=settings_service_set_security_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceSetSecuritySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_set_security_settings_with_http_info( - self, - settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest, - _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[SettingsServiceSetSecuritySettingsResponse]: - """Set Security Settings - - Set the security settings of the ZITADEL instance. - - :param settings_service_set_security_settings_request: (required) - :type settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest - :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._settings_service_set_security_settings_serialize( - settings_service_set_security_settings_request=settings_service_set_security_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceSetSecuritySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - 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 settings_service_set_security_settings_without_preload_content( - self, - settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest, - _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: - """Set Security Settings - - Set the security settings of the ZITADEL instance. - - :param settings_service_set_security_settings_request: (required) - :type settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest - :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._settings_service_set_security_settings_serialize( - settings_service_set_security_settings_request=settings_service_set_security_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceSetSecuritySettingsResponse", - '403': "SettingsServiceRpcStatus", - '404': "SettingsServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _settings_service_set_security_settings_serialize( - self, - settings_service_set_security_settings_request, - _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 settings_service_set_security_settings_request is not None: - _body_params = settings_service_set_security_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/policies/security', - 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 - ) + _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 settings_service_set_security_settings_request is not None: + _body_params = settings_service_set_security_settings_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v2/policies/security', + 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 + ) diff --git a/zitadel_client/api/user_service_api.py b/zitadel_client/api/user_service_api.py index 2c7f5c25..18671b37 100644 --- a/zitadel_client/api/user_service_api.py +++ b/zitadel_client/api/user_service_api.py @@ -16,95 +16,95 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, field_validator -from typing import List, Optional -from typing_extensions import Annotated -from zitadel_client.models.user_service_add_human_user_request import UserServiceAddHumanUserRequest -from zitadel_client.models.user_service_add_human_user_response import UserServiceAddHumanUserResponse -from zitadel_client.models.user_service_add_idp_link_request import UserServiceAddIDPLinkRequest -from zitadel_client.models.user_service_add_idp_link_response import UserServiceAddIDPLinkResponse -from zitadel_client.models.user_service_add_otp_email_response import UserServiceAddOTPEmailResponse -from zitadel_client.models.user_service_add_otpsms_response import UserServiceAddOTPSMSResponse -from zitadel_client.models.user_service_create_invite_code_request import UserServiceCreateInviteCodeRequest -from zitadel_client.models.user_service_create_invite_code_response import UserServiceCreateInviteCodeResponse -from zitadel_client.models.user_service_create_passkey_registration_link_request import UserServiceCreatePasskeyRegistrationLinkRequest -from zitadel_client.models.user_service_create_passkey_registration_link_response import UserServiceCreatePasskeyRegistrationLinkResponse -from zitadel_client.models.user_service_deactivate_user_response import UserServiceDeactivateUserResponse -from zitadel_client.models.user_service_delete_user_response import UserServiceDeleteUserResponse -from zitadel_client.models.user_service_get_user_by_id_response import UserServiceGetUserByIDResponse -from zitadel_client.models.user_service_human_mfa_init_skipped_response import UserServiceHumanMFAInitSkippedResponse -from zitadel_client.models.user_service_list_authentication_factors_response import UserServiceListAuthenticationFactorsResponse -from zitadel_client.models.user_service_list_authentication_method_types_response import UserServiceListAuthenticationMethodTypesResponse -from zitadel_client.models.user_service_list_idp_links_request import UserServiceListIDPLinksRequest -from zitadel_client.models.user_service_list_idp_links_response import UserServiceListIDPLinksResponse -from zitadel_client.models.user_service_list_passkeys_response import UserServiceListPasskeysResponse -from zitadel_client.models.user_service_list_users_request import UserServiceListUsersRequest -from zitadel_client.models.user_service_list_users_response import UserServiceListUsersResponse -from zitadel_client.models.user_service_lock_user_response import UserServiceLockUserResponse -from zitadel_client.models.user_service_password_reset_request import UserServicePasswordResetRequest -from zitadel_client.models.user_service_password_reset_response import UserServicePasswordResetResponse -from zitadel_client.models.user_service_reactivate_user_response import UserServiceReactivateUserResponse -from zitadel_client.models.user_service_register_passkey_request import UserServiceRegisterPasskeyRequest -from zitadel_client.models.user_service_register_passkey_response import UserServiceRegisterPasskeyResponse -from zitadel_client.models.user_service_register_totp_response import UserServiceRegisterTOTPResponse -from zitadel_client.models.user_service_register_u2_f_request import UserServiceRegisterU2FRequest -from zitadel_client.models.user_service_register_u2_f_response import UserServiceRegisterU2FResponse -from zitadel_client.models.user_service_remove_idp_link_response import UserServiceRemoveIDPLinkResponse -from zitadel_client.models.user_service_remove_otp_email_response import UserServiceRemoveOTPEmailResponse -from zitadel_client.models.user_service_remove_otpsms_response import UserServiceRemoveOTPSMSResponse -from zitadel_client.models.user_service_remove_passkey_response import UserServiceRemovePasskeyResponse -from zitadel_client.models.user_service_remove_phone_response import UserServiceRemovePhoneResponse -from zitadel_client.models.user_service_remove_totp_response import UserServiceRemoveTOTPResponse -from zitadel_client.models.user_service_remove_u2_f_response import UserServiceRemoveU2FResponse -from zitadel_client.models.user_service_resend_email_code_request import UserServiceResendEmailCodeRequest -from zitadel_client.models.user_service_resend_email_code_response import UserServiceResendEmailCodeResponse -from zitadel_client.models.user_service_resend_invite_code_response import UserServiceResendInviteCodeResponse -from zitadel_client.models.user_service_resend_phone_code_request import UserServiceResendPhoneCodeRequest -from zitadel_client.models.user_service_resend_phone_code_response import UserServiceResendPhoneCodeResponse -from zitadel_client.models.user_service_retrieve_identity_provider_intent_request import UserServiceRetrieveIdentityProviderIntentRequest -from zitadel_client.models.user_service_retrieve_identity_provider_intent_response import UserServiceRetrieveIdentityProviderIntentResponse -from zitadel_client.models.user_service_send_email_code_request import UserServiceSendEmailCodeRequest -from zitadel_client.models.user_service_send_email_code_response import UserServiceSendEmailCodeResponse -from zitadel_client.models.user_service_set_email_request import UserServiceSetEmailRequest -from zitadel_client.models.user_service_set_email_response import UserServiceSetEmailResponse -from zitadel_client.models.user_service_set_password_request import UserServiceSetPasswordRequest -from zitadel_client.models.user_service_set_password_response import UserServiceSetPasswordResponse -from zitadel_client.models.user_service_set_phone_request import UserServiceSetPhoneRequest -from zitadel_client.models.user_service_set_phone_response import UserServiceSetPhoneResponse -from zitadel_client.models.user_service_start_identity_provider_intent_request import UserServiceStartIdentityProviderIntentRequest -from zitadel_client.models.user_service_start_identity_provider_intent_response import UserServiceStartIdentityProviderIntentResponse -from zitadel_client.models.user_service_unlock_user_response import UserServiceUnlockUserResponse -from zitadel_client.models.user_service_update_human_user_request import UserServiceUpdateHumanUserRequest -from zitadel_client.models.user_service_update_human_user_response import UserServiceUpdateHumanUserResponse -from zitadel_client.models.user_service_verify_email_request import UserServiceVerifyEmailRequest -from zitadel_client.models.user_service_verify_email_response import UserServiceVerifyEmailResponse -from zitadel_client.models.user_service_verify_invite_code_request import UserServiceVerifyInviteCodeRequest -from zitadel_client.models.user_service_verify_invite_code_response import UserServiceVerifyInviteCodeResponse -from zitadel_client.models.user_service_verify_passkey_registration_request import UserServiceVerifyPasskeyRegistrationRequest -from zitadel_client.models.user_service_verify_passkey_registration_response import UserServiceVerifyPasskeyRegistrationResponse -from zitadel_client.models.user_service_verify_phone_request import UserServiceVerifyPhoneRequest -from zitadel_client.models.user_service_verify_phone_response import UserServiceVerifyPhoneResponse -from zitadel_client.models.user_service_verify_totp_registration_request import UserServiceVerifyTOTPRegistrationRequest -from zitadel_client.models.user_service_verify_totp_registration_response import UserServiceVerifyTOTPRegistrationResponse -from zitadel_client.models.user_service_verify_u2_f_registration_request import UserServiceVerifyU2FRegistrationRequest -from zitadel_client.models.user_service_verify_u2_f_registration_response import UserServiceVerifyU2FRegistrationResponse + from pydantic import Field, StrictBool, StrictStr, field_validator + from typing import List, Optional + from typing_extensions import Annotated + from zitadel_client.models.user_service_add_human_user_request import UserServiceAddHumanUserRequest + from zitadel_client.models.user_service_add_human_user_response import UserServiceAddHumanUserResponse + from zitadel_client.models.user_service_add_idp_link_request import UserServiceAddIDPLinkRequest + from zitadel_client.models.user_service_add_idp_link_response import UserServiceAddIDPLinkResponse + from zitadel_client.models.user_service_add_otp_email_response import UserServiceAddOTPEmailResponse + from zitadel_client.models.user_service_add_otpsms_response import UserServiceAddOTPSMSResponse + from zitadel_client.models.user_service_create_invite_code_request import UserServiceCreateInviteCodeRequest + from zitadel_client.models.user_service_create_invite_code_response import UserServiceCreateInviteCodeResponse + from zitadel_client.models.user_service_create_passkey_registration_link_request import UserServiceCreatePasskeyRegistrationLinkRequest + from zitadel_client.models.user_service_create_passkey_registration_link_response import UserServiceCreatePasskeyRegistrationLinkResponse + from zitadel_client.models.user_service_deactivate_user_response import UserServiceDeactivateUserResponse + from zitadel_client.models.user_service_delete_user_response import UserServiceDeleteUserResponse + from zitadel_client.models.user_service_get_user_by_id_response import UserServiceGetUserByIDResponse + from zitadel_client.models.user_service_human_mfa_init_skipped_response import UserServiceHumanMFAInitSkippedResponse + from zitadel_client.models.user_service_list_authentication_factors_response import UserServiceListAuthenticationFactorsResponse + from zitadel_client.models.user_service_list_authentication_method_types_response import UserServiceListAuthenticationMethodTypesResponse + from zitadel_client.models.user_service_list_idp_links_request import UserServiceListIDPLinksRequest + from zitadel_client.models.user_service_list_idp_links_response import UserServiceListIDPLinksResponse + from zitadel_client.models.user_service_list_passkeys_response import UserServiceListPasskeysResponse + from zitadel_client.models.user_service_list_users_request import UserServiceListUsersRequest + from zitadel_client.models.user_service_list_users_response import UserServiceListUsersResponse + from zitadel_client.models.user_service_lock_user_response import UserServiceLockUserResponse + from zitadel_client.models.user_service_password_reset_request import UserServicePasswordResetRequest + from zitadel_client.models.user_service_password_reset_response import UserServicePasswordResetResponse + from zitadel_client.models.user_service_reactivate_user_response import UserServiceReactivateUserResponse + from zitadel_client.models.user_service_register_passkey_request import UserServiceRegisterPasskeyRequest + from zitadel_client.models.user_service_register_passkey_response import UserServiceRegisterPasskeyResponse + from zitadel_client.models.user_service_register_totp_response import UserServiceRegisterTOTPResponse + from zitadel_client.models.user_service_register_u2_f_request import UserServiceRegisterU2FRequest + from zitadel_client.models.user_service_register_u2_f_response import UserServiceRegisterU2FResponse + from zitadel_client.models.user_service_remove_idp_link_response import UserServiceRemoveIDPLinkResponse + from zitadel_client.models.user_service_remove_otp_email_response import UserServiceRemoveOTPEmailResponse + from zitadel_client.models.user_service_remove_otpsms_response import UserServiceRemoveOTPSMSResponse + from zitadel_client.models.user_service_remove_passkey_response import UserServiceRemovePasskeyResponse + from zitadel_client.models.user_service_remove_phone_response import UserServiceRemovePhoneResponse + from zitadel_client.models.user_service_remove_totp_response import UserServiceRemoveTOTPResponse + from zitadel_client.models.user_service_remove_u2_f_response import UserServiceRemoveU2FResponse + from zitadel_client.models.user_service_resend_email_code_request import UserServiceResendEmailCodeRequest + from zitadel_client.models.user_service_resend_email_code_response import UserServiceResendEmailCodeResponse + from zitadel_client.models.user_service_resend_invite_code_response import UserServiceResendInviteCodeResponse + from zitadel_client.models.user_service_resend_phone_code_request import UserServiceResendPhoneCodeRequest + from zitadel_client.models.user_service_resend_phone_code_response import UserServiceResendPhoneCodeResponse + from zitadel_client.models.user_service_retrieve_identity_provider_intent_request import UserServiceRetrieveIdentityProviderIntentRequest + from zitadel_client.models.user_service_retrieve_identity_provider_intent_response import UserServiceRetrieveIdentityProviderIntentResponse + from zitadel_client.models.user_service_send_email_code_request import UserServiceSendEmailCodeRequest + from zitadel_client.models.user_service_send_email_code_response import UserServiceSendEmailCodeResponse + from zitadel_client.models.user_service_set_email_request import UserServiceSetEmailRequest + from zitadel_client.models.user_service_set_email_response import UserServiceSetEmailResponse + from zitadel_client.models.user_service_set_password_request import UserServiceSetPasswordRequest + from zitadel_client.models.user_service_set_password_response import UserServiceSetPasswordResponse + from zitadel_client.models.user_service_set_phone_request import UserServiceSetPhoneRequest + from zitadel_client.models.user_service_set_phone_response import UserServiceSetPhoneResponse + from zitadel_client.models.user_service_start_identity_provider_intent_request import UserServiceStartIdentityProviderIntentRequest + from zitadel_client.models.user_service_start_identity_provider_intent_response import UserServiceStartIdentityProviderIntentResponse + from zitadel_client.models.user_service_unlock_user_response import UserServiceUnlockUserResponse + from zitadel_client.models.user_service_update_human_user_request import UserServiceUpdateHumanUserRequest + from zitadel_client.models.user_service_update_human_user_response import UserServiceUpdateHumanUserResponse + from zitadel_client.models.user_service_verify_email_request import UserServiceVerifyEmailRequest + from zitadel_client.models.user_service_verify_email_response import UserServiceVerifyEmailResponse + from zitadel_client.models.user_service_verify_invite_code_request import UserServiceVerifyInviteCodeRequest + from zitadel_client.models.user_service_verify_invite_code_response import UserServiceVerifyInviteCodeResponse + from zitadel_client.models.user_service_verify_passkey_registration_request import UserServiceVerifyPasskeyRegistrationRequest + from zitadel_client.models.user_service_verify_passkey_registration_response import UserServiceVerifyPasskeyRegistrationResponse + from zitadel_client.models.user_service_verify_phone_request import UserServiceVerifyPhoneRequest + from zitadel_client.models.user_service_verify_phone_response import UserServiceVerifyPhoneResponse + from zitadel_client.models.user_service_verify_totp_registration_request import UserServiceVerifyTOTPRegistrationRequest + from zitadel_client.models.user_service_verify_totp_registration_response import UserServiceVerifyTOTPRegistrationResponse + from zitadel_client.models.user_service_verify_u2_f_registration_request import UserServiceVerifyU2FRegistrationRequest + from zitadel_client.models.user_service_verify_u2_f_registration_response import UserServiceVerifyU2FRegistrationResponse from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class UserServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class UserServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -124,7 +124,7 @@ def user_service_add_human_user( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceAddHumanUserResponse: - """Create a new human user + """Create a new human user Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. @@ -152,7 +152,7 @@ def user_service_add_human_user( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_human_user_serialize( + _param = self.__user_service_add_human_user_serialize( user_service_add_human_user_request=user_service_add_human_user_request, _request_auth=_request_auth, _content_type=_content_type, @@ -165,21 +165,100 @@ def user_service_add_human_user( '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_add_human_user_serialize( + self, + user_service_add_human_user_request, + _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 user_service_add_human_user_request is not None: + _body_params = user_service_add_human_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/human', + 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 user_service_add_human_user_with_http_info( + def user_service_add_idp_link( self, - user_service_add_human_user_request: UserServiceAddHumanUserRequest, + user_id: StrictStr, + user_service_add_idp_link_request: UserServiceAddIDPLinkRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -192,13 +271,15 @@ def user_service_add_human_user_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[UserServiceAddHumanUserResponse]: - """Create a new human user + ) -> UserServiceAddIDPLinkResponse: + """Add link to an identity provider to an user - Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. + Add link to an identity provider to an user.. - :param user_service_add_human_user_request: (required) - :type user_service_add_human_user_request: UserServiceAddHumanUserRequest + :param user_id: (required) + :type user_id: str + :param user_service_add_idp_link_request: (required) + :type user_service_add_idp_link_request: UserServiceAddIDPLinkRequest :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 @@ -221,8 +302,9 @@ def user_service_add_human_user_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_human_user_serialize( - user_service_add_human_user_request=user_service_add_human_user_request, + _param = self.__user_service_add_idp_link_serialize( + user_id=user_id, + user_service_add_idp_link_request=user_service_add_idp_link_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -230,25 +312,106 @@ def user_service_add_human_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "UserServiceAddHumanUserResponse", + '200': "UserServiceAddIDPLinkResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_add_idp_link_serialize( + self, + user_id, + user_service_add_idp_link_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_add_idp_link_request is not None: + _body_params = user_service_add_idp_link_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/links', + 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 user_service_add_human_user_without_preload_content( + def user_service_add_otp_email( self, - user_service_add_human_user_request: UserServiceAddHumanUserRequest, + user_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -261,13 +424,13 @@ def user_service_add_human_user_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create a new human user + ) -> UserServiceAddOTPEmailResponse: + """Add OTP Email for a user - Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. + Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. - :param user_service_add_human_user_request: (required) - :type user_service_add_human_user_request: UserServiceAddHumanUserRequest + :param user_id: (required) + :type user_id: str :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 @@ -290,8 +453,8 @@ def user_service_add_human_user_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_human_user_serialize( - user_service_add_human_user_request=user_service_add_human_user_request, + _param = self.__user_service_add_otp_email_serialize( + user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -299,99 +462,90 @@ def user_service_add_human_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "UserServiceAddHumanUserResponse", + '200': "UserServiceAddOTPEmailResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_add_human_user_serialize( - self, - user_service_add_human_user_request, - _request_auth, - _content_type, - _headers, - _host_index, + + def __user_service_add_otp_email_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, ) -> RequestSerialized: - _host = None + _host = None - _collection_formats: Dict[str, str] = { - } + _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 user_service_add_human_user_request is not None: - _body_params = user_service_add_human_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/human', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/otp_email', + 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 user_service_add_idp_link( + def user_service_add_otpsms( self, user_id: StrictStr, - user_service_add_idp_link_request: UserServiceAddIDPLinkRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -404,15 +558,13 @@ def user_service_add_idp_link( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceAddIDPLinkResponse: - """Add link to an identity provider to an user + ) -> UserServiceAddOTPSMSResponse: + """Add OTP SMS for a user - Add link to an identity provider to an user.. + Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. :param user_id: (required) :type user_id: str - :param user_service_add_idp_link_request: (required) - :type user_service_add_idp_link_request: UserServiceAddIDPLinkRequest :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 @@ -435,9 +587,8 @@ def user_service_add_idp_link( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_idp_link_serialize( + _param = self.__user_service_add_otpsms_serialize( user_id=user_id, - user_service_add_idp_link_request=user_service_add_idp_link_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -445,26 +596,91 @@ def user_service_add_idp_link( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddIDPLinkResponse", + '200': "UserServiceAddOTPSMSResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_add_otpsms_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/otp_sms', + 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 user_service_add_idp_link_with_http_info( + def user_service_create_invite_code( self, user_id: StrictStr, - user_service_add_idp_link_request: UserServiceAddIDPLinkRequest, + user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -477,15 +693,15 @@ def user_service_add_idp_link_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[UserServiceAddIDPLinkResponse]: - """Add link to an identity provider to an user + ) -> UserServiceCreateInviteCodeResponse: + """Create an invite code for a user - Add link to an identity provider to an user.. + Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. :param user_id: (required) :type user_id: str - :param user_service_add_idp_link_request: (required) - :type user_service_add_idp_link_request: UserServiceAddIDPLinkRequest + :param user_service_create_invite_code_request: (required) + :type user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest :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 @@ -508,9 +724,9 @@ def user_service_add_idp_link_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_idp_link_serialize( + _param = self.__user_service_create_invite_code_serialize( user_id=user_id, - user_service_add_idp_link_request=user_service_add_idp_link_request, + user_service_create_invite_code_request=user_service_create_invite_code_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -518,26 +734,107 @@ def user_service_add_idp_link_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddIDPLinkResponse", + '200': "UserServiceCreateInviteCodeResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_create_invite_code_serialize( + self, + user_id, + user_service_create_invite_code_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_create_invite_code_request is not None: + _body_params = user_service_create_invite_code_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/invite_code', + 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 user_service_add_idp_link_without_preload_content( + def user_service_create_passkey_registration_link( self, user_id: StrictStr, - user_service_add_idp_link_request: UserServiceAddIDPLinkRequest, + user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -550,15 +847,15 @@ def user_service_add_idp_link_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Add link to an identity provider to an user + ) -> UserServiceCreatePasskeyRegistrationLinkResponse: + """Create a passkey registration link for a user - Add link to an identity provider to an user.. + Create a passkey registration link which includes a code and either return it or send it to the user.. :param user_id: (required) :type user_id: str - :param user_service_add_idp_link_request: (required) - :type user_service_add_idp_link_request: UserServiceAddIDPLinkRequest + :param user_service_create_passkey_registration_link_request: (required) + :type user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest :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 @@ -581,9 +878,9 @@ def user_service_add_idp_link_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_idp_link_serialize( + _param = self.__user_service_create_passkey_registration_link_serialize( user_id=user_id, - user_service_add_idp_link_request=user_service_add_idp_link_request, + user_service_create_passkey_registration_link_request=user_service_create_passkey_registration_link_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -591,99 +888,104 @@ def user_service_add_idp_link_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddIDPLinkResponse", + '200': "UserServiceCreatePasskeyRegistrationLinkResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_add_idp_link_serialize( - self, - user_id, - user_service_add_idp_link_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - } + def __user_service_create_passkey_registration_link_serialize( + self, + user_id, + user_service_create_passkey_registration_link_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_add_idp_link_request is not None: - _body_params = user_service_add_idp_link_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/links', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_create_passkey_registration_link_request is not None: + _body_params = user_service_create_passkey_registration_link_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/passkeys/registration_link', + 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 user_service_add_otp_email( + def user_service_deactivate_user( self, user_id: StrictStr, _request_timeout: Union[ @@ -698,10 +1000,10 @@ def user_service_add_otp_email( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceAddOTPEmailResponse: - """Add OTP Email for a user + ) -> UserServiceDeactivateUserResponse: + """Deactivate user - Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. + The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. :param user_id: (required) :type user_id: str @@ -727,7 +1029,7 @@ def user_service_add_otp_email( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_otp_email_serialize( + _param = self.__user_service_deactivate_user_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -736,23 +1038,88 @@ def user_service_add_otp_email( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddOTPEmailResponse", + '200': "UserServiceDeactivateUserResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_deactivate_user_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/deactivate', + 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 user_service_add_otp_email_with_http_info( + def user_service_delete_user( self, user_id: StrictStr, _request_timeout: Union[ @@ -767,10 +1134,10 @@ def user_service_add_otp_email_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[UserServiceAddOTPEmailResponse]: - """Add OTP Email for a user + ) -> UserServiceDeleteUserResponse: + """Delete user - Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. + The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. :param user_id: (required) :type user_id: str @@ -796,7 +1163,7 @@ def user_service_add_otp_email_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_otp_email_serialize( + _param = self.__user_service_delete_user_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -805,25 +1172,90 @@ def user_service_add_otp_email_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddOTPEmailResponse", + '200': "UserServiceDeleteUserResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_delete_user_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/users/{userId}', + 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 user_service_add_otp_email_without_preload_content( + def user_service_get_user_by_id( self, - user_id: StrictStr, + user_id: Annotated[StrictStr, Field(description="User ID of the user you like to get.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -836,12 +1268,12 @@ def user_service_add_otp_email_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Add OTP Email for a user + ) -> UserServiceGetUserByIDResponse: + """User by ID - Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. + Returns the full user object (human or machine) including the profile, email, etc.. - :param user_id: (required) + :param user_id: User ID of the user you like to get. (required) :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -865,7 +1297,7 @@ def user_service_add_otp_email_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_otp_email_serialize( + _param = self.__user_service_get_user_by_id_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -874,96 +1306,88 @@ def user_service_add_otp_email_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddOTPEmailResponse", + '200': "UserServiceGetUserByIDResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_add_otp_email_serialize( - self, - user_id, - _request_auth, - _content_type, - _headers, - _host_index, + + def __user_service_get_user_by_id_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, ) -> RequestSerialized: - _host = None + _host = None - _collection_formats: Dict[str, str] = { - } + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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' + ] + ) - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/otp_email', - 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 - ) + + # authentication setting + _auth_settings: List[str] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/users/{userId}', + 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 user_service_add_otpsms( + def user_service_human_mfa_init_skipped( self, user_id: StrictStr, _request_timeout: Union[ @@ -978,10 +1402,10 @@ def user_service_add_otpsms( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceAddOTPSMSResponse: - """Add OTP SMS for a user + ) -> UserServiceHumanMFAInitSkippedResponse: + """MFA Init Skipped - Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. + Update the last time the user has skipped MFA initialization. The server timestamp is used. :param user_id: (required) :type user_id: str @@ -1007,7 +1431,7 @@ def user_service_add_otpsms( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_otpsms_serialize( + _param = self.__user_service_human_mfa_init_skipped_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1016,25 +1440,92 @@ def user_service_add_otpsms( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddOTPSMSResponse", + '200': "UserServiceHumanMFAInitSkippedResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_human_mfa_init_skipped_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/mfa_init_skipped', + 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 user_service_add_otpsms_with_http_info( + def user_service_list_authentication_factors( self, user_id: StrictStr, + auth_factors: Annotated[Optional[List[StrictStr]], Field(description="Specify the Auth Factors you are interested in")] = None, + states: Annotated[Optional[List[StrictStr]], Field(description="Specify the state of the Auth Factors")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1047,13 +1538,16 @@ def user_service_add_otpsms_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[UserServiceAddOTPSMSResponse]: - """Add OTP SMS for a user + ) -> UserServiceListAuthenticationFactorsResponse: + """user_service_list_authentication_factors - Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. :param user_id: (required) :type user_id: str + :param auth_factors: Specify the Auth Factors you are interested in + :type auth_factors: List[str] + :param states: Specify the state of the Auth Factors + :type states: List[str] :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 @@ -1076,8 +1570,10 @@ def user_service_add_otpsms_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_otpsms_serialize( + _param = self.__user_service_list_authentication_factors_serialize( user_id=user_id, + auth_factors=auth_factors, + states=states, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1085,25 +1581,104 @@ def user_service_add_otpsms_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddOTPSMSResponse", + '200': "UserServiceListAuthenticationFactorsResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_list_authentication_factors_serialize( + self, + user_id, + auth_factors, + states, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'authFactors': 'csv', + 'states': 'csv', + } + + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if auth_factors is not None: + + _query_params.append(('authFactors', auth_factors)) + + if states is not None: + + _query_params.append(('states', states)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/authentication_factors/_search', + 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 user_service_add_otpsms_without_preload_content( + def user_service_list_authentication_method_types( self, user_id: StrictStr, + domain_query_include_without_domain: Annotated[Optional[StrictBool], Field(description="List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI.")] = None, + domain_query_domain: Annotated[Optional[StrictStr], Field(description="List only auth methods with specific domain.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1116,15 +1691,19 @@ def user_service_add_otpsms_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Add OTP SMS for a user + ) -> UserServiceListAuthenticationMethodTypesResponse: + """List all possible authentication methods of a user - Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. + List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. :param user_id: (required) :type user_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request + :param domain_query_include_without_domain: List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. + :type domain_query_include_without_domain: bool + :param domain_query_domain: List only auth methods with specific domain. + :type domain_query_domain: str + :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 @@ -1145,8 +1724,10 @@ def user_service_add_otpsms_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_add_otpsms_serialize( + _param = self.__user_service_list_authentication_method_types_serialize( user_id=user_id, + domain_query_include_without_domain=domain_query_include_without_domain, + domain_query_domain=domain_query_domain, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1154,99 +1735,101 @@ def user_service_add_otpsms_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddOTPSMSResponse", + '200': "UserServiceListAuthenticationMethodTypesResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - + 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 - def _user_service_add_otpsms_serialize( - self, - user_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - _collection_formats: Dict[str, str] = { - } + def __user_service_list_authentication_method_types_serialize( + self, + user_id, + domain_query_include_without_domain, + domain_query_domain, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/otp_sms', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if domain_query_include_without_domain is not None: + + _query_params.append(('domainQuery.includeWithoutDomain', domain_query_include_without_domain)) + + if domain_query_domain is not None: + + _query_params.append(('domainQuery.domain', domain_query_domain)) + + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/users/{userId}/authentication_methods', + 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 user_service_create_invite_code( + def user_service_list_idp_links( self, user_id: StrictStr, - user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest, + user_service_list_idp_links_request: UserServiceListIDPLinksRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1259,15 +1842,15 @@ def user_service_create_invite_code( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceCreateInviteCodeResponse: - """Create an invite code for a user + ) -> UserServiceListIDPLinksResponse: + """List links to an identity provider of an user - Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. + List links to an identity provider of an user. :param user_id: (required) :type user_id: str - :param user_service_create_invite_code_request: (required) - :type user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest + :param user_service_list_idp_links_request: (required) + :type user_service_list_idp_links_request: UserServiceListIDPLinksRequest :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 @@ -1290,9 +1873,9 @@ def user_service_create_invite_code( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_create_invite_code_serialize( + _param = self.__user_service_list_idp_links_serialize( user_id=user_id, - user_service_create_invite_code_request=user_service_create_invite_code_request, + user_service_list_idp_links_request=user_service_list_idp_links_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1300,26 +1883,106 @@ def user_service_create_invite_code( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreateInviteCodeResponse", + '200': "UserServiceListIDPLinksResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_list_idp_links_serialize( + self, + user_id, + user_service_list_idp_links_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_list_idp_links_request is not None: + _body_params = user_service_list_idp_links_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/links/_search', + 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 user_service_create_invite_code_with_http_info( + def user_service_list_passkeys( self, user_id: StrictStr, - user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1332,15 +1995,13 @@ def user_service_create_invite_code_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[UserServiceCreateInviteCodeResponse]: - """Create an invite code for a user + ) -> UserServiceListPasskeysResponse: + """List passkeys of an user - Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. + List passkeys of an user :param user_id: (required) :type user_id: str - :param user_service_create_invite_code_request: (required) - :type user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest :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 @@ -1363,9 +2024,8 @@ def user_service_create_invite_code_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_create_invite_code_serialize( + _param = self.__user_service_list_passkeys_serialize( user_id=user_id, - user_service_create_invite_code_request=user_service_create_invite_code_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1373,26 +2033,90 @@ def user_service_create_invite_code_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreateInviteCodeResponse", + '200': "UserServiceListPasskeysResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_list_passkeys_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/passkeys/_search', + 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 user_service_create_invite_code_without_preload_content( + def user_service_list_users( self, - user_id: StrictStr, - user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest, + user_service_list_users_request: UserServiceListUsersRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1405,15 +2129,13 @@ def user_service_create_invite_code_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create an invite code for a user + ) -> UserServiceListUsersResponse: + """Search Users - Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. + Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. - :param user_id: (required) - :type user_id: str - :param user_service_create_invite_code_request: (required) - :type user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest + :param user_service_list_users_request: (required) + :type user_service_list_users_request: UserServiceListUsersRequest :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 @@ -1436,9 +2158,8 @@ def user_service_create_invite_code_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_create_invite_code_serialize( - user_id=user_id, - user_service_create_invite_code_request=user_service_create_invite_code_request, + _param = self.__user_service_list_users_serialize( + user_service_list_users_request=user_service_list_users_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1446,102 +2167,104 @@ def user_service_create_invite_code_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreateInviteCodeResponse", + '200': "UserServiceListUsersResponse", + '400': "UserServiceRpcStatus", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_create_invite_code_serialize( - self, - user_id, - user_service_create_invite_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - } + def __user_service_list_users_serialize( + self, + user_service_list_users_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_create_invite_code_request is not None: - _body_params = user_service_create_invite_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/invite_code', - 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 - ) + _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 user_service_list_users_request is not None: + _body_params = user_service_list_users_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users', + 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 user_service_create_passkey_registration_link( + def user_service_lock_user( self, user_id: StrictStr, - user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1554,15 +2277,13 @@ def user_service_create_passkey_registration_link( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceCreatePasskeyRegistrationLinkResponse: - """Create a passkey registration link for a user + ) -> UserServiceLockUserResponse: + """Lock user - Create a passkey registration link which includes a code and either return it or send it to the user.. + The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. :param user_id: (required) :type user_id: str - :param user_service_create_passkey_registration_link_request: (required) - :type user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest :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 @@ -1585,9 +2306,8 @@ def user_service_create_passkey_registration_link( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_create_passkey_registration_link_serialize( + _param = self.__user_service_lock_user_serialize( user_id=user_id, - user_service_create_passkey_registration_link_request=user_service_create_passkey_registration_link_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1595,26 +2315,91 @@ def user_service_create_passkey_registration_link( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreatePasskeyRegistrationLinkResponse", + '200': "UserServiceLockUserResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_lock_user_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/lock', + 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 user_service_create_passkey_registration_link_with_http_info( + def user_service_password_reset( self, user_id: StrictStr, - user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest, + user_service_password_reset_request: UserServicePasswordResetRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1627,15 +2412,15 @@ def user_service_create_passkey_registration_link_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[UserServiceCreatePasskeyRegistrationLinkResponse]: - """Create a passkey registration link for a user + ) -> UserServicePasswordResetResponse: + """Request a code to reset a password - Create a passkey registration link which includes a code and either return it or send it to the user.. + Request a code to reset a password.. :param user_id: (required) :type user_id: str - :param user_service_create_passkey_registration_link_request: (required) - :type user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest + :param user_service_password_reset_request: (required) + :type user_service_password_reset_request: UserServicePasswordResetRequest :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 @@ -1658,9 +2443,9 @@ def user_service_create_passkey_registration_link_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_create_passkey_registration_link_serialize( + _param = self.__user_service_password_reset_serialize( user_id=user_id, - user_service_create_passkey_registration_link_request=user_service_create_passkey_registration_link_request, + user_service_password_reset_request=user_service_password_reset_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1668,26 +2453,106 @@ def user_service_create_passkey_registration_link_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreatePasskeyRegistrationLinkResponse", + '200': "UserServicePasswordResetResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_password_reset_serialize( + self, + user_id, + user_service_password_reset_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_password_reset_request is not None: + _body_params = user_service_password_reset_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/password_reset', + 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 user_service_create_passkey_registration_link_without_preload_content( + def user_service_reactivate_user( self, user_id: StrictStr, - user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1700,15 +2565,13 @@ def user_service_create_passkey_registration_link_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create a passkey registration link for a user + ) -> UserServiceReactivateUserResponse: + """Reactivate user - Create a passkey registration link which includes a code and either return it or send it to the user.. + Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. :param user_id: (required) :type user_id: str - :param user_service_create_passkey_registration_link_request: (required) - :type user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest :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 @@ -1731,9 +2594,8 @@ def user_service_create_passkey_registration_link_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_create_passkey_registration_link_serialize( + _param = self.__user_service_reactivate_user_serialize( user_id=user_id, - user_service_create_passkey_registration_link_request=user_service_create_passkey_registration_link_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1741,101 +2603,91 @@ def user_service_create_passkey_registration_link_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreatePasskeyRegistrationLinkResponse", + '200': "UserServiceReactivateUserResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_create_passkey_registration_link_serialize( - self, - user_id, - user_service_create_passkey_registration_link_request, - _request_auth, - _content_type, - _headers, - _host_index, + + def __user_service_reactivate_user_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, ) -> RequestSerialized: - _host = None + _host = None - _collection_formats: Dict[str, str] = { - } + _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_create_passkey_registration_link_request is not None: - _body_params = user_service_create_passkey_registration_link_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/passkeys/registration_link', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/reactivate', + 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 user_service_deactivate_user( + def user_service_register_passkey( self, user_id: StrictStr, + user_service_register_passkey_request: UserServiceRegisterPasskeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1848,13 +2700,15 @@ def user_service_deactivate_user( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceDeactivateUserResponse: - """Deactivate user + ) -> UserServiceRegisterPasskeyResponse: + """Start the registration of passkey for a user - The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. + Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. :param user_id: (required) :type user_id: str + :param user_service_register_passkey_request: (required) + :type user_service_register_passkey_request: UserServiceRegisterPasskeyRequest :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 @@ -1877,8 +2731,9 @@ def user_service_deactivate_user( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_deactivate_user_serialize( + _param = self.__user_service_register_passkey_serialize( user_id=user_id, + user_service_register_passkey_request=user_service_register_passkey_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1886,23 +2741,104 @@ def user_service_deactivate_user( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeactivateUserResponse", + '200': "UserServiceRegisterPasskeyResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_register_passkey_serialize( + self, + user_id, + user_service_register_passkey_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_register_passkey_request is not None: + _body_params = user_service_register_passkey_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/passkeys', + 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 user_service_deactivate_user_with_http_info( + def user_service_register_totp( self, user_id: StrictStr, _request_timeout: Union[ @@ -1917,10 +2853,10 @@ def user_service_deactivate_user_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[UserServiceDeactivateUserResponse]: - """Deactivate user + ) -> UserServiceRegisterTOTPResponse: + """Start the registration of a TOTP generator for a user - The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. + Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. :param user_id: (required) :type user_id: str @@ -1946,7 +2882,7 @@ def user_service_deactivate_user_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_deactivate_user_serialize( + _param = self.__user_service_register_totp_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1955,25 +2891,91 @@ def user_service_deactivate_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeactivateUserResponse", + '200': "UserServiceRegisterTOTPResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_register_totp_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/totp', + 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 user_service_deactivate_user_without_preload_content( + def user_service_register_u2_f( self, user_id: StrictStr, + user_service_register_u2_f_request: UserServiceRegisterU2FRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1986,13 +2988,15 @@ def user_service_deactivate_user_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Deactivate user + ) -> UserServiceRegisterU2FResponse: + """Start the registration of a u2f token for a user - The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. + Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. :param user_id: (required) :type user_id: str + :param user_service_register_u2_f_request: (required) + :type user_service_register_u2_f_request: UserServiceRegisterU2FRequest :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 @@ -2015,8 +3019,9 @@ def user_service_deactivate_user_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_deactivate_user_serialize( + _param = self.__user_service_register_u2_f_serialize( user_id=user_id, + user_service_register_u2_f_request=user_service_register_u2_f_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2024,98 +3029,108 @@ def user_service_deactivate_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeactivateUserResponse", + '200': "UserServiceRegisterU2FResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_deactivate_user_serialize( - self, - user_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - } + def __user_service_register_u2_f_serialize( + self, + user_id, + user_service_register_u2_f_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/deactivate', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_register_u2_f_request is not None: + _body_params = user_service_register_u2_f_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/u2f', + 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 user_service_delete_user( + def user_service_remove_idp_link( self, user_id: StrictStr, + idp_id: StrictStr, + linked_user_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2128,13 +3143,17 @@ def user_service_delete_user( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceDeleteUserResponse: - """Delete user + ) -> UserServiceRemoveIDPLinkResponse: + """Remove link of an identity provider to an user - The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. + Remove link of an identity provider to an user. :param user_id: (required) :type user_id: str + :param idp_id: (required) + :type idp_id: str + :param linked_user_id: (required) + :type linked_user_id: str :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 @@ -2157,8 +3176,10 @@ def user_service_delete_user( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_delete_user_serialize( + _param = self.__user_service_remove_idp_link_serialize( user_id=user_id, + idp_id=idp_id, + linked_user_id=linked_user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2166,23 +3187,94 @@ def user_service_delete_user( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeleteUserResponse", + '200': "UserServiceRemoveIDPLinkResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_remove_idp_link_serialize( + self, + user_id, + idp_id, + linked_user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + if idp_id is not None: + _path_params['idpId'] = idp_id + if linked_user_id is not None: + _path_params['linkedUserId'] = linked_user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/users/{userId}/links/{idpId}/{linkedUserId}', + 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 user_service_delete_user_with_http_info( + def user_service_remove_otp_email( self, user_id: StrictStr, _request_timeout: Union[ @@ -2197,10 +3289,10 @@ def user_service_delete_user_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[UserServiceDeleteUserResponse]: - """Delete user + ) -> UserServiceRemoveOTPEmailResponse: + """Remove One-Time Password (OTP) Email from a user - The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. + Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. :param user_id: (required) :type user_id: str @@ -2226,7 +3318,7 @@ def user_service_delete_user_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_delete_user_serialize( + _param = self.__user_service_remove_otp_email_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2235,23 +3327,88 @@ def user_service_delete_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeleteUserResponse", + '200': "UserServiceRemoveOTPEmailResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_remove_otp_email_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/users/{userId}/otp_email', + 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 user_service_delete_user_without_preload_content( + def user_service_remove_otpsms( self, user_id: StrictStr, _request_timeout: Union[ @@ -2266,10 +3423,10 @@ def user_service_delete_user_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete user + ) -> UserServiceRemoveOTPSMSResponse: + """Remove One-Time Password (OTP) SMS from a user - The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. + Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. :param user_id: (required) :type user_id: str @@ -2295,7 +3452,7 @@ def user_service_delete_user_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_delete_user_serialize( + _param = self.__user_service_remove_otpsms_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2304,85 +3461,91 @@ def user_service_delete_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeleteUserResponse", + '200': "UserServiceRemoveOTPSMSResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_delete_user_serialize( - self, - user_id, - _request_auth, - _content_type, - _headers, - _host_index, + + def __user_service_remove_otpsms_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, ) -> RequestSerialized: - _host = None + _host = None - _collection_formats: Dict[str, str] = { - } + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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' + ] + ) - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/users/{userId}', - 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 - ) + + # authentication setting + _auth_settings: List[str] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/users/{userId}/otp_sms', + 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 user_service_get_user_by_id( + def user_service_remove_passkey( self, - user_id: Annotated[StrictStr, Field(description="User ID of the user you like to get.")], + user_id: StrictStr, + passkey_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2395,13 +3558,15 @@ def user_service_get_user_by_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceGetUserByIDResponse: - """User by ID + ) -> UserServiceRemovePasskeyResponse: + """Remove passkey from a user - Returns the full user object (human or machine) including the profile, email, etc.. + Remove passkey from a user. - :param user_id: User ID of the user you like to get. (required) + :param user_id: (required) :type user_id: str + :param passkey_id: (required) + :type passkey_id: str :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 @@ -2424,8 +3589,9 @@ def user_service_get_user_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_get_user_by_id_serialize( + _param = self.__user_service_remove_passkey_serialize( user_id=user_id, + passkey_id=passkey_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2433,25 +3599,93 @@ def user_service_get_user_by_id( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceGetUserByIDResponse", + '200': "UserServiceRemovePasskeyResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_remove_passkey_serialize( + self, + user_id, + passkey_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + if passkey_id is not None: + _path_params['passkeyId'] = passkey_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/users/{userId}/passkeys/{passkeyId}', + 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 user_service_get_user_by_id_with_http_info( + def user_service_remove_phone( self, - user_id: Annotated[StrictStr, Field(description="User ID of the user you like to get.")], + user_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2464,12 +3698,12 @@ def user_service_get_user_by_id_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[UserServiceGetUserByIDResponse]: - """User by ID + ) -> UserServiceRemovePhoneResponse: + """Delete the user phone - Returns the full user object (human or machine) including the profile, email, etc.. + Delete the phone number of a user. - :param user_id: User ID of the user you like to get. (required) + :param user_id: (required) :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2493,7 +3727,7 @@ def user_service_get_user_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_get_user_by_id_serialize( + _param = self.__user_service_remove_phone_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2502,25 +3736,90 @@ def user_service_get_user_by_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceGetUserByIDResponse", + '200': "UserServiceRemovePhoneResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_remove_phone_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/users/{userId}/phone', + 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 user_service_get_user_by_id_without_preload_content( + def user_service_remove_totp( self, - user_id: Annotated[StrictStr, Field(description="User ID of the user you like to get.")], + user_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2533,12 +3832,12 @@ def user_service_get_user_by_id_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """User by ID + ) -> UserServiceRemoveTOTPResponse: + """Remove TOTP generator from a user - Returns the full user object (human or machine) including the profile, email, etc.. + Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. - :param user_id: User ID of the user you like to get. (required) + :param user_id: (required) :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2562,7 +3861,7 @@ def user_service_get_user_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_get_user_by_id_serialize( + _param = self.__user_service_remove_totp_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2571,85 +3870,91 @@ def user_service_get_user_by_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceGetUserByIDResponse", + '200': "UserServiceRemoveTOTPResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_get_user_by_id_serialize( - self, - user_id, - _request_auth, - _content_type, - _headers, - _host_index, + + def __user_service_remove_totp_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, ) -> RequestSerialized: - _host = None + _host = None - _collection_formats: Dict[str, str] = { - } + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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' + ] + ) - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/users/{userId}', - 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 - ) + + # authentication setting + _auth_settings: List[str] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/users/{userId}/totp', + 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 user_service_human_mfa_init_skipped( + def user_service_remove_u2_f( self, user_id: StrictStr, + u2f_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2662,13 +3967,15 @@ def user_service_human_mfa_init_skipped( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceHumanMFAInitSkippedResponse: - """MFA Init Skipped + ) -> UserServiceRemoveU2FResponse: + """Remove u2f token from a user - Update the last time the user has skipped MFA initialization. The server timestamp is used. + Remove u2f token from a user :param user_id: (required) :type user_id: str + :param u2f_id: (required) + :type u2f_id: str :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 @@ -2691,8 +3998,9 @@ def user_service_human_mfa_init_skipped( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_human_mfa_init_skipped_serialize( + _param = self.__user_service_remove_u2_f_serialize( user_id=user_id, + u2f_id=u2f_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2700,25 +4008,94 @@ def user_service_human_mfa_init_skipped( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceHumanMFAInitSkippedResponse", + '200': "UserServiceRemoveU2FResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_remove_u2_f_serialize( + self, + user_id, + u2f_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + if u2f_id is not None: + _path_params['u2fId'] = u2f_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/users/{userId}/u2f/{u2fId}', + 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 user_service_human_mfa_init_skipped_with_http_info( + def user_service_resend_email_code( self, user_id: StrictStr, + user_service_resend_email_code_request: UserServiceResendEmailCodeRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2731,13 +4108,15 @@ def user_service_human_mfa_init_skipped_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[UserServiceHumanMFAInitSkippedResponse]: - """MFA Init Skipped + ) -> UserServiceResendEmailCodeResponse: + """Resend code to verify user email - Update the last time the user has skipped MFA initialization. The server timestamp is used. + Resend code to verify user email. :param user_id: (required) :type user_id: str + :param user_service_resend_email_code_request: (required) + :type user_service_resend_email_code_request: UserServiceResendEmailCodeRequest :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 @@ -2760,8 +4139,9 @@ def user_service_human_mfa_init_skipped_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_human_mfa_init_skipped_serialize( + _param = self.__user_service_resend_email_code_serialize( user_id=user_id, + user_service_resend_email_code_request=user_service_resend_email_code_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2769,23 +4149,104 @@ def user_service_human_mfa_init_skipped_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceHumanMFAInitSkippedResponse", + '200': "UserServiceResendEmailCodeResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_resend_email_code_serialize( + self, + user_id, + user_service_resend_email_code_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_resend_email_code_request is not None: + _body_params = user_service_resend_email_code_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/email/resend', + 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 user_service_human_mfa_init_skipped_without_preload_content( + def user_service_resend_invite_code( self, user_id: StrictStr, _request_timeout: Union[ @@ -2800,10 +4261,10 @@ def user_service_human_mfa_init_skipped_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """MFA Init Skipped + ) -> UserServiceResendInviteCodeResponse: + """Resend an invite code for a user - Update the last time the user has skipped MFA initialization. The server timestamp is used. + Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. :param user_id: (required) :type user_id: str @@ -2829,7 +4290,7 @@ def user_service_human_mfa_init_skipped_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_human_mfa_init_skipped_serialize( + _param = self.__user_service_resend_invite_code_serialize( user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2838,100 +4299,91 @@ def user_service_human_mfa_init_skipped_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceHumanMFAInitSkippedResponse", + '200': "UserServiceResendInviteCodeResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_human_mfa_init_skipped_serialize( - self, - user_id, - _request_auth, - _content_type, - _headers, - _host_index, + + def __user_service_resend_invite_code_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, ) -> RequestSerialized: - _host = None + _host = None - _collection_formats: Dict[str, str] = { - } + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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' + ] + ) - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/mfa_init_skipped', - 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 - ) + + # authentication setting + _auth_settings: List[str] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/invite_code/resend', + 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 user_service_list_authentication_factors( + def user_service_resend_phone_code( self, user_id: StrictStr, - auth_factors: Annotated[Optional[List[StrictStr]], Field(description="Specify the Auth Factors you are interested in")] = None, - states: Annotated[Optional[List[StrictStr]], Field(description="Specify the state of the Auth Factors")] = None, + user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2944,16 +4396,15 @@ def user_service_list_authentication_factors( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceListAuthenticationFactorsResponse: - """user_service_list_authentication_factors + ) -> UserServiceResendPhoneCodeResponse: + """Resend code to verify user phone + Resend code to verify user phone. :param user_id: (required) :type user_id: str - :param auth_factors: Specify the Auth Factors you are interested in - :type auth_factors: List[str] - :param states: Specify the state of the Auth Factors - :type states: List[str] + :param user_service_resend_phone_code_request: (required) + :type user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest :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 @@ -2976,10 +4427,9 @@ def user_service_list_authentication_factors( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_list_authentication_factors_serialize( + _param = self.__user_service_resend_phone_code_serialize( user_id=user_id, - auth_factors=auth_factors, - states=states, + user_service_resend_phone_code_request=user_service_resend_phone_code_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2987,27 +4437,107 @@ def user_service_list_authentication_factors( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListAuthenticationFactorsResponse", + '200': "UserServiceResendPhoneCodeResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_resend_phone_code_serialize( + self, + user_id, + user_service_resend_phone_code_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_resend_phone_code_request is not None: + _body_params = user_service_resend_phone_code_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/phone/resend', + 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 user_service_list_authentication_factors_with_http_info( + def user_service_retrieve_identity_provider_intent( self, - user_id: StrictStr, - auth_factors: Annotated[Optional[List[StrictStr]], Field(description="Specify the Auth Factors you are interested in")] = None, - states: Annotated[Optional[List[StrictStr]], Field(description="Specify the state of the Auth Factors")] = None, + idp_intent_id: Annotated[StrictStr, Field(description="ID of the idp intent, previously returned on the success response of the IDP callback")], + user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3020,16 +4550,15 @@ def user_service_list_authentication_factors_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[UserServiceListAuthenticationFactorsResponse]: - """user_service_list_authentication_factors + ) -> UserServiceRetrieveIdentityProviderIntentResponse: + """Retrieve the information returned by the identity provider + Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. - :param user_id: (required) - :type user_id: str - :param auth_factors: Specify the Auth Factors you are interested in - :type auth_factors: List[str] - :param states: Specify the state of the Auth Factors - :type states: List[str] + :param idp_intent_id: ID of the idp intent, previously returned on the success response of the IDP callback (required) + :type idp_intent_id: str + :param user_service_retrieve_identity_provider_intent_request: (required) + :type user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest :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 @@ -3052,10 +4581,9 @@ def user_service_list_authentication_factors_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_list_authentication_factors_serialize( - user_id=user_id, - auth_factors=auth_factors, - states=states, + _param = self.__user_service_retrieve_identity_provider_intent_serialize( + idp_intent_id=idp_intent_id, + user_service_retrieve_identity_provider_intent_request=user_service_retrieve_identity_provider_intent_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3063,27 +4591,107 @@ def user_service_list_authentication_factors_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListAuthenticationFactorsResponse", + '200': "UserServiceRetrieveIdentityProviderIntentResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_retrieve_identity_provider_intent_serialize( + self, + idp_intent_id, + user_service_retrieve_identity_provider_intent_request, + _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 + if idp_intent_id is not None: + _path_params['idpIntentId'] = idp_intent_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_retrieve_identity_provider_intent_request is not None: + _body_params = user_service_retrieve_identity_provider_intent_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/idp_intents/{idpIntentId}', + 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 user_service_list_authentication_factors_without_preload_content( + def user_service_send_email_code( self, user_id: StrictStr, - auth_factors: Annotated[Optional[List[StrictStr]], Field(description="Specify the Auth Factors you are interested in")] = None, - states: Annotated[Optional[List[StrictStr]], Field(description="Specify the state of the Auth Factors")] = None, + user_service_send_email_code_request: UserServiceSendEmailCodeRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3096,16 +4704,15 @@ def user_service_list_authentication_factors_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """user_service_list_authentication_factors + ) -> UserServiceSendEmailCodeResponse: + """Send code to verify user email + Send code to verify user email. :param user_id: (required) :type user_id: str - :param auth_factors: Specify the Auth Factors you are interested in - :type auth_factors: List[str] - :param states: Specify the state of the Auth Factors - :type states: List[str] + :param user_service_send_email_code_request: (required) + :type user_service_send_email_code_request: UserServiceSendEmailCodeRequest :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 @@ -3128,10 +4735,9 @@ def user_service_list_authentication_factors_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_list_authentication_factors_serialize( + _param = self.__user_service_send_email_code_serialize( user_id=user_id, - auth_factors=auth_factors, - states=states, + user_service_send_email_code_request=user_service_send_email_code_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3139,8492 +4745,107 @@ def user_service_list_authentication_factors_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListAuthenticationFactorsResponse", + '200': "UserServiceSendEmailCodeResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_list_authentication_factors_serialize( - self, - user_id, - auth_factors, - states, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'authFactors': 'csv', - 'states': 'csv', - } - - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - if auth_factors is not None: - - _query_params.append(('authFactors', auth_factors)) - - if states is not None: - - _query_params.append(('states', states)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/authentication_factors/_search', - 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 user_service_list_authentication_method_types( - self, - user_id: StrictStr, - domain_query_include_without_domain: Annotated[Optional[StrictBool], Field(description="List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI.")] = None, - domain_query_domain: Annotated[Optional[StrictStr], Field(description="List only auth methods with specific domain.")] = None, - _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, - ) -> UserServiceListAuthenticationMethodTypesResponse: - """List all possible authentication methods of a user - - List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. - - :param user_id: (required) - :type user_id: str - :param domain_query_include_without_domain: List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. - :type domain_query_include_without_domain: bool - :param domain_query_domain: List only auth methods with specific domain. - :type domain_query_domain: str - :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._user_service_list_authentication_method_types_serialize( - user_id=user_id, - domain_query_include_without_domain=domain_query_include_without_domain, - domain_query_domain=domain_query_domain, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListAuthenticationMethodTypesResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_list_authentication_method_types_with_http_info( - self, - user_id: StrictStr, - domain_query_include_without_domain: Annotated[Optional[StrictBool], Field(description="List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI.")] = None, - domain_query_domain: Annotated[Optional[StrictStr], Field(description="List only auth methods with specific domain.")] = None, - _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[UserServiceListAuthenticationMethodTypesResponse]: - """List all possible authentication methods of a user - - List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. - - :param user_id: (required) - :type user_id: str - :param domain_query_include_without_domain: List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. - :type domain_query_include_without_domain: bool - :param domain_query_domain: List only auth methods with specific domain. - :type domain_query_domain: str - :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._user_service_list_authentication_method_types_serialize( - user_id=user_id, - domain_query_include_without_domain=domain_query_include_without_domain, - domain_query_domain=domain_query_domain, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListAuthenticationMethodTypesResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_list_authentication_method_types_without_preload_content( - self, - user_id: StrictStr, - domain_query_include_without_domain: Annotated[Optional[StrictBool], Field(description="List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI.")] = None, - domain_query_domain: Annotated[Optional[StrictStr], Field(description="List only auth methods with specific domain.")] = None, - _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: - """List all possible authentication methods of a user - - List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. - - :param user_id: (required) - :type user_id: str - :param domain_query_include_without_domain: List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. - :type domain_query_include_without_domain: bool - :param domain_query_domain: List only auth methods with specific domain. - :type domain_query_domain: str - :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._user_service_list_authentication_method_types_serialize( - user_id=user_id, - domain_query_include_without_domain=domain_query_include_without_domain, - domain_query_domain=domain_query_domain, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListAuthenticationMethodTypesResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_list_authentication_method_types_serialize( - self, - user_id, - domain_query_include_without_domain, - domain_query_domain, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - if domain_query_include_without_domain is not None: - - _query_params.append(('domainQuery.includeWithoutDomain', domain_query_include_without_domain)) - - if domain_query_domain is not None: - - _query_params.append(('domainQuery.domain', domain_query_domain)) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/users/{userId}/authentication_methods', - 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 user_service_list_idp_links( - self, - user_id: StrictStr, - user_service_list_idp_links_request: UserServiceListIDPLinksRequest, - _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, - ) -> UserServiceListIDPLinksResponse: - """List links to an identity provider of an user - - List links to an identity provider of an user. - - :param user_id: (required) - :type user_id: str - :param user_service_list_idp_links_request: (required) - :type user_service_list_idp_links_request: UserServiceListIDPLinksRequest - :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._user_service_list_idp_links_serialize( - user_id=user_id, - user_service_list_idp_links_request=user_service_list_idp_links_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListIDPLinksResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_list_idp_links_with_http_info( - self, - user_id: StrictStr, - user_service_list_idp_links_request: UserServiceListIDPLinksRequest, - _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[UserServiceListIDPLinksResponse]: - """List links to an identity provider of an user - - List links to an identity provider of an user. - - :param user_id: (required) - :type user_id: str - :param user_service_list_idp_links_request: (required) - :type user_service_list_idp_links_request: UserServiceListIDPLinksRequest - :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._user_service_list_idp_links_serialize( - user_id=user_id, - user_service_list_idp_links_request=user_service_list_idp_links_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListIDPLinksResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_list_idp_links_without_preload_content( - self, - user_id: StrictStr, - user_service_list_idp_links_request: UserServiceListIDPLinksRequest, - _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: - """List links to an identity provider of an user - - List links to an identity provider of an user. - - :param user_id: (required) - :type user_id: str - :param user_service_list_idp_links_request: (required) - :type user_service_list_idp_links_request: UserServiceListIDPLinksRequest - :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._user_service_list_idp_links_serialize( - user_id=user_id, - user_service_list_idp_links_request=user_service_list_idp_links_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListIDPLinksResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_list_idp_links_serialize( - self, - user_id, - user_service_list_idp_links_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_idp_links_request is not None: - _body_params = user_service_list_idp_links_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/links/_search', - 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 user_service_list_passkeys( - self, - user_id: StrictStr, - _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, - ) -> UserServiceListPasskeysResponse: - """List passkeys of an user - - List passkeys of an user - - :param user_id: (required) - :type user_id: str - :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._user_service_list_passkeys_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListPasskeysResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_list_passkeys_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceListPasskeysResponse]: - """List passkeys of an user - - List passkeys of an user - - :param user_id: (required) - :type user_id: str - :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._user_service_list_passkeys_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListPasskeysResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_list_passkeys_without_preload_content( - self, - user_id: StrictStr, - _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: - """List passkeys of an user - - List passkeys of an user - - :param user_id: (required) - :type user_id: str - :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._user_service_list_passkeys_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListPasskeysResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_list_passkeys_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/passkeys/_search', - 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 user_service_list_users( - self, - user_service_list_users_request: UserServiceListUsersRequest, - _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, - ) -> UserServiceListUsersResponse: - """Search Users - - Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. - - :param user_service_list_users_request: (required) - :type user_service_list_users_request: UserServiceListUsersRequest - :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._user_service_list_users_serialize( - user_service_list_users_request=user_service_list_users_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListUsersResponse", - '400': "UserServiceRpcStatus", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_list_users_with_http_info( - self, - user_service_list_users_request: UserServiceListUsersRequest, - _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[UserServiceListUsersResponse]: - """Search Users - - Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. - - :param user_service_list_users_request: (required) - :type user_service_list_users_request: UserServiceListUsersRequest - :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._user_service_list_users_serialize( - user_service_list_users_request=user_service_list_users_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListUsersResponse", - '400': "UserServiceRpcStatus", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_list_users_without_preload_content( - self, - user_service_list_users_request: UserServiceListUsersRequest, - _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: - """Search Users - - Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. - - :param user_service_list_users_request: (required) - :type user_service_list_users_request: UserServiceListUsersRequest - :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._user_service_list_users_serialize( - user_service_list_users_request=user_service_list_users_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListUsersResponse", - '400': "UserServiceRpcStatus", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_list_users_serialize( - self, - user_service_list_users_request, - _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 user_service_list_users_request is not None: - _body_params = user_service_list_users_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users', - 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 user_service_lock_user( - self, - user_id: StrictStr, - _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, - ) -> UserServiceLockUserResponse: - """Lock user - - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - - :param user_id: (required) - :type user_id: str - :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._user_service_lock_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceLockUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_lock_user_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceLockUserResponse]: - """Lock user - - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - - :param user_id: (required) - :type user_id: str - :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._user_service_lock_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceLockUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_lock_user_without_preload_content( - self, - user_id: StrictStr, - _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: - """Lock user - - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - - :param user_id: (required) - :type user_id: str - :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._user_service_lock_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceLockUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_lock_user_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/lock', - 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 user_service_password_reset( - self, - user_id: StrictStr, - user_service_password_reset_request: UserServicePasswordResetRequest, - _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, - ) -> UserServicePasswordResetResponse: - """Request a code to reset a password - - Request a code to reset a password.. - - :param user_id: (required) - :type user_id: str - :param user_service_password_reset_request: (required) - :type user_service_password_reset_request: UserServicePasswordResetRequest - :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._user_service_password_reset_serialize( - user_id=user_id, - user_service_password_reset_request=user_service_password_reset_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServicePasswordResetResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_password_reset_with_http_info( - self, - user_id: StrictStr, - user_service_password_reset_request: UserServicePasswordResetRequest, - _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[UserServicePasswordResetResponse]: - """Request a code to reset a password - - Request a code to reset a password.. - - :param user_id: (required) - :type user_id: str - :param user_service_password_reset_request: (required) - :type user_service_password_reset_request: UserServicePasswordResetRequest - :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._user_service_password_reset_serialize( - user_id=user_id, - user_service_password_reset_request=user_service_password_reset_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServicePasswordResetResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_password_reset_without_preload_content( - self, - user_id: StrictStr, - user_service_password_reset_request: UserServicePasswordResetRequest, - _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: - """Request a code to reset a password - - Request a code to reset a password.. - - :param user_id: (required) - :type user_id: str - :param user_service_password_reset_request: (required) - :type user_service_password_reset_request: UserServicePasswordResetRequest - :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._user_service_password_reset_serialize( - user_id=user_id, - user_service_password_reset_request=user_service_password_reset_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServicePasswordResetResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_password_reset_serialize( - self, - user_id, - user_service_password_reset_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_password_reset_request is not None: - _body_params = user_service_password_reset_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/password_reset', - 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 user_service_reactivate_user( - self, - user_id: StrictStr, - _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, - ) -> UserServiceReactivateUserResponse: - """Reactivate user - - Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. - - :param user_id: (required) - :type user_id: str - :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._user_service_reactivate_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceReactivateUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_reactivate_user_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceReactivateUserResponse]: - """Reactivate user - - Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. - - :param user_id: (required) - :type user_id: str - :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._user_service_reactivate_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceReactivateUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_reactivate_user_without_preload_content( - self, - user_id: StrictStr, - _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: - """Reactivate user - - Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. - - :param user_id: (required) - :type user_id: str - :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._user_service_reactivate_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceReactivateUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_reactivate_user_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/reactivate', - 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 user_service_register_passkey( - self, - user_id: StrictStr, - user_service_register_passkey_request: UserServiceRegisterPasskeyRequest, - _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, - ) -> UserServiceRegisterPasskeyResponse: - """Start the registration of passkey for a user - - Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. - - :param user_id: (required) - :type user_id: str - :param user_service_register_passkey_request: (required) - :type user_service_register_passkey_request: UserServiceRegisterPasskeyRequest - :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._user_service_register_passkey_serialize( - user_id=user_id, - user_service_register_passkey_request=user_service_register_passkey_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterPasskeyResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_register_passkey_with_http_info( - self, - user_id: StrictStr, - user_service_register_passkey_request: UserServiceRegisterPasskeyRequest, - _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[UserServiceRegisterPasskeyResponse]: - """Start the registration of passkey for a user - - Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. - - :param user_id: (required) - :type user_id: str - :param user_service_register_passkey_request: (required) - :type user_service_register_passkey_request: UserServiceRegisterPasskeyRequest - :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._user_service_register_passkey_serialize( - user_id=user_id, - user_service_register_passkey_request=user_service_register_passkey_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterPasskeyResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_register_passkey_without_preload_content( - self, - user_id: StrictStr, - user_service_register_passkey_request: UserServiceRegisterPasskeyRequest, - _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: - """Start the registration of passkey for a user - - Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. - - :param user_id: (required) - :type user_id: str - :param user_service_register_passkey_request: (required) - :type user_service_register_passkey_request: UserServiceRegisterPasskeyRequest - :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._user_service_register_passkey_serialize( - user_id=user_id, - user_service_register_passkey_request=user_service_register_passkey_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterPasskeyResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_register_passkey_serialize( - self, - user_id, - user_service_register_passkey_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_register_passkey_request is not None: - _body_params = user_service_register_passkey_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/passkeys', - 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 user_service_register_totp( - self, - user_id: StrictStr, - _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, - ) -> UserServiceRegisterTOTPResponse: - """Start the registration of a TOTP generator for a user - - Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. - - :param user_id: (required) - :type user_id: str - :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._user_service_register_totp_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterTOTPResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_register_totp_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceRegisterTOTPResponse]: - """Start the registration of a TOTP generator for a user - - Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. - - :param user_id: (required) - :type user_id: str - :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._user_service_register_totp_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterTOTPResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_register_totp_without_preload_content( - self, - user_id: StrictStr, - _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: - """Start the registration of a TOTP generator for a user - - Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. - - :param user_id: (required) - :type user_id: str - :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._user_service_register_totp_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterTOTPResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_register_totp_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/totp', - 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 user_service_register_u2_f( - self, - user_id: StrictStr, - user_service_register_u2_f_request: UserServiceRegisterU2FRequest, - _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, - ) -> UserServiceRegisterU2FResponse: - """Start the registration of a u2f token for a user - - Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. - - :param user_id: (required) - :type user_id: str - :param user_service_register_u2_f_request: (required) - :type user_service_register_u2_f_request: UserServiceRegisterU2FRequest - :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._user_service_register_u2_f_serialize( - user_id=user_id, - user_service_register_u2_f_request=user_service_register_u2_f_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterU2FResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_register_u2_f_with_http_info( - self, - user_id: StrictStr, - user_service_register_u2_f_request: UserServiceRegisterU2FRequest, - _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[UserServiceRegisterU2FResponse]: - """Start the registration of a u2f token for a user - - Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. - - :param user_id: (required) - :type user_id: str - :param user_service_register_u2_f_request: (required) - :type user_service_register_u2_f_request: UserServiceRegisterU2FRequest - :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._user_service_register_u2_f_serialize( - user_id=user_id, - user_service_register_u2_f_request=user_service_register_u2_f_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterU2FResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_register_u2_f_without_preload_content( - self, - user_id: StrictStr, - user_service_register_u2_f_request: UserServiceRegisterU2FRequest, - _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: - """Start the registration of a u2f token for a user - - Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. - - :param user_id: (required) - :type user_id: str - :param user_service_register_u2_f_request: (required) - :type user_service_register_u2_f_request: UserServiceRegisterU2FRequest - :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._user_service_register_u2_f_serialize( - user_id=user_id, - user_service_register_u2_f_request=user_service_register_u2_f_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterU2FResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_register_u2_f_serialize( - self, - user_id, - user_service_register_u2_f_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_register_u2_f_request is not None: - _body_params = user_service_register_u2_f_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/u2f', - 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 user_service_remove_idp_link( - self, - user_id: StrictStr, - idp_id: StrictStr, - linked_user_id: StrictStr, - _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, - ) -> UserServiceRemoveIDPLinkResponse: - """Remove link of an identity provider to an user - - Remove link of an identity provider to an user. - - :param user_id: (required) - :type user_id: str - :param idp_id: (required) - :type idp_id: str - :param linked_user_id: (required) - :type linked_user_id: str - :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._user_service_remove_idp_link_serialize( - user_id=user_id, - idp_id=idp_id, - linked_user_id=linked_user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveIDPLinkResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_idp_link_with_http_info( - self, - user_id: StrictStr, - idp_id: StrictStr, - linked_user_id: StrictStr, - _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[UserServiceRemoveIDPLinkResponse]: - """Remove link of an identity provider to an user - - Remove link of an identity provider to an user. - - :param user_id: (required) - :type user_id: str - :param idp_id: (required) - :type idp_id: str - :param linked_user_id: (required) - :type linked_user_id: str - :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._user_service_remove_idp_link_serialize( - user_id=user_id, - idp_id=idp_id, - linked_user_id=linked_user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveIDPLinkResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_idp_link_without_preload_content( - self, - user_id: StrictStr, - idp_id: StrictStr, - linked_user_id: StrictStr, - _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: - """Remove link of an identity provider to an user - - Remove link of an identity provider to an user. - - :param user_id: (required) - :type user_id: str - :param idp_id: (required) - :type idp_id: str - :param linked_user_id: (required) - :type linked_user_id: str - :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._user_service_remove_idp_link_serialize( - user_id=user_id, - idp_id=idp_id, - linked_user_id=linked_user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveIDPLinkResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_remove_idp_link_serialize( - self, - user_id, - idp_id, - linked_user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - if idp_id is not None: - _path_params['idpId'] = idp_id - if linked_user_id is not None: - _path_params['linkedUserId'] = linked_user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/users/{userId}/links/{idpId}/{linkedUserId}', - 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 user_service_remove_otp_email( - self, - user_id: StrictStr, - _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, - ) -> UserServiceRemoveOTPEmailResponse: - """Remove One-Time Password (OTP) Email from a user - - Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_otp_email_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveOTPEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_otp_email_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceRemoveOTPEmailResponse]: - """Remove One-Time Password (OTP) Email from a user - - Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_otp_email_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveOTPEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_otp_email_without_preload_content( - self, - user_id: StrictStr, - _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: - """Remove One-Time Password (OTP) Email from a user - - Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_otp_email_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveOTPEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_remove_otp_email_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/users/{userId}/otp_email', - 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 user_service_remove_otpsms( - self, - user_id: StrictStr, - _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, - ) -> UserServiceRemoveOTPSMSResponse: - """Remove One-Time Password (OTP) SMS from a user - - Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_otpsms_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveOTPSMSResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_otpsms_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceRemoveOTPSMSResponse]: - """Remove One-Time Password (OTP) SMS from a user - - Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_otpsms_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveOTPSMSResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_otpsms_without_preload_content( - self, - user_id: StrictStr, - _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: - """Remove One-Time Password (OTP) SMS from a user - - Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_otpsms_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveOTPSMSResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_remove_otpsms_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/users/{userId}/otp_sms', - 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 user_service_remove_passkey( - self, - user_id: StrictStr, - passkey_id: StrictStr, - _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, - ) -> UserServiceRemovePasskeyResponse: - """Remove passkey from a user - - Remove passkey from a user. - - :param user_id: (required) - :type user_id: str - :param passkey_id: (required) - :type passkey_id: str - :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._user_service_remove_passkey_serialize( - user_id=user_id, - passkey_id=passkey_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePasskeyResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_passkey_with_http_info( - self, - user_id: StrictStr, - passkey_id: StrictStr, - _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[UserServiceRemovePasskeyResponse]: - """Remove passkey from a user - - Remove passkey from a user. - - :param user_id: (required) - :type user_id: str - :param passkey_id: (required) - :type passkey_id: str - :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._user_service_remove_passkey_serialize( - user_id=user_id, - passkey_id=passkey_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePasskeyResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_passkey_without_preload_content( - self, - user_id: StrictStr, - passkey_id: StrictStr, - _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: - """Remove passkey from a user - - Remove passkey from a user. - - :param user_id: (required) - :type user_id: str - :param passkey_id: (required) - :type passkey_id: str - :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._user_service_remove_passkey_serialize( - user_id=user_id, - passkey_id=passkey_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePasskeyResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_remove_passkey_serialize( - self, - user_id, - passkey_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - if passkey_id is not None: - _path_params['passkeyId'] = passkey_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/users/{userId}/passkeys/{passkeyId}', - 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 user_service_remove_phone( - self, - user_id: StrictStr, - _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, - ) -> UserServiceRemovePhoneResponse: - """Delete the user phone - - Delete the phone number of a user. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_phone_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePhoneResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_phone_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceRemovePhoneResponse]: - """Delete the user phone - - Delete the phone number of a user. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_phone_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePhoneResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_phone_without_preload_content( - self, - user_id: StrictStr, - _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: - """Delete the user phone - - Delete the phone number of a user. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_phone_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePhoneResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_remove_phone_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/users/{userId}/phone', - 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 user_service_remove_totp( - self, - user_id: StrictStr, - _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, - ) -> UserServiceRemoveTOTPResponse: - """Remove TOTP generator from a user - - Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_totp_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveTOTPResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_totp_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceRemoveTOTPResponse]: - """Remove TOTP generator from a user - - Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_totp_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveTOTPResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_totp_without_preload_content( - self, - user_id: StrictStr, - _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: - """Remove TOTP generator from a user - - Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. - - :param user_id: (required) - :type user_id: str - :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._user_service_remove_totp_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveTOTPResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_remove_totp_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/users/{userId}/totp', - 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 user_service_remove_u2_f( - self, - user_id: StrictStr, - u2f_id: StrictStr, - _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, - ) -> UserServiceRemoveU2FResponse: - """Remove u2f token from a user - - Remove u2f token from a user - - :param user_id: (required) - :type user_id: str - :param u2f_id: (required) - :type u2f_id: str - :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._user_service_remove_u2_f_serialize( - user_id=user_id, - u2f_id=u2f_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveU2FResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_u2_f_with_http_info( - self, - user_id: StrictStr, - u2f_id: StrictStr, - _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[UserServiceRemoveU2FResponse]: - """Remove u2f token from a user - - Remove u2f token from a user - - :param user_id: (required) - :type user_id: str - :param u2f_id: (required) - :type u2f_id: str - :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._user_service_remove_u2_f_serialize( - user_id=user_id, - u2f_id=u2f_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveU2FResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_remove_u2_f_without_preload_content( - self, - user_id: StrictStr, - u2f_id: StrictStr, - _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: - """Remove u2f token from a user - - Remove u2f token from a user - - :param user_id: (required) - :type user_id: str - :param u2f_id: (required) - :type u2f_id: str - :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._user_service_remove_u2_f_serialize( - user_id=user_id, - u2f_id=u2f_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveU2FResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_remove_u2_f_serialize( - self, - user_id, - u2f_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - if u2f_id is not None: - _path_params['u2fId'] = u2f_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/users/{userId}/u2f/{u2fId}', - 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 user_service_resend_email_code( - self, - user_id: StrictStr, - user_service_resend_email_code_request: UserServiceResendEmailCodeRequest, - _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, - ) -> UserServiceResendEmailCodeResponse: - """Resend code to verify user email - - Resend code to verify user email. - - :param user_id: (required) - :type user_id: str - :param user_service_resend_email_code_request: (required) - :type user_service_resend_email_code_request: UserServiceResendEmailCodeRequest - :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._user_service_resend_email_code_serialize( - user_id=user_id, - user_service_resend_email_code_request=user_service_resend_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendEmailCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_resend_email_code_with_http_info( - self, - user_id: StrictStr, - user_service_resend_email_code_request: UserServiceResendEmailCodeRequest, - _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[UserServiceResendEmailCodeResponse]: - """Resend code to verify user email - - Resend code to verify user email. - - :param user_id: (required) - :type user_id: str - :param user_service_resend_email_code_request: (required) - :type user_service_resend_email_code_request: UserServiceResendEmailCodeRequest - :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._user_service_resend_email_code_serialize( - user_id=user_id, - user_service_resend_email_code_request=user_service_resend_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendEmailCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_resend_email_code_without_preload_content( - self, - user_id: StrictStr, - user_service_resend_email_code_request: UserServiceResendEmailCodeRequest, - _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: - """Resend code to verify user email - - Resend code to verify user email. - - :param user_id: (required) - :type user_id: str - :param user_service_resend_email_code_request: (required) - :type user_service_resend_email_code_request: UserServiceResendEmailCodeRequest - :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._user_service_resend_email_code_serialize( - user_id=user_id, - user_service_resend_email_code_request=user_service_resend_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendEmailCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_resend_email_code_serialize( - self, - user_id, - user_service_resend_email_code_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_resend_email_code_request is not None: - _body_params = user_service_resend_email_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/email/resend', - 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 user_service_resend_invite_code( - self, - user_id: StrictStr, - _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, - ) -> UserServiceResendInviteCodeResponse: - """Resend an invite code for a user - - Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. - - :param user_id: (required) - :type user_id: str - :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._user_service_resend_invite_code_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendInviteCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_resend_invite_code_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceResendInviteCodeResponse]: - """Resend an invite code for a user - - Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. - - :param user_id: (required) - :type user_id: str - :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._user_service_resend_invite_code_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendInviteCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_resend_invite_code_without_preload_content( - self, - user_id: StrictStr, - _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: - """Resend an invite code for a user - - Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. - - :param user_id: (required) - :type user_id: str - :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._user_service_resend_invite_code_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendInviteCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_resend_invite_code_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/invite_code/resend', - 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 user_service_resend_phone_code( - self, - user_id: StrictStr, - user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest, - _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, - ) -> UserServiceResendPhoneCodeResponse: - """Resend code to verify user phone - - Resend code to verify user phone. - - :param user_id: (required) - :type user_id: str - :param user_service_resend_phone_code_request: (required) - :type user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest - :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._user_service_resend_phone_code_serialize( - user_id=user_id, - user_service_resend_phone_code_request=user_service_resend_phone_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendPhoneCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_resend_phone_code_with_http_info( - self, - user_id: StrictStr, - user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest, - _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[UserServiceResendPhoneCodeResponse]: - """Resend code to verify user phone - - Resend code to verify user phone. - - :param user_id: (required) - :type user_id: str - :param user_service_resend_phone_code_request: (required) - :type user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest - :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._user_service_resend_phone_code_serialize( - user_id=user_id, - user_service_resend_phone_code_request=user_service_resend_phone_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendPhoneCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_resend_phone_code_without_preload_content( - self, - user_id: StrictStr, - user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest, - _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: - """Resend code to verify user phone - - Resend code to verify user phone. - - :param user_id: (required) - :type user_id: str - :param user_service_resend_phone_code_request: (required) - :type user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest - :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._user_service_resend_phone_code_serialize( - user_id=user_id, - user_service_resend_phone_code_request=user_service_resend_phone_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendPhoneCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_resend_phone_code_serialize( - self, - user_id, - user_service_resend_phone_code_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_resend_phone_code_request is not None: - _body_params = user_service_resend_phone_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/phone/resend', - 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 user_service_retrieve_identity_provider_intent( - self, - idp_intent_id: Annotated[StrictStr, Field(description="ID of the idp intent, previously returned on the success response of the IDP callback")], - user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest, - _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, - ) -> UserServiceRetrieveIdentityProviderIntentResponse: - """Retrieve the information returned by the identity provider - - Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. - - :param idp_intent_id: ID of the idp intent, previously returned on the success response of the IDP callback (required) - :type idp_intent_id: str - :param user_service_retrieve_identity_provider_intent_request: (required) - :type user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest - :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._user_service_retrieve_identity_provider_intent_serialize( - idp_intent_id=idp_intent_id, - user_service_retrieve_identity_provider_intent_request=user_service_retrieve_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRetrieveIdentityProviderIntentResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_retrieve_identity_provider_intent_with_http_info( - self, - idp_intent_id: Annotated[StrictStr, Field(description="ID of the idp intent, previously returned on the success response of the IDP callback")], - user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest, - _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[UserServiceRetrieveIdentityProviderIntentResponse]: - """Retrieve the information returned by the identity provider - - Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. - - :param idp_intent_id: ID of the idp intent, previously returned on the success response of the IDP callback (required) - :type idp_intent_id: str - :param user_service_retrieve_identity_provider_intent_request: (required) - :type user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest - :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._user_service_retrieve_identity_provider_intent_serialize( - idp_intent_id=idp_intent_id, - user_service_retrieve_identity_provider_intent_request=user_service_retrieve_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRetrieveIdentityProviderIntentResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_retrieve_identity_provider_intent_without_preload_content( - self, - idp_intent_id: Annotated[StrictStr, Field(description="ID of the idp intent, previously returned on the success response of the IDP callback")], - user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest, - _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: - """Retrieve the information returned by the identity provider - - Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. - - :param idp_intent_id: ID of the idp intent, previously returned on the success response of the IDP callback (required) - :type idp_intent_id: str - :param user_service_retrieve_identity_provider_intent_request: (required) - :type user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest - :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._user_service_retrieve_identity_provider_intent_serialize( - idp_intent_id=idp_intent_id, - user_service_retrieve_identity_provider_intent_request=user_service_retrieve_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRetrieveIdentityProviderIntentResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_retrieve_identity_provider_intent_serialize( - self, - idp_intent_id, - user_service_retrieve_identity_provider_intent_request, - _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 - if idp_intent_id is not None: - _path_params['idpIntentId'] = idp_intent_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_retrieve_identity_provider_intent_request is not None: - _body_params = user_service_retrieve_identity_provider_intent_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/idp_intents/{idpIntentId}', - 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 user_service_send_email_code( - self, - user_id: StrictStr, - user_service_send_email_code_request: UserServiceSendEmailCodeRequest, - _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, - ) -> UserServiceSendEmailCodeResponse: - """Send code to verify user email - - Send code to verify user email. - - :param user_id: (required) - :type user_id: str - :param user_service_send_email_code_request: (required) - :type user_service_send_email_code_request: UserServiceSendEmailCodeRequest - :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._user_service_send_email_code_serialize( - user_id=user_id, - user_service_send_email_code_request=user_service_send_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSendEmailCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_send_email_code_with_http_info( - self, - user_id: StrictStr, - user_service_send_email_code_request: UserServiceSendEmailCodeRequest, - _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[UserServiceSendEmailCodeResponse]: - """Send code to verify user email - - Send code to verify user email. - - :param user_id: (required) - :type user_id: str - :param user_service_send_email_code_request: (required) - :type user_service_send_email_code_request: UserServiceSendEmailCodeRequest - :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._user_service_send_email_code_serialize( - user_id=user_id, - user_service_send_email_code_request=user_service_send_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSendEmailCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_send_email_code_without_preload_content( - self, - user_id: StrictStr, - user_service_send_email_code_request: UserServiceSendEmailCodeRequest, - _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: - """Send code to verify user email - - Send code to verify user email. - - :param user_id: (required) - :type user_id: str - :param user_service_send_email_code_request: (required) - :type user_service_send_email_code_request: UserServiceSendEmailCodeRequest - :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._user_service_send_email_code_serialize( - user_id=user_id, - user_service_send_email_code_request=user_service_send_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSendEmailCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_send_email_code_serialize( - self, - user_id, - user_service_send_email_code_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_send_email_code_request is not None: - _body_params = user_service_send_email_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/email/send', - 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 user_service_set_email( - self, - user_id: StrictStr, - user_service_set_email_request: UserServiceSetEmailRequest, - _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, - ) -> UserServiceSetEmailResponse: - """Change the user email - - Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_email_request: (required) - :type user_service_set_email_request: UserServiceSetEmailRequest - :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._user_service_set_email_serialize( - user_id=user_id, - user_service_set_email_request=user_service_set_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_set_email_with_http_info( - self, - user_id: StrictStr, - user_service_set_email_request: UserServiceSetEmailRequest, - _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[UserServiceSetEmailResponse]: - """Change the user email - - Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_email_request: (required) - :type user_service_set_email_request: UserServiceSetEmailRequest - :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._user_service_set_email_serialize( - user_id=user_id, - user_service_set_email_request=user_service_set_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_set_email_without_preload_content( - self, - user_id: StrictStr, - user_service_set_email_request: UserServiceSetEmailRequest, - _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: - """Change the user email - - Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_email_request: (required) - :type user_service_set_email_request: UserServiceSetEmailRequest - :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._user_service_set_email_serialize( - user_id=user_id, - user_service_set_email_request=user_service_set_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_set_email_serialize( - self, - user_id, - user_service_set_email_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_set_email_request is not None: - _body_params = user_service_set_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/email', - 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 user_service_set_password( - self, - user_id: StrictStr, - user_service_set_password_request: UserServiceSetPasswordRequest, - _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, - ) -> UserServiceSetPasswordResponse: - """Change password - - Change the password of a user with either a verification code or the current password.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_password_request: (required) - :type user_service_set_password_request: UserServiceSetPasswordRequest - :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._user_service_set_password_serialize( - user_id=user_id, - user_service_set_password_request=user_service_set_password_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetPasswordResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_set_password_with_http_info( - self, - user_id: StrictStr, - user_service_set_password_request: UserServiceSetPasswordRequest, - _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[UserServiceSetPasswordResponse]: - """Change password - - Change the password of a user with either a verification code or the current password.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_password_request: (required) - :type user_service_set_password_request: UserServiceSetPasswordRequest - :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._user_service_set_password_serialize( - user_id=user_id, - user_service_set_password_request=user_service_set_password_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetPasswordResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_set_password_without_preload_content( - self, - user_id: StrictStr, - user_service_set_password_request: UserServiceSetPasswordRequest, - _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: - """Change password - - Change the password of a user with either a verification code or the current password.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_password_request: (required) - :type user_service_set_password_request: UserServiceSetPasswordRequest - :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._user_service_set_password_serialize( - user_id=user_id, - user_service_set_password_request=user_service_set_password_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetPasswordResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_set_password_serialize( - self, - user_id, - user_service_set_password_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_set_password_request is not None: - _body_params = user_service_set_password_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/password', - 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 user_service_set_phone( - self, - user_id: StrictStr, - user_service_set_phone_request: UserServiceSetPhoneRequest, - _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, - ) -> UserServiceSetPhoneResponse: - """Set the user phone - - Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_phone_request: (required) - :type user_service_set_phone_request: UserServiceSetPhoneRequest - :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._user_service_set_phone_serialize( - user_id=user_id, - user_service_set_phone_request=user_service_set_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetPhoneResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_set_phone_with_http_info( - self, - user_id: StrictStr, - user_service_set_phone_request: UserServiceSetPhoneRequest, - _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[UserServiceSetPhoneResponse]: - """Set the user phone - - Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_phone_request: (required) - :type user_service_set_phone_request: UserServiceSetPhoneRequest - :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._user_service_set_phone_serialize( - user_id=user_id, - user_service_set_phone_request=user_service_set_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetPhoneResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_set_phone_without_preload_content( - self, - user_id: StrictStr, - user_service_set_phone_request: UserServiceSetPhoneRequest, - _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: - """Set the user phone - - Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. - - :param user_id: (required) - :type user_id: str - :param user_service_set_phone_request: (required) - :type user_service_set_phone_request: UserServiceSetPhoneRequest - :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._user_service_set_phone_serialize( - user_id=user_id, - user_service_set_phone_request=user_service_set_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetPhoneResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_set_phone_serialize( - self, - user_id, - user_service_set_phone_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_set_phone_request is not None: - _body_params = user_service_set_phone_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/phone', - 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 user_service_start_identity_provider_intent( - self, - user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest, - _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, - ) -> UserServiceStartIdentityProviderIntentResponse: - """Start flow with an identity provider - - Start a flow with an identity provider, for external login, registration or linking.. - - :param user_service_start_identity_provider_intent_request: (required) - :type user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest - :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._user_service_start_identity_provider_intent_serialize( - user_service_start_identity_provider_intent_request=user_service_start_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceStartIdentityProviderIntentResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_start_identity_provider_intent_with_http_info( - self, - user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest, - _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[UserServiceStartIdentityProviderIntentResponse]: - """Start flow with an identity provider - - Start a flow with an identity provider, for external login, registration or linking.. - - :param user_service_start_identity_provider_intent_request: (required) - :type user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest - :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._user_service_start_identity_provider_intent_serialize( - user_service_start_identity_provider_intent_request=user_service_start_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceStartIdentityProviderIntentResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_start_identity_provider_intent_without_preload_content( - self, - user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest, - _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: - """Start flow with an identity provider - - Start a flow with an identity provider, for external login, registration or linking.. - - :param user_service_start_identity_provider_intent_request: (required) - :type user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest - :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._user_service_start_identity_provider_intent_serialize( - user_service_start_identity_provider_intent_request=user_service_start_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceStartIdentityProviderIntentResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_start_identity_provider_intent_serialize( - self, - user_service_start_identity_provider_intent_request, - _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 user_service_start_identity_provider_intent_request is not None: - _body_params = user_service_start_identity_provider_intent_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/idp_intents', - 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 user_service_unlock_user( - self, - user_id: StrictStr, - _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, - ) -> UserServiceUnlockUserResponse: - """Unlock user - - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - - :param user_id: (required) - :type user_id: str - :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._user_service_unlock_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUnlockUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_unlock_user_with_http_info( - self, - user_id: StrictStr, - _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[UserServiceUnlockUserResponse]: - """Unlock user - - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - - :param user_id: (required) - :type user_id: str - :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._user_service_unlock_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUnlockUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_unlock_user_without_preload_content( - self, - user_id: StrictStr, - _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: - """Unlock user - - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - - :param user_id: (required) - :type user_id: str - :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._user_service_unlock_user_serialize( - user_id=user_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUnlockUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_unlock_user_serialize( - self, - user_id, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # 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' - ] - ) - - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/unlock', - 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 user_service_update_human_user( - self, - user_id: StrictStr, - user_service_update_human_user_request: UserServiceUpdateHumanUserRequest, - _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, - ) -> UserServiceUpdateHumanUserResponse: - """Update User - - Update all information from a user.. - - :param user_id: (required) - :type user_id: str - :param user_service_update_human_user_request: (required) - :type user_service_update_human_user_request: UserServiceUpdateHumanUserRequest - :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._user_service_update_human_user_serialize( - user_id=user_id, - user_service_update_human_user_request=user_service_update_human_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUpdateHumanUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_update_human_user_with_http_info( - self, - user_id: StrictStr, - user_service_update_human_user_request: UserServiceUpdateHumanUserRequest, - _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[UserServiceUpdateHumanUserResponse]: - """Update User - - Update all information from a user.. - - :param user_id: (required) - :type user_id: str - :param user_service_update_human_user_request: (required) - :type user_service_update_human_user_request: UserServiceUpdateHumanUserRequest - :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._user_service_update_human_user_serialize( - user_id=user_id, - user_service_update_human_user_request=user_service_update_human_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUpdateHumanUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_update_human_user_without_preload_content( - self, - user_id: StrictStr, - user_service_update_human_user_request: UserServiceUpdateHumanUserRequest, - _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: - """Update User - - Update all information from a user.. - - :param user_id: (required) - :type user_id: str - :param user_service_update_human_user_request: (required) - :type user_service_update_human_user_request: UserServiceUpdateHumanUserRequest - :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._user_service_update_human_user_serialize( - user_id=user_id, - user_service_update_human_user_request=user_service_update_human_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUpdateHumanUserResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _user_service_update_human_user_serialize( - self, - user_id, - user_service_update_human_user_request, - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_update_human_user_request is not None: - _body_params = user_service_update_human_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/users/human/{userId}', - 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 user_service_verify_email( - self, - user_id: StrictStr, - user_service_verify_email_request: UserServiceVerifyEmailRequest, - _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, - ) -> UserServiceVerifyEmailResponse: - """Verify the email - - Verify the email with the generated code. - - :param user_id: (required) - :type user_id: str - :param user_service_verify_email_request: (required) - :type user_service_verify_email_request: UserServiceVerifyEmailRequest - :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._user_service_verify_email_serialize( - user_id=user_id, - user_service_verify_email_request=user_service_verify_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_verify_email_with_http_info( - self, - user_id: StrictStr, - user_service_verify_email_request: UserServiceVerifyEmailRequest, - _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[UserServiceVerifyEmailResponse]: - """Verify the email - - Verify the email with the generated code. - - :param user_id: (required) - :type user_id: str - :param user_service_verify_email_request: (required) - :type user_service_verify_email_request: UserServiceVerifyEmailRequest - :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._user_service_verify_email_serialize( - user_id=user_id, - user_service_verify_email_request=user_service_verify_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_verify_email_without_preload_content( - self, - user_id: StrictStr, - user_service_verify_email_request: UserServiceVerifyEmailRequest, - _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: - """Verify the email - - Verify the email with the generated code. - - :param user_id: (required) - :type user_id: str - :param user_service_verify_email_request: (required) - :type user_service_verify_email_request: UserServiceVerifyEmailRequest - :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._user_service_verify_email_serialize( - user_id=user_id, - user_service_verify_email_request=user_service_verify_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + 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 - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyEmailResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - def _user_service_verify_email_serialize( - self, - user_id, - user_service_verify_email_request, - _request_auth, - _content_type, - _headers, - _host_index, + def __user_service_send_email_code_serialize( + self, + user_id, + user_service_send_email_code_request, + _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_email_request is not None: - _body_params = user_service_verify_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/email/verify', - 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 user_service_verify_invite_code( - self, - user_id: StrictStr, - user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest, - _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, - ) -> UserServiceVerifyInviteCodeResponse: - """Verify an invite code for a user - - Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. - - :param user_id: (required) - :type user_id: str - :param user_service_verify_invite_code_request: (required) - :type user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest - :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 + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_send_email_code_request is not None: + _body_params = user_service_send_email_code_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/email/send', + 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 + ) - _param = self._user_service_verify_invite_code_serialize( - user_id=user_id, - user_service_verify_invite_code_request=user_service_verify_invite_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyInviteCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_verify_invite_code_with_http_info( + def user_service_set_email( self, user_id: StrictStr, - user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest, + user_service_set_email_request: UserServiceSetEmailRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11637,15 +4858,15 @@ def user_service_verify_invite_code_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[UserServiceVerifyInviteCodeResponse]: - """Verify an invite code for a user + ) -> UserServiceSetEmailResponse: + """Change the user email - Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. + Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. :param user_id: (required) :type user_id: str - :param user_service_verify_invite_code_request: (required) - :type user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest + :param user_service_set_email_request: (required) + :type user_service_set_email_request: UserServiceSetEmailRequest :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 @@ -11668,9 +4889,9 @@ def user_service_verify_invite_code_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_invite_code_serialize( + _param = self.__user_service_set_email_serialize( user_id=user_id, - user_service_verify_invite_code_request=user_service_verify_invite_code_request, + user_service_set_email_request=user_service_set_email_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11678,253 +4899,107 @@ def user_service_verify_invite_code_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyInviteCodeResponse", + '200': "UserServiceSetEmailResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 user_service_verify_invite_code_without_preload_content( - self, - user_id: StrictStr, - user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest, - _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: - """Verify an invite code for a user + 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 - Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. - - :param user_id: (required) - :type user_id: str - :param user_service_verify_invite_code_request: (required) - :type user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest - :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._user_service_verify_invite_code_serialize( - user_id=user_id, - user_service_verify_invite_code_request=user_service_verify_invite_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyInviteCodeResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - def _user_service_verify_invite_code_serialize( - self, - user_id, - user_service_verify_invite_code_request, - _request_auth, - _content_type, - _headers, - _host_index, + def __user_service_set_email_serialize( + self, + user_id, + user_service_set_email_request, + _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_invite_code_request is not None: - _body_params = user_service_verify_invite_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/invite_code/verify', - 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 user_service_verify_passkey_registration( - self, - user_id: StrictStr, - passkey_id: StrictStr, - user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest, - _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, - ) -> UserServiceVerifyPasskeyRegistrationResponse: - """Verify a passkey for a user - - Verify the passkey registration with the public key credential.. - - :param user_id: (required) - :type user_id: str - :param passkey_id: (required) - :type passkey_id: str - :param user_service_verify_passkey_registration_request: (required) - :type user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest - :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 + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_set_email_request is not None: + _body_params = user_service_set_email_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/email', + 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 + ) - _param = self._user_service_verify_passkey_registration_serialize( - user_id=user_id, - passkey_id=passkey_id, - user_service_verify_passkey_registration_request=user_service_verify_passkey_registration_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyPasskeyRegistrationResponse", - '403': "UserServiceRpcStatus", - '404': "UserServiceRpcStatus", - } - 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 user_service_verify_passkey_registration_with_http_info( + def user_service_set_password( self, user_id: StrictStr, - passkey_id: StrictStr, - user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest, + user_service_set_password_request: UserServiceSetPasswordRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11937,17 +5012,15 @@ def user_service_verify_passkey_registration_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[UserServiceVerifyPasskeyRegistrationResponse]: - """Verify a passkey for a user - - Verify the passkey registration with the public key credential.. + ) -> UserServiceSetPasswordResponse: + """Change password - :param user_id: (required) - :type user_id: str - :param passkey_id: (required) - :type passkey_id: str - :param user_service_verify_passkey_registration_request: (required) - :type user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest + Change the password of a user with either a verification code or the current password.. + + :param user_id: (required) + :type user_id: str + :param user_service_set_password_request: (required) + :type user_service_set_password_request: UserServiceSetPasswordRequest :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 @@ -11970,10 +5043,9 @@ def user_service_verify_passkey_registration_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_passkey_registration_serialize( + _param = self.__user_service_set_password_serialize( user_id=user_id, - passkey_id=passkey_id, - user_service_verify_passkey_registration_request=user_service_verify_passkey_registration_request, + user_service_set_password_request=user_service_set_password_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11981,27 +5053,107 @@ def user_service_verify_passkey_registration_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyPasskeyRegistrationResponse", + '200': "UserServiceSetPasswordResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_set_password_serialize( + self, + user_id, + user_service_set_password_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_set_password_request is not None: + _body_params = user_service_set_password_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/password', + 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 user_service_verify_passkey_registration_without_preload_content( + def user_service_set_phone( self, user_id: StrictStr, - passkey_id: StrictStr, - user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest, + user_service_set_phone_request: UserServiceSetPhoneRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12014,17 +5166,15 @@ def user_service_verify_passkey_registration_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Verify a passkey for a user + ) -> UserServiceSetPhoneResponse: + """Set the user phone - Verify the passkey registration with the public key credential.. + Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. :param user_id: (required) :type user_id: str - :param passkey_id: (required) - :type passkey_id: str - :param user_service_verify_passkey_registration_request: (required) - :type user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest + :param user_service_set_phone_request: (required) + :type user_service_set_phone_request: UserServiceSetPhoneRequest :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 @@ -12047,10 +5197,9 @@ def user_service_verify_passkey_registration_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_passkey_registration_serialize( + _param = self.__user_service_set_phone_serialize( user_id=user_id, - passkey_id=passkey_id, - user_service_verify_passkey_registration_request=user_service_verify_passkey_registration_request, + user_service_set_phone_request=user_service_set_phone_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12058,105 +5207,106 @@ def user_service_verify_passkey_registration_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyPasskeyRegistrationResponse", + '200': "UserServiceSetPhoneResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_verify_passkey_registration_serialize( - self, - user_id, - passkey_id, - user_service_verify_passkey_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = { - } + def __user_service_set_phone_serialize( + self, + user_id, + user_service_set_phone_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - _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 - if user_id is not None: - _path_params['userId'] = user_id - if passkey_id is not None: - _path_params['passkeyId'] = passkey_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_passkey_registration_request is not None: - _body_params = user_service_verify_passkey_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/passkeys/{passkeyId}', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_set_phone_request is not None: + _body_params = user_service_set_phone_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/phone', + 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 user_service_verify_phone( + def user_service_start_identity_provider_intent( self, - user_id: StrictStr, - user_service_verify_phone_request: UserServiceVerifyPhoneRequest, + user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12169,15 +5319,13 @@ def user_service_verify_phone( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceVerifyPhoneResponse: - """Verify the phone + ) -> UserServiceStartIdentityProviderIntentResponse: + """Start flow with an identity provider - Verify the phone with the generated code.. + Start a flow with an identity provider, for external login, registration or linking.. - :param user_id: (required) - :type user_id: str - :param user_service_verify_phone_request: (required) - :type user_service_verify_phone_request: UserServiceVerifyPhoneRequest + :param user_service_start_identity_provider_intent_request: (required) + :type user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest :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 @@ -12200,9 +5348,8 @@ def user_service_verify_phone( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_phone_serialize( - user_id=user_id, - user_service_verify_phone_request=user_service_verify_phone_request, + _param = self.__user_service_start_identity_provider_intent_serialize( + user_service_start_identity_provider_intent_request=user_service_start_identity_provider_intent_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12210,26 +5357,103 @@ def user_service_verify_phone( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyPhoneResponse", + '200': "UserServiceStartIdentityProviderIntentResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_start_identity_provider_intent_serialize( + self, + user_service_start_identity_provider_intent_request, + _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 user_service_start_identity_provider_intent_request is not None: + _body_params = user_service_start_identity_provider_intent_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/idp_intents', + 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 user_service_verify_phone_with_http_info( + def user_service_unlock_user( self, user_id: StrictStr, - user_service_verify_phone_request: UserServiceVerifyPhoneRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12242,15 +5466,13 @@ def user_service_verify_phone_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[UserServiceVerifyPhoneResponse]: - """Verify the phone + ) -> UserServiceUnlockUserResponse: + """Unlock user - Verify the phone with the generated code.. + The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. :param user_id: (required) :type user_id: str - :param user_service_verify_phone_request: (required) - :type user_service_verify_phone_request: UserServiceVerifyPhoneRequest :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 @@ -12273,9 +5495,8 @@ def user_service_verify_phone_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_phone_serialize( + _param = self.__user_service_unlock_user_serialize( user_id=user_id, - user_service_verify_phone_request=user_service_verify_phone_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12283,26 +5504,91 @@ def user_service_verify_phone_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyPhoneResponse", + '200': "UserServiceUnlockUserResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_unlock_user_serialize( + self, + user_id, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/unlock', + 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 user_service_verify_phone_without_preload_content( + def user_service_update_human_user( self, user_id: StrictStr, - user_service_verify_phone_request: UserServiceVerifyPhoneRequest, + user_service_update_human_user_request: UserServiceUpdateHumanUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12315,15 +5601,15 @@ def user_service_verify_phone_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Verify the phone + ) -> UserServiceUpdateHumanUserResponse: + """Update User - Verify the phone with the generated code.. + Update all information from a user.. :param user_id: (required) :type user_id: str - :param user_service_verify_phone_request: (required) - :type user_service_verify_phone_request: UserServiceVerifyPhoneRequest + :param user_service_update_human_user_request: (required) + :type user_service_update_human_user_request: UserServiceUpdateHumanUserRequest :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 @@ -12346,9 +5632,9 @@ def user_service_verify_phone_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_phone_serialize( + _param = self.__user_service_update_human_user_serialize( user_id=user_id, - user_service_verify_phone_request=user_service_verify_phone_request, + user_service_update_human_user_request=user_service_update_human_user_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12356,102 +5642,107 @@ def user_service_verify_phone_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyPhoneResponse", + '200': "UserServiceUpdateHumanUserResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_verify_phone_serialize( - self, - user_id, - user_service_verify_phone_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = { - } + def __user_service_update_human_user_serialize( + self, + user_id, + user_service_update_human_user_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_phone_request is not None: - _body_params = user_service_verify_phone_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/phone/verify', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_update_human_user_request is not None: + _body_params = user_service_update_human_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v2/users/human/{userId}', + 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 user_service_verify_totp_registration( + def user_service_verify_email( self, user_id: StrictStr, - user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest, + user_service_verify_email_request: UserServiceVerifyEmailRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12464,15 +5755,15 @@ def user_service_verify_totp_registration( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceVerifyTOTPRegistrationResponse: - """Verify a TOTP generator for a user + ) -> UserServiceVerifyEmailResponse: + """Verify the email - Verify the TOTP registration with a generated code.. + Verify the email with the generated code. :param user_id: (required) :type user_id: str - :param user_service_verify_totp_registration_request: (required) - :type user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest + :param user_service_verify_email_request: (required) + :type user_service_verify_email_request: UserServiceVerifyEmailRequest :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 @@ -12495,9 +5786,9 @@ def user_service_verify_totp_registration( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_totp_registration_serialize( + _param = self.__user_service_verify_email_serialize( user_id=user_id, - user_service_verify_totp_registration_request=user_service_verify_totp_registration_request, + user_service_verify_email_request=user_service_verify_email_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12505,26 +5796,107 @@ def user_service_verify_totp_registration( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyTOTPRegistrationResponse", + '200': "UserServiceVerifyEmailResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_verify_email_serialize( + self, + user_id, + user_service_verify_email_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_verify_email_request is not None: + _body_params = user_service_verify_email_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/email/verify', + 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 user_service_verify_totp_registration_with_http_info( + def user_service_verify_invite_code( self, user_id: StrictStr, - user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest, + user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12537,15 +5909,15 @@ def user_service_verify_totp_registration_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[UserServiceVerifyTOTPRegistrationResponse]: - """Verify a TOTP generator for a user + ) -> UserServiceVerifyInviteCodeResponse: + """Verify an invite code for a user - Verify the TOTP registration with a generated code.. + Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. :param user_id: (required) :type user_id: str - :param user_service_verify_totp_registration_request: (required) - :type user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest + :param user_service_verify_invite_code_request: (required) + :type user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest :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 @@ -12568,9 +5940,9 @@ def user_service_verify_totp_registration_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_totp_registration_serialize( + _param = self.__user_service_verify_invite_code_serialize( user_id=user_id, - user_service_verify_totp_registration_request=user_service_verify_totp_registration_request, + user_service_verify_invite_code_request=user_service_verify_invite_code_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12578,26 +5950,108 @@ def user_service_verify_totp_registration_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyTOTPRegistrationResponse", + '200': "UserServiceVerifyInviteCodeResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_verify_invite_code_serialize( + self, + user_id, + user_service_verify_invite_code_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_verify_invite_code_request is not None: + _body_params = user_service_verify_invite_code_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/invite_code/verify', + 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 user_service_verify_totp_registration_without_preload_content( + def user_service_verify_passkey_registration( self, user_id: StrictStr, - user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest, + passkey_id: StrictStr, + user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12610,15 +6064,17 @@ def user_service_verify_totp_registration_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Verify a TOTP generator for a user + ) -> UserServiceVerifyPasskeyRegistrationResponse: + """Verify a passkey for a user - Verify the TOTP registration with a generated code.. + Verify the passkey registration with the public key credential.. :param user_id: (required) :type user_id: str - :param user_service_verify_totp_registration_request: (required) - :type user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest + :param passkey_id: (required) + :type passkey_id: str + :param user_service_verify_passkey_registration_request: (required) + :type user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest :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 @@ -12641,9 +6097,10 @@ def user_service_verify_totp_registration_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_totp_registration_serialize( + _param = self.__user_service_verify_passkey_registration_serialize( user_id=user_id, - user_service_verify_totp_registration_request=user_service_verify_totp_registration_request, + passkey_id=passkey_id, + user_service_verify_passkey_registration_request=user_service_verify_passkey_registration_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12651,103 +6108,110 @@ def user_service_verify_totp_registration_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyTOTPRegistrationResponse", + '200': "UserServiceVerifyPasskeyRegistrationResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_verify_totp_registration_serialize( - self, - user_id, - user_service_verify_totp_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = { - } + def __user_service_verify_passkey_registration_serialize( + self, + user_id, + passkey_id, + user_service_verify_passkey_registration_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - _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 - if user_id is not None: - _path_params['userId'] = user_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_totp_registration_request is not None: - _body_params = user_service_verify_totp_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/totp/verify', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + if passkey_id is not None: + _path_params['passkeyId'] = passkey_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_verify_passkey_registration_request is not None: + _body_params = user_service_verify_passkey_registration_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/passkeys/{passkeyId}', + 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 user_service_verify_u2_f_registration( + def user_service_verify_phone( self, user_id: StrictStr, - u2f_id: StrictStr, - user_service_verify_u2_f_registration_request: UserServiceVerifyU2FRegistrationRequest, + user_service_verify_phone_request: UserServiceVerifyPhoneRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12760,17 +6224,15 @@ def user_service_verify_u2_f_registration( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserServiceVerifyU2FRegistrationResponse: - """Verify a u2f token for a user + ) -> UserServiceVerifyPhoneResponse: + """Verify the phone - Verify the u2f token registration with the public key credential.. + Verify the phone with the generated code.. :param user_id: (required) :type user_id: str - :param u2f_id: (required) - :type u2f_id: str - :param user_service_verify_u2_f_registration_request: (required) - :type user_service_verify_u2_f_registration_request: UserServiceVerifyU2FRegistrationRequest + :param user_service_verify_phone_request: (required) + :type user_service_verify_phone_request: UserServiceVerifyPhoneRequest :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 @@ -12793,10 +6255,9 @@ def user_service_verify_u2_f_registration( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_u2_f_registration_serialize( + _param = self.__user_service_verify_phone_serialize( user_id=user_id, - u2f_id=u2f_id, - user_service_verify_u2_f_registration_request=user_service_verify_u2_f_registration_request, + user_service_verify_phone_request=user_service_verify_phone_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12804,27 +6265,107 @@ def user_service_verify_u2_f_registration( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyU2FRegistrationResponse", + '200': "UserServiceVerifyPhoneResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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 + 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 + + + + def __user_service_verify_phone_serialize( + self, + user_id, + user_service_verify_phone_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_verify_phone_request is not None: + _body_params = user_service_verify_phone_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/phone/verify', + 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 user_service_verify_u2_f_registration_with_http_info( + def user_service_verify_totp_registration( self, user_id: StrictStr, - u2f_id: StrictStr, - user_service_verify_u2_f_registration_request: UserServiceVerifyU2FRegistrationRequest, + user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12837,17 +6378,15 @@ def user_service_verify_u2_f_registration_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[UserServiceVerifyU2FRegistrationResponse]: - """Verify a u2f token for a user + ) -> UserServiceVerifyTOTPRegistrationResponse: + """Verify a TOTP generator for a user - Verify the u2f token registration with the public key credential.. + Verify the TOTP registration with a generated code.. :param user_id: (required) :type user_id: str - :param u2f_id: (required) - :type u2f_id: str - :param user_service_verify_u2_f_registration_request: (required) - :type user_service_verify_u2_f_registration_request: UserServiceVerifyU2FRegistrationRequest + :param user_service_verify_totp_registration_request: (required) + :type user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest :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 @@ -12870,10 +6409,9 @@ def user_service_verify_u2_f_registration_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_u2_f_registration_serialize( + _param = self.__user_service_verify_totp_registration_serialize( user_id=user_id, - u2f_id=u2f_id, - user_service_verify_u2_f_registration_request=user_service_verify_u2_f_registration_request, + user_service_verify_totp_registration_request=user_service_verify_totp_registration_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12881,23 +6419,104 @@ def user_service_verify_u2_f_registration_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyU2FRegistrationResponse", + '200': "UserServiceVerifyTOTPRegistrationResponse", '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - 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, - ) + 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 + + + + def __user_service_verify_totp_registration_serialize( + self, + user_id, + user_service_verify_totp_registration_request, + _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 + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_verify_totp_registration_request is not None: + _body_params = user_service_verify_totp_registration_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/totp/verify', + 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 user_service_verify_u2_f_registration_without_preload_content( + def user_service_verify_u2_f_registration( self, user_id: StrictStr, u2f_id: StrictStr, @@ -12914,8 +6533,8 @@ def user_service_verify_u2_f_registration_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Verify a u2f token for a user + ) -> UserServiceVerifyU2FRegistrationResponse: + """Verify a u2f token for a user Verify the u2f token registration with the public key credential.. @@ -12947,7 +6566,7 @@ def user_service_verify_u2_f_registration_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._user_service_verify_u2_f_registration_serialize( + _param = self.__user_service_verify_u2_f_registration_serialize( user_id=user_id, u2f_id=u2f_id, user_service_verify_u2_f_registration_request=user_service_verify_u2_f_registration_request, @@ -12962,91 +6581,96 @@ def user_service_verify_u2_f_registration_without_preload_content( '403': "UserServiceRpcStatus", '404': "UserServiceRpcStatus", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response + 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 - def _user_service_verify_u2_f_registration_serialize( - self, - user_id, - u2f_id, - user_service_verify_u2_f_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = { - } + def __user_service_verify_u2_f_registration_serialize( + self, + user_id, + u2f_id, + user_service_verify_u2_f_registration_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - _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 - if user_id is not None: - _path_params['userId'] = user_id - if u2f_id is not None: - _path_params['u2fId'] = u2f_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_u2_f_registration_request is not None: - _body_params = user_service_verify_u2_f_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/users/{userId}/u2f/{u2fId}', - 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 - ) + _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 + if user_id is not None: + _path_params['userId'] = user_id + if u2f_id is not None: + _path_params['u2fId'] = u2f_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_service_verify_u2_f_registration_request is not None: + _body_params = user_service_verify_u2_f_registration_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/users/{userId}/u2f/{u2fId}', + 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 + ) diff --git a/zitadel_client/api/web_key_service_api.py b/zitadel_client/api/web_key_service_api.py index bf3b1c15..dce11aa3 100644 --- a/zitadel_client/api/web_key_service_api.py +++ b/zitadel_client/api/web_key_service_api.py @@ -16,29 +16,29 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr -from zitadel_client.models.web_key_service_beta_activate_web_key_response import WebKeyServiceBetaActivateWebKeyResponse -from zitadel_client.models.web_key_service_beta_create_web_key_response import WebKeyServiceBetaCreateWebKeyResponse -from zitadel_client.models.web_key_service_beta_delete_web_key_response import WebKeyServiceBetaDeleteWebKeyResponse -from zitadel_client.models.web_key_service_beta_list_web_keys_response import WebKeyServiceBetaListWebKeysResponse -from zitadel_client.models.web_key_service_create_web_key_request import WebKeyServiceCreateWebKeyRequest + from pydantic import StrictStr + from zitadel_client.models.web_key_service_beta_activate_web_key_response import WebKeyServiceBetaActivateWebKeyResponse + from zitadel_client.models.web_key_service_beta_create_web_key_response import WebKeyServiceBetaCreateWebKeyResponse + from zitadel_client.models.web_key_service_beta_delete_web_key_response import WebKeyServiceBetaDeleteWebKeyResponse + from zitadel_client.models.web_key_service_beta_list_web_keys_response import WebKeyServiceBetaListWebKeysResponse + from zitadel_client.models.web_key_service_create_web_key_request import WebKeyServiceCreateWebKeyRequest from zitadel_client.api_client import ApiClient, RequestSerialized from zitadel_client.api_response import ApiResponse from zitadel_client.rest import RESTResponseType -class WebKeyServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + class WebKeyServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - Do not edit the class manually. - """ + Do not edit the class manually. + """ - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client @validate_call @@ -58,147 +58,7 @@ def web_key_service_activate_web_key( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> WebKeyServiceBetaActivateWebKeyResponse: - """Activate Web Key - - Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` - - :param id: (required) - :type id: str - :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._web_key_service_activate_web_key_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceBetaActivateWebKeyResponse", - '400': "object", - '403': "WebKeyServiceRpcStatus", - '404': "object", - } - 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 web_key_service_activate_web_key_with_http_info( - self, - id: StrictStr, - _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[WebKeyServiceBetaActivateWebKeyResponse]: - """Activate Web Key - - Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` - - :param id: (required) - :type id: str - :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._web_key_service_activate_web_key_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceBetaActivateWebKeyResponse", - '400': "object", - '403': "WebKeyServiceRpcStatus", - '404': "object", - } - 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 web_key_service_activate_web_key_without_preload_content( - self, - id: StrictStr, - _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: - """Activate Web Key + """Activate Web Key Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` @@ -226,7 +86,7 @@ def web_key_service_activate_web_key_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._web_key_service_activate_web_key_serialize( + _param = self.__web_key_service_activate_web_key_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, @@ -240,73 +100,78 @@ def web_key_service_activate_web_key_without_preload_content( '403': "WebKeyServiceRpcStatus", '404': "object", } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _web_key_service_activate_web_key_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __web_key_service_activate_web_key_serialize( + self, + id, + _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 - if id is not None: - _path_params['id'] = id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2beta/web_keys/{id}/activate', - 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 - ) + _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 + if id is not None: + _path_params['id'] = id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2beta/web_keys/{id}/activate', + 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 + ) @@ -328,77 +193,7 @@ def web_key_service_create_web_key( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> WebKeyServiceBetaCreateWebKeyResponse: - """Create Web Key - - Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` - - :param web_key_service_create_web_key_request: (required) - :type web_key_service_create_web_key_request: WebKeyServiceCreateWebKeyRequest - :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._web_key_service_create_web_key_serialize( - web_key_service_create_web_key_request=web_key_service_create_web_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceBetaCreateWebKeyResponse", - '400': "object", - '403': "WebKeyServiceRpcStatus", - '404': "WebKeyServiceRpcStatus", - } - 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 web_key_service_create_web_key_with_http_info( - self, - web_key_service_create_web_key_request: WebKeyServiceCreateWebKeyRequest, - _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[WebKeyServiceBetaCreateWebKeyResponse]: - """Create Web Key + """Create Web Key Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` @@ -426,7 +221,7 @@ def web_key_service_create_web_key_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._web_key_service_create_web_key_serialize( + _param = self.__web_key_service_create_web_key_serialize( web_key_service_create_web_key_request=web_key_service_create_web_key_request, _request_auth=_request_auth, _content_type=_content_type, @@ -440,156 +235,91 @@ def web_key_service_create_web_key_with_http_info( '403': "WebKeyServiceRpcStatus", '404': "WebKeyServiceRpcStatus", } - 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 web_key_service_create_web_key_without_preload_content( - self, - web_key_service_create_web_key_request: WebKeyServiceCreateWebKeyRequest, - _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 Web Key - - Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` - - :param web_key_service_create_web_key_request: (required) - :type web_key_service_create_web_key_request: WebKeyServiceCreateWebKeyRequest - :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._web_key_service_create_web_key_serialize( - web_key_service_create_web_key_request=web_key_service_create_web_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceBetaCreateWebKeyResponse", - '400': "object", - '403': "WebKeyServiceRpcStatus", - '404': "WebKeyServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _web_key_service_create_web_key_serialize( - self, - web_key_service_create_web_key_request, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __web_key_service_create_web_key_serialize( + self, + web_key_service_create_web_key_request, + _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 web_key_service_create_web_key_request is not None: - _body_params = web_key_service_create_web_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2beta/web_keys', - 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 - ) + _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 web_key_service_create_web_key_request is not None: + _body_params = web_key_service_create_web_key_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2beta/web_keys', + 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 + ) @@ -611,77 +341,7 @@ def web_key_service_delete_web_key( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> WebKeyServiceBetaDeleteWebKeyResponse: - """Delete Web Key - - Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` Required feature flag: - `web_key` - - :param id: (required) - :type id: str - :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._web_key_service_delete_web_key_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceBetaDeleteWebKeyResponse", - '400': "object", - '403': "WebKeyServiceRpcStatus", - '404': "WebKeyServiceRpcStatus", - } - 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 web_key_service_delete_web_key_with_http_info( - self, - id: StrictStr, - _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[WebKeyServiceBetaDeleteWebKeyResponse]: - """Delete Web Key + """Delete Web Key Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` Required feature flag: - `web_key` @@ -709,7 +369,7 @@ def web_key_service_delete_web_key_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._web_key_service_delete_web_key_serialize( + _param = self.__web_key_service_delete_web_key_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, @@ -723,143 +383,78 @@ def web_key_service_delete_web_key_with_http_info( '403': "WebKeyServiceRpcStatus", '404': "WebKeyServiceRpcStatus", } - 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 web_key_service_delete_web_key_without_preload_content( - self, - id: StrictStr, - _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: - """Delete Web Key - - Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` Required feature flag: - `web_key` - - :param id: (required) - :type id: str - :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._web_key_service_delete_web_key_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceBetaDeleteWebKeyResponse", - '400': "object", - '403': "WebKeyServiceRpcStatus", - '404': "WebKeyServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _web_key_service_delete_web_key_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __web_key_service_delete_web_key_serialize( + self, + id, + _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 - if id is not None: - _path_params['id'] = id - # 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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2beta/web_keys/{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 - ) + _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 + if id is not None: + _path_params['id'] = id + # 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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2beta/web_keys/{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 + ) @@ -880,73 +475,7 @@ def web_key_service_list_web_keys( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> WebKeyServiceBetaListWebKeysResponse: - """List Web Keys - - List all web keys and their states. Required permission: - `iam.web_key.read` Required feature flag: - `web_key` - - :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._web_key_service_list_web_keys_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceBetaListWebKeysResponse", - '400': "object", - '403': "WebKeyServiceRpcStatus", - '404': "WebKeyServiceRpcStatus", - } - 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 web_key_service_list_web_keys_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[WebKeyServiceBetaListWebKeysResponse]: - """List Web Keys + """List Web Keys List all web keys and their states. Required permission: - `iam.web_key.read` Required feature flag: - `web_key` @@ -972,7 +501,7 @@ def web_key_service_list_web_keys_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._web_key_service_list_web_keys_serialize( + _param = self.__web_key_service_list_web_keys_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -985,135 +514,74 @@ def web_key_service_list_web_keys_with_http_info( '403': "WebKeyServiceRpcStatus", '404': "WebKeyServiceRpcStatus", } - 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 web_key_service_list_web_keys_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: - """List Web Keys - - List all web keys and their states. Required permission: - `iam.web_key.read` Required feature flag: - `web_key` - - :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._web_key_service_list_web_keys_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceBetaListWebKeysResponse", - '400': "object", - '403': "WebKeyServiceRpcStatus", - '404': "WebKeyServiceRpcStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _web_key_service_list_web_keys_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, + 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 + + + + def __web_key_service_list_web_keys_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] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2beta/web_keys', - 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 - ) + _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] = [ + 'zitadelAccessToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2beta/web_keys', + 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 + )