hatchet-sdk 1.18.1__py3-none-any.whl → 1.20.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (234) hide show
  1. hatchet_sdk/clients/dispatcher/action_listener.py +0 -1
  2. hatchet_sdk/clients/dispatcher/dispatcher.py +0 -30
  3. hatchet_sdk/hatchet.py +0 -20
  4. hatchet_sdk/opentelemetry/instrumentor.py +1 -27
  5. hatchet_sdk/runnables/action.py +2 -5
  6. hatchet_sdk/runnables/task.py +0 -1
  7. hatchet_sdk/utils/opentelemetry.py +0 -1
  8. hatchet_sdk/worker/action_listener_process.py +0 -29
  9. hatchet_sdk/worker/runner/runner.py +1 -105
  10. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.20.0.dist-info}/METADATA +2 -3
  11. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.20.0.dist-info}/RECORD +13 -234
  12. hatchet_sdk/v0/__init__.py +0 -251
  13. hatchet_sdk/v0/client.py +0 -119
  14. hatchet_sdk/v0/clients/admin.py +0 -541
  15. hatchet_sdk/v0/clients/dispatcher/action_listener.py +0 -422
  16. hatchet_sdk/v0/clients/dispatcher/dispatcher.py +0 -204
  17. hatchet_sdk/v0/clients/event_ts.py +0 -28
  18. hatchet_sdk/v0/clients/events.py +0 -182
  19. hatchet_sdk/v0/clients/rest/__init__.py +0 -307
  20. hatchet_sdk/v0/clients/rest/api/__init__.py +0 -19
  21. hatchet_sdk/v0/clients/rest/api/api_token_api.py +0 -858
  22. hatchet_sdk/v0/clients/rest/api/default_api.py +0 -2259
  23. hatchet_sdk/v0/clients/rest/api/event_api.py +0 -2548
  24. hatchet_sdk/v0/clients/rest/api/github_api.py +0 -331
  25. hatchet_sdk/v0/clients/rest/api/healthcheck_api.py +0 -483
  26. hatchet_sdk/v0/clients/rest/api/log_api.py +0 -449
  27. hatchet_sdk/v0/clients/rest/api/metadata_api.py +0 -728
  28. hatchet_sdk/v0/clients/rest/api/rate_limits_api.py +0 -423
  29. hatchet_sdk/v0/clients/rest/api/slack_api.py +0 -577
  30. hatchet_sdk/v0/clients/rest/api/sns_api.py +0 -872
  31. hatchet_sdk/v0/clients/rest/api/step_run_api.py +0 -2202
  32. hatchet_sdk/v0/clients/rest/api/tenant_api.py +0 -4430
  33. hatchet_sdk/v0/clients/rest/api/user_api.py +0 -2888
  34. hatchet_sdk/v0/clients/rest/api/worker_api.py +0 -858
  35. hatchet_sdk/v0/clients/rest/api/workflow_api.py +0 -6312
  36. hatchet_sdk/v0/clients/rest/api/workflow_run_api.py +0 -1932
  37. hatchet_sdk/v0/clients/rest/api/workflow_runs_api.py +0 -610
  38. hatchet_sdk/v0/clients/rest/api_client.py +0 -759
  39. hatchet_sdk/v0/clients/rest/api_response.py +0 -22
  40. hatchet_sdk/v0/clients/rest/configuration.py +0 -611
  41. hatchet_sdk/v0/clients/rest/exceptions.py +0 -200
  42. hatchet_sdk/v0/clients/rest/models/__init__.py +0 -274
  43. hatchet_sdk/v0/clients/rest/models/accept_invite_request.py +0 -83
  44. hatchet_sdk/v0/clients/rest/models/api_error.py +0 -102
  45. hatchet_sdk/v0/clients/rest/models/api_errors.py +0 -100
  46. hatchet_sdk/v0/clients/rest/models/api_meta.py +0 -144
  47. hatchet_sdk/v0/clients/rest/models/api_meta_auth.py +0 -85
  48. hatchet_sdk/v0/clients/rest/models/api_meta_integration.py +0 -88
  49. hatchet_sdk/v0/clients/rest/models/api_meta_posthog.py +0 -90
  50. hatchet_sdk/v0/clients/rest/models/api_resource_meta.py +0 -98
  51. hatchet_sdk/v0/clients/rest/models/api_token.py +0 -105
  52. hatchet_sdk/v0/clients/rest/models/bulk_create_event_request.py +0 -100
  53. hatchet_sdk/v0/clients/rest/models/bulk_create_event_response.py +0 -110
  54. hatchet_sdk/v0/clients/rest/models/cancel_event_request.py +0 -85
  55. hatchet_sdk/v0/clients/rest/models/cancel_step_run_request.py +0 -83
  56. hatchet_sdk/v0/clients/rest/models/concurrency_limit_strategy.py +0 -39
  57. hatchet_sdk/v0/clients/rest/models/create_api_token_request.py +0 -92
  58. hatchet_sdk/v0/clients/rest/models/create_api_token_response.py +0 -83
  59. hatchet_sdk/v0/clients/rest/models/create_cron_workflow_trigger_request.py +0 -98
  60. hatchet_sdk/v0/clients/rest/models/create_event_request.py +0 -95
  61. hatchet_sdk/v0/clients/rest/models/create_pull_request_from_step_run.py +0 -83
  62. hatchet_sdk/v0/clients/rest/models/create_sns_integration_request.py +0 -85
  63. hatchet_sdk/v0/clients/rest/models/create_tenant_alert_email_group_request.py +0 -83
  64. hatchet_sdk/v0/clients/rest/models/create_tenant_invite_request.py +0 -86
  65. hatchet_sdk/v0/clients/rest/models/create_tenant_request.py +0 -84
  66. hatchet_sdk/v0/clients/rest/models/cron_workflows.py +0 -131
  67. hatchet_sdk/v0/clients/rest/models/cron_workflows_list.py +0 -110
  68. hatchet_sdk/v0/clients/rest/models/cron_workflows_method.py +0 -37
  69. hatchet_sdk/v0/clients/rest/models/cron_workflows_order_by_field.py +0 -37
  70. hatchet_sdk/v0/clients/rest/models/event.py +0 -143
  71. hatchet_sdk/v0/clients/rest/models/event_data.py +0 -83
  72. hatchet_sdk/v0/clients/rest/models/event_key_list.py +0 -98
  73. hatchet_sdk/v0/clients/rest/models/event_list.py +0 -110
  74. hatchet_sdk/v0/clients/rest/models/event_order_by_direction.py +0 -37
  75. hatchet_sdk/v0/clients/rest/models/event_order_by_field.py +0 -36
  76. hatchet_sdk/v0/clients/rest/models/event_update_cancel200_response.py +0 -85
  77. hatchet_sdk/v0/clients/rest/models/event_workflow_run_summary.py +0 -116
  78. hatchet_sdk/v0/clients/rest/models/events.py +0 -110
  79. hatchet_sdk/v0/clients/rest/models/get_step_run_diff_response.py +0 -100
  80. hatchet_sdk/v0/clients/rest/models/github_app_installation.py +0 -107
  81. hatchet_sdk/v0/clients/rest/models/github_branch.py +0 -86
  82. hatchet_sdk/v0/clients/rest/models/github_repo.py +0 -86
  83. hatchet_sdk/v0/clients/rest/models/info_get_version200_response.py +0 -83
  84. hatchet_sdk/v0/clients/rest/models/job.py +0 -132
  85. hatchet_sdk/v0/clients/rest/models/job_run.py +0 -176
  86. hatchet_sdk/v0/clients/rest/models/job_run_status.py +0 -41
  87. hatchet_sdk/v0/clients/rest/models/link_github_repository_request.py +0 -106
  88. hatchet_sdk/v0/clients/rest/models/list_api_tokens_response.py +0 -110
  89. hatchet_sdk/v0/clients/rest/models/list_github_app_installations_response.py +0 -112
  90. hatchet_sdk/v0/clients/rest/models/list_pull_requests_response.py +0 -100
  91. hatchet_sdk/v0/clients/rest/models/list_slack_webhooks.py +0 -110
  92. hatchet_sdk/v0/clients/rest/models/list_sns_integrations.py +0 -110
  93. hatchet_sdk/v0/clients/rest/models/log_line.py +0 -94
  94. hatchet_sdk/v0/clients/rest/models/log_line_level.py +0 -39
  95. hatchet_sdk/v0/clients/rest/models/log_line_list.py +0 -110
  96. hatchet_sdk/v0/clients/rest/models/log_line_order_by_direction.py +0 -37
  97. hatchet_sdk/v0/clients/rest/models/log_line_order_by_field.py +0 -36
  98. hatchet_sdk/v0/clients/rest/models/pagination_response.py +0 -95
  99. hatchet_sdk/v0/clients/rest/models/pull_request.py +0 -112
  100. hatchet_sdk/v0/clients/rest/models/pull_request_state.py +0 -37
  101. hatchet_sdk/v0/clients/rest/models/queue_metrics.py +0 -97
  102. hatchet_sdk/v0/clients/rest/models/rate_limit.py +0 -117
  103. hatchet_sdk/v0/clients/rest/models/rate_limit_list.py +0 -110
  104. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_direction.py +0 -37
  105. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_field.py +0 -38
  106. hatchet_sdk/v0/clients/rest/models/recent_step_runs.py +0 -118
  107. hatchet_sdk/v0/clients/rest/models/reject_invite_request.py +0 -83
  108. hatchet_sdk/v0/clients/rest/models/replay_event_request.py +0 -85
  109. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_request.py +0 -85
  110. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_response.py +0 -100
  111. hatchet_sdk/v0/clients/rest/models/rerun_step_run_request.py +0 -83
  112. hatchet_sdk/v0/clients/rest/models/schedule_workflow_run_request.py +0 -92
  113. hatchet_sdk/v0/clients/rest/models/scheduled_run_status.py +0 -42
  114. hatchet_sdk/v0/clients/rest/models/scheduled_workflows.py +0 -149
  115. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_list.py +0 -110
  116. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_method.py +0 -37
  117. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_order_by_field.py +0 -37
  118. hatchet_sdk/v0/clients/rest/models/semaphore_slots.py +0 -113
  119. hatchet_sdk/v0/clients/rest/models/slack_webhook.py +0 -127
  120. hatchet_sdk/v0/clients/rest/models/sns_integration.py +0 -114
  121. hatchet_sdk/v0/clients/rest/models/step.py +0 -123
  122. hatchet_sdk/v0/clients/rest/models/step_run.py +0 -202
  123. hatchet_sdk/v0/clients/rest/models/step_run_archive.py +0 -142
  124. hatchet_sdk/v0/clients/rest/models/step_run_archive_list.py +0 -110
  125. hatchet_sdk/v0/clients/rest/models/step_run_diff.py +0 -91
  126. hatchet_sdk/v0/clients/rest/models/step_run_event.py +0 -122
  127. hatchet_sdk/v0/clients/rest/models/step_run_event_list.py +0 -110
  128. hatchet_sdk/v0/clients/rest/models/step_run_event_reason.py +0 -52
  129. hatchet_sdk/v0/clients/rest/models/step_run_event_severity.py +0 -38
  130. hatchet_sdk/v0/clients/rest/models/step_run_status.py +0 -44
  131. hatchet_sdk/v0/clients/rest/models/tenant.py +0 -118
  132. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group.py +0 -98
  133. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group_list.py +0 -112
  134. hatchet_sdk/v0/clients/rest/models/tenant_alerting_settings.py +0 -143
  135. hatchet_sdk/v0/clients/rest/models/tenant_invite.py +0 -120
  136. hatchet_sdk/v0/clients/rest/models/tenant_invite_list.py +0 -110
  137. hatchet_sdk/v0/clients/rest/models/tenant_list.py +0 -110
  138. hatchet_sdk/v0/clients/rest/models/tenant_member.py +0 -123
  139. hatchet_sdk/v0/clients/rest/models/tenant_member_list.py +0 -110
  140. hatchet_sdk/v0/clients/rest/models/tenant_member_role.py +0 -38
  141. hatchet_sdk/v0/clients/rest/models/tenant_queue_metrics.py +0 -116
  142. hatchet_sdk/v0/clients/rest/models/tenant_resource.py +0 -40
  143. hatchet_sdk/v0/clients/rest/models/tenant_resource_limit.py +0 -135
  144. hatchet_sdk/v0/clients/rest/models/tenant_resource_policy.py +0 -102
  145. hatchet_sdk/v0/clients/rest/models/tenant_step_run_queue_metrics.py +0 -83
  146. hatchet_sdk/v0/clients/rest/models/trigger_workflow_run_request.py +0 -91
  147. hatchet_sdk/v0/clients/rest/models/update_tenant_alert_email_group_request.py +0 -83
  148. hatchet_sdk/v0/clients/rest/models/update_tenant_invite_request.py +0 -85
  149. hatchet_sdk/v0/clients/rest/models/update_tenant_request.py +0 -137
  150. hatchet_sdk/v0/clients/rest/models/update_worker_request.py +0 -87
  151. hatchet_sdk/v0/clients/rest/models/user.py +0 -126
  152. hatchet_sdk/v0/clients/rest/models/user_change_password_request.py +0 -88
  153. hatchet_sdk/v0/clients/rest/models/user_login_request.py +0 -86
  154. hatchet_sdk/v0/clients/rest/models/user_register_request.py +0 -91
  155. hatchet_sdk/v0/clients/rest/models/user_tenant_memberships_list.py +0 -110
  156. hatchet_sdk/v0/clients/rest/models/user_tenant_public.py +0 -86
  157. hatchet_sdk/v0/clients/rest/models/webhook_worker.py +0 -100
  158. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_request.py +0 -94
  159. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_response.py +0 -98
  160. hatchet_sdk/v0/clients/rest/models/webhook_worker_created.py +0 -102
  161. hatchet_sdk/v0/clients/rest/models/webhook_worker_list_response.py +0 -110
  162. hatchet_sdk/v0/clients/rest/models/webhook_worker_request.py +0 -102
  163. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_list_response.py +0 -104
  164. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_method.py +0 -38
  165. hatchet_sdk/v0/clients/rest/models/worker.py +0 -239
  166. hatchet_sdk/v0/clients/rest/models/worker_label.py +0 -102
  167. hatchet_sdk/v0/clients/rest/models/worker_list.py +0 -110
  168. hatchet_sdk/v0/clients/rest/models/worker_runtime_info.py +0 -103
  169. hatchet_sdk/v0/clients/rest/models/worker_runtime_sdks.py +0 -38
  170. hatchet_sdk/v0/clients/rest/models/worker_type.py +0 -38
  171. hatchet_sdk/v0/clients/rest/models/workflow.py +0 -165
  172. hatchet_sdk/v0/clients/rest/models/workflow_concurrency.py +0 -107
  173. hatchet_sdk/v0/clients/rest/models/workflow_deployment_config.py +0 -136
  174. hatchet_sdk/v0/clients/rest/models/workflow_kind.py +0 -38
  175. hatchet_sdk/v0/clients/rest/models/workflow_list.py +0 -120
  176. hatchet_sdk/v0/clients/rest/models/workflow_metrics.py +0 -97
  177. hatchet_sdk/v0/clients/rest/models/workflow_run.py +0 -188
  178. hatchet_sdk/v0/clients/rest/models/workflow_run_cancel200_response.py +0 -85
  179. hatchet_sdk/v0/clients/rest/models/workflow_run_list.py +0 -110
  180. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_direction.py +0 -37
  181. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_field.py +0 -39
  182. hatchet_sdk/v0/clients/rest/models/workflow_run_shape.py +0 -186
  183. hatchet_sdk/v0/clients/rest/models/workflow_run_status.py +0 -42
  184. hatchet_sdk/v0/clients/rest/models/workflow_run_triggered_by.py +0 -112
  185. hatchet_sdk/v0/clients/rest/models/workflow_runs_cancel_request.py +0 -85
  186. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics.py +0 -94
  187. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics_counts.py +0 -104
  188. hatchet_sdk/v0/clients/rest/models/workflow_tag.py +0 -84
  189. hatchet_sdk/v0/clients/rest/models/workflow_trigger_cron_ref.py +0 -86
  190. hatchet_sdk/v0/clients/rest/models/workflow_trigger_event_ref.py +0 -86
  191. hatchet_sdk/v0/clients/rest/models/workflow_triggers.py +0 -141
  192. hatchet_sdk/v0/clients/rest/models/workflow_update_request.py +0 -85
  193. hatchet_sdk/v0/clients/rest/models/workflow_version.py +0 -170
  194. hatchet_sdk/v0/clients/rest/models/workflow_version_concurrency.py +0 -114
  195. hatchet_sdk/v0/clients/rest/models/workflow_version_definition.py +0 -85
  196. hatchet_sdk/v0/clients/rest/models/workflow_version_meta.py +0 -123
  197. hatchet_sdk/v0/clients/rest/models/workflow_workers_count.py +0 -95
  198. hatchet_sdk/v0/clients/rest/rest.py +0 -187
  199. hatchet_sdk/v0/clients/rest/tenacity_utils.py +0 -39
  200. hatchet_sdk/v0/clients/rest_client.py +0 -622
  201. hatchet_sdk/v0/clients/run_event_listener.py +0 -260
  202. hatchet_sdk/v0/clients/workflow_listener.py +0 -277
  203. hatchet_sdk/v0/connection.py +0 -63
  204. hatchet_sdk/v0/context/__init__.py +0 -1
  205. hatchet_sdk/v0/context/context.py +0 -446
  206. hatchet_sdk/v0/context/worker_context.py +0 -28
  207. hatchet_sdk/v0/features/cron.py +0 -286
  208. hatchet_sdk/v0/features/scheduled.py +0 -248
  209. hatchet_sdk/v0/hatchet.py +0 -310
  210. hatchet_sdk/v0/labels.py +0 -10
  211. hatchet_sdk/v0/loader.py +0 -244
  212. hatchet_sdk/v0/metadata.py +0 -2
  213. hatchet_sdk/v0/opentelemetry/instrumentor.py +0 -393
  214. hatchet_sdk/v0/rate_limit.py +0 -126
  215. hatchet_sdk/v0/semver.py +0 -30
  216. hatchet_sdk/v0/token.py +0 -27
  217. hatchet_sdk/v0/utils/aio_utils.py +0 -137
  218. hatchet_sdk/v0/utils/backoff.py +0 -9
  219. hatchet_sdk/v0/utils/types.py +0 -8
  220. hatchet_sdk/v0/utils/typing.py +0 -12
  221. hatchet_sdk/v0/v2/callable.py +0 -202
  222. hatchet_sdk/v0/v2/concurrency.py +0 -47
  223. hatchet_sdk/v0/v2/hatchet.py +0 -224
  224. hatchet_sdk/v0/worker/__init__.py +0 -1
  225. hatchet_sdk/v0/worker/action_listener_process.py +0 -294
  226. hatchet_sdk/v0/worker/runner/run_loop_manager.py +0 -112
  227. hatchet_sdk/v0/worker/runner/runner.py +0 -460
  228. hatchet_sdk/v0/worker/runner/utils/capture_logs.py +0 -81
  229. hatchet_sdk/v0/worker/runner/utils/error_with_traceback.py +0 -6
  230. hatchet_sdk/v0/worker/worker.py +0 -391
  231. hatchet_sdk/v0/workflow.py +0 -261
  232. hatchet_sdk/v0/workflow_run.py +0 -59
  233. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.20.0.dist-info}/WHEEL +0 -0
  234. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.20.0.dist-info}/entry_points.txt +0 -0
