Skip to content

Commit eab286e

Browse files
authored
feat(sdk): generate SDK for version v4.2.0 (#69)
* feat(sdk): generate SDK for version v4.2.0 * chore: bumped the containers to match the corresponding server version * fix(api): Ensure error responses are deserialized The ApiClient failed to handle the body of non-2xx (error) API responses. The code generator did not create the necessary logic to deserialize the default error type defined in the OpenAPI specification. This caused the `response_body` in a caught `ApiError` to always be `None`, making it impossible to debug API failures through the SDK. This patch modifies the `response_deserialize` method to intelligently process error bodies. It now checks the `Content-Type` header of the response. If the content is JSON, it is decoded into a dictionary. If the content is not JSON or if parsing fails, it gracefully falls back to using the raw text of the body. This ensures that the `ApiError` exception always contains a useful payload (either a structured dictionary or raw text), significantly improving the debugging experience by making API errors transparent.
1 parent bee5ffe commit eab286e

File tree

239 files changed

+1447
-1041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+1447
-1041
lines changed

etc/docker-compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
restart: 'no'
2121
networks:
2222
- storage
23-
image: 'ghcr.io/zitadel/zitadel:v4.0.0'
23+
image: 'ghcr.io/zitadel/zitadel:v4.2.0'
2424
command: 'init --config /example-zitadel-config.yaml --config /example-zitadel-secrets.yaml'
2525
depends_on:
2626
db:
@@ -34,7 +34,7 @@ services:
3434
restart: 'no'
3535
networks:
3636
- storage
37-
image: 'ghcr.io/zitadel/zitadel:v4.0.0-debug'
37+
image: 'ghcr.io/zitadel/zitadel:v4.2.0-debug'
3838
user: root
3939
entrypoint: '/bin/bash'
4040
command: [ "-c", "/app/zitadel setup --config /example-zitadel-config.yaml --config /example-zitadel-secrets.yaml --steps /example-zitadel-init-steps.yaml --masterkey \"my_test_masterkey_0123456789ABEF\" && echo \"--- ZITADEL SETUP COMPLETE ---\" && echo \"Personal Access Token (PAT) will be in ./zitadel_output/pat.txt on your host.\" && echo \"Service Account Key will be in ./zitadel_output/sa-key.json on your host.\" && echo \"OAuth Client ID and Secret will be in 'zitadel' service logs (grep for 'Application created').\"" ]
@@ -55,7 +55,7 @@ services:
5555
networks:
5656
- backend
5757
- storage
58-
image: 'ghcr.io/zitadel/zitadel:v4.0.0'
58+
image: 'ghcr.io/zitadel/zitadel:v4.2.0'
5959
command: >
6060
start --config /example-zitadel-config.yaml
6161
--config /example-zitadel-secrets.yaml

zitadel_client/api/action_service_api.py

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ def __init__(self, api_client=None) -> None:
5454

5555

5656
@validate_call
57-
def create_target( self, action_service_create_target_request: ActionServiceCreateTargetRequest, _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, ) -> ActionServiceCreateTargetResponse:
58-
"""CreateTarget
57+
def create_target( self, action_service_create_target_request: Optional[ActionServiceCreateTargetRequest] = 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, ) -> ActionServiceCreateTargetResponse:
58+
if action_service_create_target_request is None:
59+
action_service_create_target_request = {}
60+
"""Create Target
5961
60-
Create Target Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions`
62+
Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions`
6163
6264
:param action_service_create_target_request: (required)
6365
:type action_service_create_target_request: ActionServiceCreateTargetRequest
@@ -183,9 +185,9 @@ def _create_target_serialize(
183185

184186
@validate_call
185187
def delete_target( self, action_service_delete_target_request: ActionServiceDeleteTargetRequest, _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, ) -> ActionServiceDeleteTargetResponse:
186-
"""DeleteTarget
188+
"""Delete Target
187189
188-
Delete Target 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`
190+
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`
189191
190192
:param action_service_delete_target_request: (required)
191193
:type action_service_delete_target_request: ActionServiceDeleteTargetRequest
@@ -311,9 +313,9 @@ def _delete_target_serialize(
311313

312314
@validate_call
313315
def get_target( self, action_service_get_target_request: ActionServiceGetTargetRequest, _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, ) -> ActionServiceGetTargetResponse:
314-
"""GetTarget
316+
"""Get Target
315317
316-
Get Target Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions`
318+
Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions`
317319
318320
:param action_service_get_target_request: (required)
319321
:type action_service_get_target_request: ActionServiceGetTargetRequest
@@ -441,9 +443,9 @@ def _get_target_serialize(
441443
def list_execution_functions( self, body: Optional[Dict[str, Any]] = 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, ) -> ActionServiceListExecutionFunctionsResponse:
442444
if body is None:
443445
body = {}
444-
"""ListExecutionFunctions
446+
"""List Execution Functions
445447
446-
List Execution Functions List all available functions which can be used as condition for executions.
448+
List all available functions which can be used as condition for executions.
447449
448450
:param body: (required)
449451
:type body: object
@@ -571,9 +573,9 @@ def _list_execution_functions_serialize(
571573
def list_execution_methods( self, body: Optional[Dict[str, Any]] = 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, ) -> ActionServiceListExecutionMethodsResponse:
572574
if body is None:
573575
body = {}
574-
"""ListExecutionMethods
576+
"""List Execution Methods
575577
576-
List Execution Methods List all available methods which can be used as condition for executions.
578+
List all available methods which can be used as condition for executions.
577579
578580
:param body: (required)
579581
:type body: object
@@ -701,9 +703,9 @@ def _list_execution_methods_serialize(
701703
def list_execution_services( self, body: Optional[Dict[str, Any]] = 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, ) -> ActionServiceListExecutionServicesResponse:
702704
if body is None:
703705
body = {}
704-
"""ListExecutionServices
706+
"""List Execution Services
705707
706-
List Execution Services List all available services which can be used as condition for executions.
708+
List all available services which can be used as condition for executions.
707709
708710
:param body: (required)
709711
:type body: object
@@ -829,9 +831,9 @@ def _list_execution_services_serialize(
829831

830832
@validate_call
831833
def list_executions( self, action_service_list_executions_request: ActionServiceListExecutionsRequest, _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, ) -> ActionServiceListExecutionsResponse:
832-
"""ListExecutions
834+
"""List Executions
833835
834-
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`
836+
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`
835837
836838
:param action_service_list_executions_request: (required)
837839
:type action_service_list_executions_request: ActionServiceListExecutionsRequest
@@ -957,9 +959,9 @@ def _list_executions_serialize(
957959

958960
@validate_call
959961
def 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, ) -> ActionServiceListTargetsResponse:
960-
"""ListTargets
962+
"""List targets
961963
962-
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`
964+
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`
963965
964966
:param action_service_list_targets_request: (required)
965967
:type action_service_list_targets_request: ActionServiceListTargetsRequest
@@ -1085,9 +1087,9 @@ def _list_targets_serialize(
10851087

10861088
@validate_call
10871089
def 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, ) -> ActionServiceSetExecutionResponse:
1088-
"""SetExecution
1090+
"""Set Execution
10891091
1090-
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`
1092+
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`
10911093
10921094
:param action_service_set_execution_request: (required)
10931095
:type action_service_set_execution_request: ActionServiceSetExecutionRequest
@@ -1212,10 +1214,12 @@ def _set_execution_serialize(
12121214

12131215

12141216
@validate_call
1215-
def update_target( self, 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, ) -> ActionServiceUpdateTargetResponse:
1216-
"""UpdateTarget
1217+
def update_target( self, action_service_update_target_request: Optional[ActionServiceUpdateTargetRequest] = 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, ) -> ActionServiceUpdateTargetResponse:
1218+
if action_service_update_target_request is None:
1219+
action_service_update_target_request = {}
1220+
"""Update Target
12171221
1218-
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`
1222+
Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions`
12191223
12201224
:param action_service_update_target_request: (required)
12211225
:type action_service_update_target_request: ActionServiceUpdateTargetRequest

0 commit comments

Comments
 (0)