@@ -1,858 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
- import warnings
15
- from typing import Any, Dict, List, Optional, Tuple, Union
16
-
17
- from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
- from typing_extensions import Annotated
19
-
20
- from hatchet_sdk.v0.clients.rest.api_client import ApiClient, RequestSerialized
21
- from hatchet_sdk.v0.clients.rest.api_response import ApiResponse
22
- from hatchet_sdk.v0.clients.rest.models.create_api_token_request import (
23
- CreateAPITokenRequest,
24
- )
25
- from hatchet_sdk.v0.clients.rest.models.create_api_token_response import (
26
- CreateAPITokenResponse,
27
- )
28
- from hatchet_sdk.v0.clients.rest.models.list_api_tokens_response import (
29
- ListAPITokensResponse,
30
- )
31
- from hatchet_sdk.v0.clients.rest.rest import RESTResponseType
32
-
33
-
34
- class APITokenApi:
35
- """NOTE: This class is auto generated by OpenAPI Generator
36
- Ref: https://openapi-generator.tech
37
-
38
- Do not edit the class manually.
39
- """
40
-
41
- def __init__(self, api_client=None) -> None:
42
- if api_client is None:
43
- api_client = ApiClient.get_default()
44
- self.api_client = api_client
45
-
46
- @validate_call
47
- async def api_token_create(
48
- self,
49
- tenant: Annotated[
50
- str,
51
- Field(
52
- min_length=36, strict=True, max_length=36, description="The tenant id"
53
- ),
54
- ],
55
- create_api_token_request: Optional[CreateAPITokenRequest] = None,
56
- _request_timeout: Union[
57
- None,
58
- Annotated[StrictFloat, Field(gt=0)],
59
- Tuple[
60
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
61
- ],
62
- ] = None,
63
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
64
- _content_type: Optional[StrictStr] = None,
65
- _headers: Optional[Dict[StrictStr, Any]] = None,
66
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
67
- ) -> CreateAPITokenResponse:
68
- """Create API Token
69
-
70
- Create an API token for a tenant
71
-
72
- :param tenant: The tenant id (required)
73
- :type tenant: str
74
- :param create_api_token_request:
75
- :type create_api_token_request: CreateAPITokenRequest
76
- :param _request_timeout: timeout setting for this request. If one
77
- number provided, it will be total request
78
- timeout. It can also be a pair (tuple) of
79
- (connection, read) timeouts.
80
- :type _request_timeout: int, tuple(int, int), optional
81
- :param _request_auth: set to override the auth_settings for an a single
82
- request; this effectively ignores the
83
- authentication in the spec for a single request.
84
- :type _request_auth: dict, optional
85
- :param _content_type: force content-type for the request.
86
- :type _content_type: str, Optional
87
- :param _headers: set to override the headers for a single
88
- request; this effectively ignores the headers
89
- in the spec for a single request.
90
- :type _headers: dict, optional
91
- :param _host_index: set to override the host_index for a single
92
- request; this effectively ignores the host_index
93
- in the spec for a single request.
94
- :type _host_index: int, optional
95
- :return: Returns the result object.
96
- """ # noqa: E501
97
-
98
- _param = self._api_token_create_serialize(
99
- tenant=tenant,
100
- create_api_token_request=create_api_token_request,
101
- _request_auth=_request_auth,
102
- _content_type=_content_type,
103
- _headers=_headers,
104
- _host_index=_host_index,
105
- )
106
-
107
- _response_types_map: Dict[str, Optional[str]] = {
108
- "200": "CreateAPITokenResponse",
109
- "400": "APIErrors",
110
- "403": "APIErrors",
111
- }
112
- response_data = await self.api_client.call_api(
113
- *_param, _request_timeout=_request_timeout
114
- )
115
- await response_data.read()
116
- return self.api_client.response_deserialize(
117
- response_data=response_data,
118
- response_types_map=_response_types_map,
119
- ).data
120
-
121
- @validate_call
122
- async def api_token_create_with_http_info(
123
- self,
124
- tenant: Annotated[
125
- str,
126
- Field(
127
- min_length=36, strict=True, max_length=36, description="The tenant id"
128
- ),
129
- ],
130
- create_api_token_request: Optional[CreateAPITokenRequest] = None,
131
- _request_timeout: Union[
132
- None,
133
- Annotated[StrictFloat, Field(gt=0)],
134
- Tuple[
135
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
136
- ],
137
- ] = None,
138
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
139
- _content_type: Optional[StrictStr] = None,
140
- _headers: Optional[Dict[StrictStr, Any]] = None,
141
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
142
- ) -> ApiResponse[CreateAPITokenResponse]:
143
- """Create API Token
144
-
145
- Create an API token for a tenant
146
-
147
- :param tenant: The tenant id (required)
148
- :type tenant: str
149
- :param create_api_token_request:
150
- :type create_api_token_request: CreateAPITokenRequest
151
- :param _request_timeout: timeout setting for this request. If one
152
- number provided, it will be total request
153
- timeout. It can also be a pair (tuple) of
154
- (connection, read) timeouts.
155
- :type _request_timeout: int, tuple(int, int), optional
156
- :param _request_auth: set to override the auth_settings for an a single
157
- request; this effectively ignores the
158
- authentication in the spec for a single request.
159
- :type _request_auth: dict, optional
160
- :param _content_type: force content-type for the request.
161
- :type _content_type: str, Optional
162
- :param _headers: set to override the headers for a single
163
- request; this effectively ignores the headers
164
- in the spec for a single request.
165
- :type _headers: dict, optional
166
- :param _host_index: set to override the host_index for a single
167
- request; this effectively ignores the host_index
168
- in the spec for a single request.
169
- :type _host_index: int, optional
170
- :return: Returns the result object.
171
- """ # noqa: E501
172
-
173
- _param = self._api_token_create_serialize(
174
- tenant=tenant,
175
- create_api_token_request=create_api_token_request,
176
- _request_auth=_request_auth,
177
- _content_type=_content_type,
178
- _headers=_headers,
179
- _host_index=_host_index,
180
- )
181
-
182
- _response_types_map: Dict[str, Optional[str]] = {
183
- "200": "CreateAPITokenResponse",
184
- "400": "APIErrors",
185
- "403": "APIErrors",
186
- }
187
- response_data = await self.api_client.call_api(
188
- *_param, _request_timeout=_request_timeout
189
- )
190
- await response_data.read()
191
- return self.api_client.response_deserialize(
192
- response_data=response_data,
193
- response_types_map=_response_types_map,
194
- )
195
-
196
- @validate_call
197
- async def api_token_create_without_preload_content(
198
- self,
199
- tenant: Annotated[
200
- str,
201
- Field(
202
- min_length=36, strict=True, max_length=36, description="The tenant id"
203
- ),
204
- ],
205
- create_api_token_request: Optional[CreateAPITokenRequest] = None,
206
- _request_timeout: Union[
207
- None,
208
- Annotated[StrictFloat, Field(gt=0)],
209
- Tuple[
210
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
211
- ],
212
- ] = None,
213
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
214
- _content_type: Optional[StrictStr] = None,
215
- _headers: Optional[Dict[StrictStr, Any]] = None,
216
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
217
- ) -> RESTResponseType:
218
- """Create API Token
219
-
220
- Create an API token for a tenant
221
-
222
- :param tenant: The tenant id (required)
223
- :type tenant: str
224
- :param create_api_token_request:
225
- :type create_api_token_request: CreateAPITokenRequest
226
- :param _request_timeout: timeout setting for this request. If one
227
- number provided, it will be total request
228
- timeout. It can also be a pair (tuple) of
229
- (connection, read) timeouts.
230
- :type _request_timeout: int, tuple(int, int), optional
231
- :param _request_auth: set to override the auth_settings for an a single
232
- request; this effectively ignores the
233
- authentication in the spec for a single request.
234
- :type _request_auth: dict, optional
235
- :param _content_type: force content-type for the request.
236
- :type _content_type: str, Optional
237
- :param _headers: set to override the headers for a single
238
- request; this effectively ignores the headers
239
- in the spec for a single request.
240
- :type _headers: dict, optional
241
- :param _host_index: set to override the host_index for a single
242
- request; this effectively ignores the host_index
243
- in the spec for a single request.
244
- :type _host_index: int, optional
245
- :return: Returns the result object.
246
- """ # noqa: E501
247
-
248
- _param = self._api_token_create_serialize(
249
- tenant=tenant,
250
- create_api_token_request=create_api_token_request,
251
- _request_auth=_request_auth,
252
- _content_type=_content_type,
253
- _headers=_headers,
254
- _host_index=_host_index,
255
- )
256
-
257
- _response_types_map: Dict[str, Optional[str]] = {
258
- "200": "CreateAPITokenResponse",
259
- "400": "APIErrors",
260
- "403": "APIErrors",
261
- }
262
- response_data = await self.api_client.call_api(
263
- *_param, _request_timeout=_request_timeout
264
- )
265
- return response_data.response
266
-
267
- def _api_token_create_serialize(
268
- self,
269
- tenant,
270
- create_api_token_request,
271
- _request_auth,
272
- _content_type,
273
- _headers,
274
- _host_index,
275
- ) -> RequestSerialized:
276
-
277
- _host = None
278
-
279
- _collection_formats: Dict[str, str] = {}
280
-
281
- _path_params: Dict[str, str] = {}
282
- _query_params: List[Tuple[str, str]] = []
283
- _header_params: Dict[str, Optional[str]] = _headers or {}
284
- _form_params: List[Tuple[str, str]] = []
285
- _files: Dict[
286
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
287
- ] = {}
288
- _body_params: Optional[bytes] = None
289
-
290
- # process the path parameters
291
- if tenant is not None:
292
- _path_params["tenant"] = tenant
293
- # process the query parameters
294
- # process the header parameters
295
- # process the form parameters
296
- # process the body parameter
297
- if create_api_token_request is not None:
298
- _body_params = create_api_token_request
299
-
300
- # set the HTTP header `Accept`
301
- if "Accept" not in _header_params:
302
- _header_params["Accept"] = self.api_client.select_header_accept(
303
- ["application/json"]
304
- )
305
-
306
- # set the HTTP header `Content-Type`
307
- if _content_type:
308
- _header_params["Content-Type"] = _content_type
309
- else:
310
- _default_content_type = self.api_client.select_header_content_type(
311
- ["application/json"]
312
- )
313
- if _default_content_type is not None:
314
- _header_params["Content-Type"] = _default_content_type
315
-
316
- # authentication setting
317
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
318
-
319
- return self.api_client.param_serialize(
320
- method="POST",
321
- resource_path="/api/v1/tenants/{tenant}/api-tokens",
322
- path_params=_path_params,
323
- query_params=_query_params,
324
- header_params=_header_params,
325
- body=_body_params,
326
- post_params=_form_params,
327
- files=_files,
328
- auth_settings=_auth_settings,
329
- collection_formats=_collection_formats,
330
- _host=_host,
331
- _request_auth=_request_auth,
332
- )
333
-
334
- @validate_call
335
- async def api_token_list(
336
- self,
337
- tenant: Annotated[
338
- str,
339
- Field(
340
- min_length=36, strict=True, max_length=36, description="The tenant id"
341
- ),
342
- ],
343
- _request_timeout: Union[
344
- None,
345
- Annotated[StrictFloat, Field(gt=0)],
346
- Tuple[
347
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
348
- ],
349
- ] = None,
350
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
351
- _content_type: Optional[StrictStr] = None,
352
- _headers: Optional[Dict[StrictStr, Any]] = None,
353
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
354
- ) -> ListAPITokensResponse:
355
- """List API Tokens
356
-
357
- List API tokens for a tenant
358
-
359
- :param tenant: The tenant id (required)
360
- :type tenant: str
361
- :param _request_timeout: timeout setting for this request. If one
362
- number provided, it will be total request
363
- timeout. It can also be a pair (tuple) of
364
- (connection, read) timeouts.
365
- :type _request_timeout: int, tuple(int, int), optional
366
- :param _request_auth: set to override the auth_settings for an a single
367
- request; this effectively ignores the
368
- authentication in the spec for a single request.
369
- :type _request_auth: dict, optional
370
- :param _content_type: force content-type for the request.
371
- :type _content_type: str, Optional
372
- :param _headers: set to override the headers for a single
373
- request; this effectively ignores the headers
374
- in the spec for a single request.
375
- :type _headers: dict, optional
376
- :param _host_index: set to override the host_index for a single
377
- request; this effectively ignores the host_index
378
- in the spec for a single request.
379
- :type _host_index: int, optional
380
- :return: Returns the result object.
381
- """ # noqa: E501
382
-
383
- _param = self._api_token_list_serialize(
384
- tenant=tenant,
385
- _request_auth=_request_auth,
386
- _content_type=_content_type,
387
- _headers=_headers,
388
- _host_index=_host_index,
389
- )
390
-
391
- _response_types_map: Dict[str, Optional[str]] = {
392
- "200": "ListAPITokensResponse",
393
- "400": "APIErrors",
394
- "403": "APIErrors",
395
- }
396
- response_data = await self.api_client.call_api(
397
- *_param, _request_timeout=_request_timeout
398
- )
399
- await response_data.read()
400
- return self.api_client.response_deserialize(
401
- response_data=response_data,
402
- response_types_map=_response_types_map,
403
- ).data
404
-
405
- @validate_call
406
- async def api_token_list_with_http_info(
407
- self,
408
- tenant: Annotated[
409
- str,
410
- Field(
411
- min_length=36, strict=True, max_length=36, description="The tenant id"
412
- ),
413
- ],
414
- _request_timeout: Union[
415
- None,
416
- Annotated[StrictFloat, Field(gt=0)],
417
- Tuple[
418
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
419
- ],
420
- ] = None,
421
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
422
- _content_type: Optional[StrictStr] = None,
423
- _headers: Optional[Dict[StrictStr, Any]] = None,
424
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
425
- ) -> ApiResponse[ListAPITokensResponse]:
426
- """List API Tokens
427
-
428
- List API tokens for a tenant
429
-
430
- :param tenant: The tenant id (required)
431
- :type tenant: str
432
- :param _request_timeout: timeout setting for this request. If one
433
- number provided, it will be total request
434
- timeout. It can also be a pair (tuple) of
435
- (connection, read) timeouts.
436
- :type _request_timeout: int, tuple(int, int), optional
437
- :param _request_auth: set to override the auth_settings for an a single
438
- request; this effectively ignores the
439
- authentication in the spec for a single request.
440
- :type _request_auth: dict, optional
441
- :param _content_type: force content-type for the request.
442
- :type _content_type: str, Optional
443
- :param _headers: set to override the headers for a single
444
- request; this effectively ignores the headers
445
- in the spec for a single request.
446
- :type _headers: dict, optional
447
- :param _host_index: set to override the host_index for a single
448
- request; this effectively ignores the host_index
449
- in the spec for a single request.
450
- :type _host_index: int, optional
451
- :return: Returns the result object.
452
- """ # noqa: E501
453
-
454
- _param = self._api_token_list_serialize(
455
- tenant=tenant,
456
- _request_auth=_request_auth,
457
- _content_type=_content_type,
458
- _headers=_headers,
459
- _host_index=_host_index,
460
- )
461
-
462
- _response_types_map: Dict[str, Optional[str]] = {
463
- "200": "ListAPITokensResponse",
464
- "400": "APIErrors",
465
- "403": "APIErrors",
466
- }
467
- response_data = await self.api_client.call_api(
468
- *_param, _request_timeout=_request_timeout
469
- )
470
- await response_data.read()
471
- return self.api_client.response_deserialize(
472
- response_data=response_data,
473
- response_types_map=_response_types_map,
474
- )
475
-
476
- @validate_call
477
- async def api_token_list_without_preload_content(
478
- self,
479
- tenant: Annotated[
480
- str,
481
- Field(
482
- min_length=36, strict=True, max_length=36, description="The tenant id"
483
- ),
484
- ],
485
- _request_timeout: Union[
486
- None,
487
- Annotated[StrictFloat, Field(gt=0)],
488
- Tuple[
489
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
490
- ],
491
- ] = None,
492
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
493
- _content_type: Optional[StrictStr] = None,
494
- _headers: Optional[Dict[StrictStr, Any]] = None,
495
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
496
- ) -> RESTResponseType:
497
- """List API Tokens
498
-
499
- List API tokens for a tenant
500
-
501
- :param tenant: The tenant id (required)
502
- :type tenant: str
503
- :param _request_timeout: timeout setting for this request. If one
504
- number provided, it will be total request
505
- timeout. It can also be a pair (tuple) of
506
- (connection, read) timeouts.
507
- :type _request_timeout: int, tuple(int, int), optional
508
- :param _request_auth: set to override the auth_settings for an a single
509
- request; this effectively ignores the
510
- authentication in the spec for a single request.
511
- :type _request_auth: dict, optional
512
- :param _content_type: force content-type for the request.
513
- :type _content_type: str, Optional
514
- :param _headers: set to override the headers for a single
515
- request; this effectively ignores the headers
516
- in the spec for a single request.
517
- :type _headers: dict, optional
518
- :param _host_index: set to override the host_index for a single
519
- request; this effectively ignores the host_index
520
- in the spec for a single request.
521
- :type _host_index: int, optional
522
- :return: Returns the result object.
523
- """ # noqa: E501
524
-
525
- _param = self._api_token_list_serialize(
526
- tenant=tenant,
527
- _request_auth=_request_auth,
528
- _content_type=_content_type,
529
- _headers=_headers,
530
- _host_index=_host_index,
531
- )
532
-
533
- _response_types_map: Dict[str, Optional[str]] = {
534
- "200": "ListAPITokensResponse",
535
- "400": "APIErrors",
536
- "403": "APIErrors",
537
- }
538
- response_data = await self.api_client.call_api(
539
- *_param, _request_timeout=_request_timeout
540
- )
541
- return response_data.response
542
-
543
- def _api_token_list_serialize(
544
- self,
545
- tenant,
546
- _request_auth,
547
- _content_type,
548
- _headers,
549
- _host_index,
550
- ) -> RequestSerialized:
551
-
552
- _host = None
553
-
554
- _collection_formats: Dict[str, str] = {}
555
-
556
- _path_params: Dict[str, str] = {}
557
- _query_params: List[Tuple[str, str]] = []
558
- _header_params: Dict[str, Optional[str]] = _headers or {}
559
- _form_params: List[Tuple[str, str]] = []
560
- _files: Dict[
561
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
562
- ] = {}
563
- _body_params: Optional[bytes] = None
564
-
565
- # process the path parameters
566
- if tenant is not None:
567
- _path_params["tenant"] = tenant
568
- # process the query parameters
569
- # process the header parameters
570
- # process the form parameters
571
- # process the body parameter
572
-
573
- # set the HTTP header `Accept`
574
- if "Accept" not in _header_params:
575
- _header_params["Accept"] = self.api_client.select_header_accept(
576
- ["application/json"]
577
- )
578
-
579
- # authentication setting
580
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
581
-
582
- return self.api_client.param_serialize(
583
- method="GET",
584
- resource_path="/api/v1/tenants/{tenant}/api-tokens",
585
- path_params=_path_params,
586
- query_params=_query_params,
587
- header_params=_header_params,
588
- body=_body_params,
589
- post_params=_form_params,
590
- files=_files,
591
- auth_settings=_auth_settings,
592
- collection_formats=_collection_formats,
593
- _host=_host,
594
- _request_auth=_request_auth,
595
- )
596
-
597
- @validate_call
598
- async def api_token_update_revoke(
599
- self,
600
- api_token: Annotated[
601
- str,
602
- Field(
603
- min_length=36, strict=True, max_length=36, description="The API token"
604
- ),
605
- ],
606
- _request_timeout: Union[
607
- None,
608
- Annotated[StrictFloat, Field(gt=0)],
609
- Tuple[
610
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
611
- ],
612
- ] = None,
613
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
614
- _content_type: Optional[StrictStr] = None,
615
- _headers: Optional[Dict[StrictStr, Any]] = None,
616
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
617
- ) -> None:
618
- """Revoke API Token
619
-
620
- Revoke an API token for a tenant
621
-
622
- :param api_token: The API token (required)
623
- :type api_token: str
624
- :param _request_timeout: timeout setting for this request. If one
625
- number provided, it will be total request
626
- timeout. It can also be a pair (tuple) of
627
- (connection, read) timeouts.
628
- :type _request_timeout: int, tuple(int, int), optional
629
- :param _request_auth: set to override the auth_settings for an a single
630
- request; this effectively ignores the
631
- authentication in the spec for a single request.
632
- :type _request_auth: dict, optional
633
- :param _content_type: force content-type for the request.
634
- :type _content_type: str, Optional
635
- :param _headers: set to override the headers for a single
636
- request; this effectively ignores the headers
637
- in the spec for a single request.
638
- :type _headers: dict, optional
639
- :param _host_index: set to override the host_index for a single
640
- request; this effectively ignores the host_index
641
- in the spec for a single request.
642
- :type _host_index: int, optional
643
- :return: Returns the result object.
644
- """ # noqa: E501
645
-
646
- _param = self._api_token_update_revoke_serialize(
647
- api_token=api_token,
648
- _request_auth=_request_auth,
649
- _content_type=_content_type,
650
- _headers=_headers,
651
- _host_index=_host_index,
652
- )
653
-
654
- _response_types_map: Dict[str, Optional[str]] = {
655
- "204": None,
656
- "400": "APIErrors",
657
- "403": "APIErrors",
658
- }
659
- response_data = await self.api_client.call_api(
660
- *_param, _request_timeout=_request_timeout
661
- )
662
- await response_data.read()
663
- return self.api_client.response_deserialize(
664
- response_data=response_data,
665
- response_types_map=_response_types_map,
666
- ).data
667
-
668
- @validate_call
669
- async def api_token_update_revoke_with_http_info(
670
- self,
671
- api_token: Annotated[
672
- str,
673
- Field(
674
- min_length=36, strict=True, max_length=36, description="The API token"
675
- ),
676
- ],
677
- _request_timeout: Union[
678
- None,
679
- Annotated[StrictFloat, Field(gt=0)],
680
- Tuple[
681
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
682
- ],
683
- ] = None,
684
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
685
- _content_type: Optional[StrictStr] = None,
686
- _headers: Optional[Dict[StrictStr, Any]] = None,
687
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
688
- ) -> ApiResponse[None]:
689
- """Revoke API Token
690
-
691
- Revoke an API token for a tenant
692
-
693
- :param api_token: The API token (required)
694
- :type api_token: str
695
- :param _request_timeout: timeout setting for this request. If one
696
- number provided, it will be total request
697
- timeout. It can also be a pair (tuple) of
698
- (connection, read) timeouts.
699
- :type _request_timeout: int, tuple(int, int), optional
700
- :param _request_auth: set to override the auth_settings for an a single
701
- request; this effectively ignores the
702
- authentication in the spec for a single request.
703
- :type _request_auth: dict, optional
704
- :param _content_type: force content-type for the request.
705
- :type _content_type: str, Optional
706
- :param _headers: set to override the headers for a single
707
- request; this effectively ignores the headers
708
- in the spec for a single request.
709
- :type _headers: dict, optional
710
- :param _host_index: set to override the host_index for a single
711
- request; this effectively ignores the host_index
712
- in the spec for a single request.
713
- :type _host_index: int, optional
714
- :return: Returns the result object.
715
- """ # noqa: E501
716
-
717
- _param = self._api_token_update_revoke_serialize(
718
- api_token=api_token,
719
- _request_auth=_request_auth,
720
- _content_type=_content_type,
721
- _headers=_headers,
722
- _host_index=_host_index,
723
- )
724
-
725
- _response_types_map: Dict[str, Optional[str]] = {
726
- "204": None,
727
- "400": "APIErrors",
728
- "403": "APIErrors",
729
- }
730
- response_data = await self.api_client.call_api(
731
- *_param, _request_timeout=_request_timeout
732
- )
733
- await response_data.read()
734
- return self.api_client.response_deserialize(
735
- response_data=response_data,
736
- response_types_map=_response_types_map,
737
- )
738
-
739
- @validate_call
740
- async def api_token_update_revoke_without_preload_content(
741
- self,
742
- api_token: Annotated[
743
- str,
744
- Field(
745
- min_length=36, strict=True, max_length=36, description="The API token"
746
- ),
747
- ],
748
- _request_timeout: Union[
749
- None,
750
- Annotated[StrictFloat, Field(gt=0)],
751
- Tuple[
752
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
753
- ],
754
- ] = None,
755
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
756
- _content_type: Optional[StrictStr] = None,
757
- _headers: Optional[Dict[StrictStr, Any]] = None,
758
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
759
- ) -> RESTResponseType:
760
- """Revoke API Token
761
-
762
- Revoke an API token for a tenant
763
-
764
- :param api_token: The API token (required)
765
- :type api_token: str
766
- :param _request_timeout: timeout setting for this request. If one
767
- number provided, it will be total request
768
- timeout. It can also be a pair (tuple) of
769
- (connection, read) timeouts.
770
- :type _request_timeout: int, tuple(int, int), optional
771
- :param _request_auth: set to override the auth_settings for an a single
772
- request; this effectively ignores the
773
- authentication in the spec for a single request.
774
- :type _request_auth: dict, optional
775
- :param _content_type: force content-type for the request.
776
- :type _content_type: str, Optional
777
- :param _headers: set to override the headers for a single
778
- request; this effectively ignores the headers
779
- in the spec for a single request.
780
- :type _headers: dict, optional
781
- :param _host_index: set to override the host_index for a single
782
- request; this effectively ignores the host_index
783
- in the spec for a single request.
784
- :type _host_index: int, optional
785
- :return: Returns the result object.
786
- """ # noqa: E501
787
-
788
- _param = self._api_token_update_revoke_serialize(
789
- api_token=api_token,
790
- _request_auth=_request_auth,
791
- _content_type=_content_type,
792
- _headers=_headers,
793
- _host_index=_host_index,
794
- )
795
-
796
- _response_types_map: Dict[str, Optional[str]] = {
797
- "204": None,
798
- "400": "APIErrors",
799
- "403": "APIErrors",
800
- }
801
- response_data = await self.api_client.call_api(
802
- *_param, _request_timeout=_request_timeout
803
- )
804
- return response_data.response
805
-
806
- def _api_token_update_revoke_serialize(
807
- self,
808
- api_token,
809
- _request_auth,
810
- _content_type,
811
- _headers,
812
- _host_index,
813
- ) -> RequestSerialized:
814
-
815
- _host = None
816
-
817
- _collection_formats: Dict[str, str] = {}
818
-
819
- _path_params: Dict[str, str] = {}
820
- _query_params: List[Tuple[str, str]] = []
821
- _header_params: Dict[str, Optional[str]] = _headers or {}
822
- _form_params: List[Tuple[str, str]] = []
823
- _files: Dict[
824
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
825
- ] = {}
826
- _body_params: Optional[bytes] = None
827
-
828
- # process the path parameters
829
- if api_token is not None:
830
- _path_params["api-token"] = api_token
831
- # process the query parameters
832
- # process the header parameters
833
- # process the form parameters
834
- # process the body parameter
835
-
836
- # set the HTTP header `Accept`
837
- if "Accept" not in _header_params:
838
- _header_params["Accept"] = self.api_client.select_header_accept(
839
- ["application/json"]
840
- )
841
-
842
- # authentication setting
843
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
844
-
845
- return self.api_client.param_serialize(
846
- method="POST",
847
- resource_path="/api/v1/api-tokens/{api-token}",
848
- path_params=_path_params,
849
- query_params=_query_params,
850
- header_params=_header_params,
851
- body=_body_params,
852
- post_params=_form_params,
853
- files=_files,
854
- auth_settings=_auth_settings,
855
- collection_formats=_collection_formats,
856
- _host=_host,
857
- _request_auth=_request_auth,
858
- )