hatchet-sdk 1.18.1__py3-none-any.whl → 1.19.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 (225) hide show
  1. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.19.0.dist-info}/METADATA +2 -3
  2. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.19.0.dist-info}/RECORD +4 -225
  3. hatchet_sdk/v0/__init__.py +0 -251
  4. hatchet_sdk/v0/client.py +0 -119
  5. hatchet_sdk/v0/clients/admin.py +0 -541
  6. hatchet_sdk/v0/clients/dispatcher/action_listener.py +0 -422
  7. hatchet_sdk/v0/clients/dispatcher/dispatcher.py +0 -204
  8. hatchet_sdk/v0/clients/event_ts.py +0 -28
  9. hatchet_sdk/v0/clients/events.py +0 -182
  10. hatchet_sdk/v0/clients/rest/__init__.py +0 -307
  11. hatchet_sdk/v0/clients/rest/api/__init__.py +0 -19
  12. hatchet_sdk/v0/clients/rest/api/api_token_api.py +0 -858
  13. hatchet_sdk/v0/clients/rest/api/default_api.py +0 -2259
  14. hatchet_sdk/v0/clients/rest/api/event_api.py +0 -2548
  15. hatchet_sdk/v0/clients/rest/api/github_api.py +0 -331
  16. hatchet_sdk/v0/clients/rest/api/healthcheck_api.py +0 -483
  17. hatchet_sdk/v0/clients/rest/api/log_api.py +0 -449
  18. hatchet_sdk/v0/clients/rest/api/metadata_api.py +0 -728
  19. hatchet_sdk/v0/clients/rest/api/rate_limits_api.py +0 -423
  20. hatchet_sdk/v0/clients/rest/api/slack_api.py +0 -577
  21. hatchet_sdk/v0/clients/rest/api/sns_api.py +0 -872
  22. hatchet_sdk/v0/clients/rest/api/step_run_api.py +0 -2202
  23. hatchet_sdk/v0/clients/rest/api/tenant_api.py +0 -4430
  24. hatchet_sdk/v0/clients/rest/api/user_api.py +0 -2888
  25. hatchet_sdk/v0/clients/rest/api/worker_api.py +0 -858
  26. hatchet_sdk/v0/clients/rest/api/workflow_api.py +0 -6312
  27. hatchet_sdk/v0/clients/rest/api/workflow_run_api.py +0 -1932
  28. hatchet_sdk/v0/clients/rest/api/workflow_runs_api.py +0 -610
  29. hatchet_sdk/v0/clients/rest/api_client.py +0 -759
  30. hatchet_sdk/v0/clients/rest/api_response.py +0 -22
  31. hatchet_sdk/v0/clients/rest/configuration.py +0 -611
  32. hatchet_sdk/v0/clients/rest/exceptions.py +0 -200
  33. hatchet_sdk/v0/clients/rest/models/__init__.py +0 -274
  34. hatchet_sdk/v0/clients/rest/models/accept_invite_request.py +0 -83
  35. hatchet_sdk/v0/clients/rest/models/api_error.py +0 -102
  36. hatchet_sdk/v0/clients/rest/models/api_errors.py +0 -100
  37. hatchet_sdk/v0/clients/rest/models/api_meta.py +0 -144
  38. hatchet_sdk/v0/clients/rest/models/api_meta_auth.py +0 -85
  39. hatchet_sdk/v0/clients/rest/models/api_meta_integration.py +0 -88
  40. hatchet_sdk/v0/clients/rest/models/api_meta_posthog.py +0 -90
  41. hatchet_sdk/v0/clients/rest/models/api_resource_meta.py +0 -98
  42. hatchet_sdk/v0/clients/rest/models/api_token.py +0 -105
  43. hatchet_sdk/v0/clients/rest/models/bulk_create_event_request.py +0 -100
  44. hatchet_sdk/v0/clients/rest/models/bulk_create_event_response.py +0 -110
  45. hatchet_sdk/v0/clients/rest/models/cancel_event_request.py +0 -85
  46. hatchet_sdk/v0/clients/rest/models/cancel_step_run_request.py +0 -83
  47. hatchet_sdk/v0/clients/rest/models/concurrency_limit_strategy.py +0 -39
  48. hatchet_sdk/v0/clients/rest/models/create_api_token_request.py +0 -92
  49. hatchet_sdk/v0/clients/rest/models/create_api_token_response.py +0 -83
  50. hatchet_sdk/v0/clients/rest/models/create_cron_workflow_trigger_request.py +0 -98
  51. hatchet_sdk/v0/clients/rest/models/create_event_request.py +0 -95
  52. hatchet_sdk/v0/clients/rest/models/create_pull_request_from_step_run.py +0 -83
  53. hatchet_sdk/v0/clients/rest/models/create_sns_integration_request.py +0 -85
  54. hatchet_sdk/v0/clients/rest/models/create_tenant_alert_email_group_request.py +0 -83
  55. hatchet_sdk/v0/clients/rest/models/create_tenant_invite_request.py +0 -86
  56. hatchet_sdk/v0/clients/rest/models/create_tenant_request.py +0 -84
  57. hatchet_sdk/v0/clients/rest/models/cron_workflows.py +0 -131
  58. hatchet_sdk/v0/clients/rest/models/cron_workflows_list.py +0 -110
  59. hatchet_sdk/v0/clients/rest/models/cron_workflows_method.py +0 -37
  60. hatchet_sdk/v0/clients/rest/models/cron_workflows_order_by_field.py +0 -37
  61. hatchet_sdk/v0/clients/rest/models/event.py +0 -143
  62. hatchet_sdk/v0/clients/rest/models/event_data.py +0 -83
  63. hatchet_sdk/v0/clients/rest/models/event_key_list.py +0 -98
  64. hatchet_sdk/v0/clients/rest/models/event_list.py +0 -110
  65. hatchet_sdk/v0/clients/rest/models/event_order_by_direction.py +0 -37
  66. hatchet_sdk/v0/clients/rest/models/event_order_by_field.py +0 -36
  67. hatchet_sdk/v0/clients/rest/models/event_update_cancel200_response.py +0 -85
  68. hatchet_sdk/v0/clients/rest/models/event_workflow_run_summary.py +0 -116
  69. hatchet_sdk/v0/clients/rest/models/events.py +0 -110
  70. hatchet_sdk/v0/clients/rest/models/get_step_run_diff_response.py +0 -100
  71. hatchet_sdk/v0/clients/rest/models/github_app_installation.py +0 -107
  72. hatchet_sdk/v0/clients/rest/models/github_branch.py +0 -86
  73. hatchet_sdk/v0/clients/rest/models/github_repo.py +0 -86
  74. hatchet_sdk/v0/clients/rest/models/info_get_version200_response.py +0 -83
  75. hatchet_sdk/v0/clients/rest/models/job.py +0 -132
  76. hatchet_sdk/v0/clients/rest/models/job_run.py +0 -176
  77. hatchet_sdk/v0/clients/rest/models/job_run_status.py +0 -41
  78. hatchet_sdk/v0/clients/rest/models/link_github_repository_request.py +0 -106
  79. hatchet_sdk/v0/clients/rest/models/list_api_tokens_response.py +0 -110
  80. hatchet_sdk/v0/clients/rest/models/list_github_app_installations_response.py +0 -112
  81. hatchet_sdk/v0/clients/rest/models/list_pull_requests_response.py +0 -100
  82. hatchet_sdk/v0/clients/rest/models/list_slack_webhooks.py +0 -110
  83. hatchet_sdk/v0/clients/rest/models/list_sns_integrations.py +0 -110
  84. hatchet_sdk/v0/clients/rest/models/log_line.py +0 -94
  85. hatchet_sdk/v0/clients/rest/models/log_line_level.py +0 -39
  86. hatchet_sdk/v0/clients/rest/models/log_line_list.py +0 -110
  87. hatchet_sdk/v0/clients/rest/models/log_line_order_by_direction.py +0 -37
  88. hatchet_sdk/v0/clients/rest/models/log_line_order_by_field.py +0 -36
  89. hatchet_sdk/v0/clients/rest/models/pagination_response.py +0 -95
  90. hatchet_sdk/v0/clients/rest/models/pull_request.py +0 -112
  91. hatchet_sdk/v0/clients/rest/models/pull_request_state.py +0 -37
  92. hatchet_sdk/v0/clients/rest/models/queue_metrics.py +0 -97
  93. hatchet_sdk/v0/clients/rest/models/rate_limit.py +0 -117
  94. hatchet_sdk/v0/clients/rest/models/rate_limit_list.py +0 -110
  95. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_direction.py +0 -37
  96. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_field.py +0 -38
  97. hatchet_sdk/v0/clients/rest/models/recent_step_runs.py +0 -118
  98. hatchet_sdk/v0/clients/rest/models/reject_invite_request.py +0 -83
  99. hatchet_sdk/v0/clients/rest/models/replay_event_request.py +0 -85
  100. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_request.py +0 -85
  101. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_response.py +0 -100
  102. hatchet_sdk/v0/clients/rest/models/rerun_step_run_request.py +0 -83
  103. hatchet_sdk/v0/clients/rest/models/schedule_workflow_run_request.py +0 -92
  104. hatchet_sdk/v0/clients/rest/models/scheduled_run_status.py +0 -42
  105. hatchet_sdk/v0/clients/rest/models/scheduled_workflows.py +0 -149
  106. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_list.py +0 -110
  107. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_method.py +0 -37
  108. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_order_by_field.py +0 -37
  109. hatchet_sdk/v0/clients/rest/models/semaphore_slots.py +0 -113
  110. hatchet_sdk/v0/clients/rest/models/slack_webhook.py +0 -127
  111. hatchet_sdk/v0/clients/rest/models/sns_integration.py +0 -114
  112. hatchet_sdk/v0/clients/rest/models/step.py +0 -123
  113. hatchet_sdk/v0/clients/rest/models/step_run.py +0 -202
  114. hatchet_sdk/v0/clients/rest/models/step_run_archive.py +0 -142
  115. hatchet_sdk/v0/clients/rest/models/step_run_archive_list.py +0 -110
  116. hatchet_sdk/v0/clients/rest/models/step_run_diff.py +0 -91
  117. hatchet_sdk/v0/clients/rest/models/step_run_event.py +0 -122
  118. hatchet_sdk/v0/clients/rest/models/step_run_event_list.py +0 -110
  119. hatchet_sdk/v0/clients/rest/models/step_run_event_reason.py +0 -52
  120. hatchet_sdk/v0/clients/rest/models/step_run_event_severity.py +0 -38
  121. hatchet_sdk/v0/clients/rest/models/step_run_status.py +0 -44
  122. hatchet_sdk/v0/clients/rest/models/tenant.py +0 -118
  123. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group.py +0 -98
  124. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group_list.py +0 -112
  125. hatchet_sdk/v0/clients/rest/models/tenant_alerting_settings.py +0 -143
  126. hatchet_sdk/v0/clients/rest/models/tenant_invite.py +0 -120
  127. hatchet_sdk/v0/clients/rest/models/tenant_invite_list.py +0 -110
  128. hatchet_sdk/v0/clients/rest/models/tenant_list.py +0 -110
  129. hatchet_sdk/v0/clients/rest/models/tenant_member.py +0 -123
  130. hatchet_sdk/v0/clients/rest/models/tenant_member_list.py +0 -110
  131. hatchet_sdk/v0/clients/rest/models/tenant_member_role.py +0 -38
  132. hatchet_sdk/v0/clients/rest/models/tenant_queue_metrics.py +0 -116
  133. hatchet_sdk/v0/clients/rest/models/tenant_resource.py +0 -40
  134. hatchet_sdk/v0/clients/rest/models/tenant_resource_limit.py +0 -135
  135. hatchet_sdk/v0/clients/rest/models/tenant_resource_policy.py +0 -102
  136. hatchet_sdk/v0/clients/rest/models/tenant_step_run_queue_metrics.py +0 -83
  137. hatchet_sdk/v0/clients/rest/models/trigger_workflow_run_request.py +0 -91
  138. hatchet_sdk/v0/clients/rest/models/update_tenant_alert_email_group_request.py +0 -83
  139. hatchet_sdk/v0/clients/rest/models/update_tenant_invite_request.py +0 -85
  140. hatchet_sdk/v0/clients/rest/models/update_tenant_request.py +0 -137
  141. hatchet_sdk/v0/clients/rest/models/update_worker_request.py +0 -87
  142. hatchet_sdk/v0/clients/rest/models/user.py +0 -126
  143. hatchet_sdk/v0/clients/rest/models/user_change_password_request.py +0 -88
  144. hatchet_sdk/v0/clients/rest/models/user_login_request.py +0 -86
  145. hatchet_sdk/v0/clients/rest/models/user_register_request.py +0 -91
  146. hatchet_sdk/v0/clients/rest/models/user_tenant_memberships_list.py +0 -110
  147. hatchet_sdk/v0/clients/rest/models/user_tenant_public.py +0 -86
  148. hatchet_sdk/v0/clients/rest/models/webhook_worker.py +0 -100
  149. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_request.py +0 -94
  150. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_response.py +0 -98
  151. hatchet_sdk/v0/clients/rest/models/webhook_worker_created.py +0 -102
  152. hatchet_sdk/v0/clients/rest/models/webhook_worker_list_response.py +0 -110
  153. hatchet_sdk/v0/clients/rest/models/webhook_worker_request.py +0 -102
  154. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_list_response.py +0 -104
  155. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_method.py +0 -38
  156. hatchet_sdk/v0/clients/rest/models/worker.py +0 -239
  157. hatchet_sdk/v0/clients/rest/models/worker_label.py +0 -102
  158. hatchet_sdk/v0/clients/rest/models/worker_list.py +0 -110
  159. hatchet_sdk/v0/clients/rest/models/worker_runtime_info.py +0 -103
  160. hatchet_sdk/v0/clients/rest/models/worker_runtime_sdks.py +0 -38
  161. hatchet_sdk/v0/clients/rest/models/worker_type.py +0 -38
  162. hatchet_sdk/v0/clients/rest/models/workflow.py +0 -165
  163. hatchet_sdk/v0/clients/rest/models/workflow_concurrency.py +0 -107
  164. hatchet_sdk/v0/clients/rest/models/workflow_deployment_config.py +0 -136
  165. hatchet_sdk/v0/clients/rest/models/workflow_kind.py +0 -38
  166. hatchet_sdk/v0/clients/rest/models/workflow_list.py +0 -120
  167. hatchet_sdk/v0/clients/rest/models/workflow_metrics.py +0 -97
  168. hatchet_sdk/v0/clients/rest/models/workflow_run.py +0 -188
  169. hatchet_sdk/v0/clients/rest/models/workflow_run_cancel200_response.py +0 -85
  170. hatchet_sdk/v0/clients/rest/models/workflow_run_list.py +0 -110
  171. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_direction.py +0 -37
  172. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_field.py +0 -39
  173. hatchet_sdk/v0/clients/rest/models/workflow_run_shape.py +0 -186
  174. hatchet_sdk/v0/clients/rest/models/workflow_run_status.py +0 -42
  175. hatchet_sdk/v0/clients/rest/models/workflow_run_triggered_by.py +0 -112
  176. hatchet_sdk/v0/clients/rest/models/workflow_runs_cancel_request.py +0 -85
  177. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics.py +0 -94
  178. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics_counts.py +0 -104
  179. hatchet_sdk/v0/clients/rest/models/workflow_tag.py +0 -84
  180. hatchet_sdk/v0/clients/rest/models/workflow_trigger_cron_ref.py +0 -86
  181. hatchet_sdk/v0/clients/rest/models/workflow_trigger_event_ref.py +0 -86
  182. hatchet_sdk/v0/clients/rest/models/workflow_triggers.py +0 -141
  183. hatchet_sdk/v0/clients/rest/models/workflow_update_request.py +0 -85
  184. hatchet_sdk/v0/clients/rest/models/workflow_version.py +0 -170
  185. hatchet_sdk/v0/clients/rest/models/workflow_version_concurrency.py +0 -114
  186. hatchet_sdk/v0/clients/rest/models/workflow_version_definition.py +0 -85
  187. hatchet_sdk/v0/clients/rest/models/workflow_version_meta.py +0 -123
  188. hatchet_sdk/v0/clients/rest/models/workflow_workers_count.py +0 -95
  189. hatchet_sdk/v0/clients/rest/rest.py +0 -187
  190. hatchet_sdk/v0/clients/rest/tenacity_utils.py +0 -39
  191. hatchet_sdk/v0/clients/rest_client.py +0 -622
  192. hatchet_sdk/v0/clients/run_event_listener.py +0 -260
  193. hatchet_sdk/v0/clients/workflow_listener.py +0 -277
  194. hatchet_sdk/v0/connection.py +0 -63
  195. hatchet_sdk/v0/context/__init__.py +0 -1
  196. hatchet_sdk/v0/context/context.py +0 -446
  197. hatchet_sdk/v0/context/worker_context.py +0 -28
  198. hatchet_sdk/v0/features/cron.py +0 -286
  199. hatchet_sdk/v0/features/scheduled.py +0 -248
  200. hatchet_sdk/v0/hatchet.py +0 -310
  201. hatchet_sdk/v0/labels.py +0 -10
  202. hatchet_sdk/v0/loader.py +0 -244
  203. hatchet_sdk/v0/metadata.py +0 -2
  204. hatchet_sdk/v0/opentelemetry/instrumentor.py +0 -393
  205. hatchet_sdk/v0/rate_limit.py +0 -126
  206. hatchet_sdk/v0/semver.py +0 -30
  207. hatchet_sdk/v0/token.py +0 -27
  208. hatchet_sdk/v0/utils/aio_utils.py +0 -137
  209. hatchet_sdk/v0/utils/backoff.py +0 -9
  210. hatchet_sdk/v0/utils/types.py +0 -8
  211. hatchet_sdk/v0/utils/typing.py +0 -12
  212. hatchet_sdk/v0/v2/callable.py +0 -202
  213. hatchet_sdk/v0/v2/concurrency.py +0 -47
  214. hatchet_sdk/v0/v2/hatchet.py +0 -224
  215. hatchet_sdk/v0/worker/__init__.py +0 -1
  216. hatchet_sdk/v0/worker/action_listener_process.py +0 -294
  217. hatchet_sdk/v0/worker/runner/run_loop_manager.py +0 -112
  218. hatchet_sdk/v0/worker/runner/runner.py +0 -460
  219. hatchet_sdk/v0/worker/runner/utils/capture_logs.py +0 -81
  220. hatchet_sdk/v0/worker/runner/utils/error_with_traceback.py +0 -6
  221. hatchet_sdk/v0/worker/worker.py +0 -391
  222. hatchet_sdk/v0/workflow.py +0 -261
  223. hatchet_sdk/v0/workflow_run.py +0 -59
  224. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.19.0.dist-info}/WHEEL +0 -0
  225. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.19.0.dist-info}/entry_points.txt +0 -0
@@ -1,4430 +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.accept_invite_request import AcceptInviteRequest
23
- from hatchet_sdk.v0.clients.rest.models.create_tenant_alert_email_group_request import (
24
- CreateTenantAlertEmailGroupRequest,
25
- )
26
- from hatchet_sdk.v0.clients.rest.models.create_tenant_invite_request import (
27
- CreateTenantInviteRequest,
28
- )
29
- from hatchet_sdk.v0.clients.rest.models.create_tenant_request import CreateTenantRequest
30
- from hatchet_sdk.v0.clients.rest.models.reject_invite_request import RejectInviteRequest
31
- from hatchet_sdk.v0.clients.rest.models.tenant import Tenant
32
- from hatchet_sdk.v0.clients.rest.models.tenant_alert_email_group import (
33
- TenantAlertEmailGroup,
34
- )
35
- from hatchet_sdk.v0.clients.rest.models.tenant_alert_email_group_list import (
36
- TenantAlertEmailGroupList,
37
- )
38
- from hatchet_sdk.v0.clients.rest.models.tenant_alerting_settings import (
39
- TenantAlertingSettings,
40
- )
41
- from hatchet_sdk.v0.clients.rest.models.tenant_invite import TenantInvite
42
- from hatchet_sdk.v0.clients.rest.models.tenant_invite_list import TenantInviteList
43
- from hatchet_sdk.v0.clients.rest.models.tenant_member import TenantMember
44
- from hatchet_sdk.v0.clients.rest.models.tenant_member_list import TenantMemberList
45
- from hatchet_sdk.v0.clients.rest.models.tenant_resource_policy import (
46
- TenantResourcePolicy,
47
- )
48
- from hatchet_sdk.v0.clients.rest.models.tenant_step_run_queue_metrics import (
49
- TenantStepRunQueueMetrics,
50
- )
51
- from hatchet_sdk.v0.clients.rest.models.update_tenant_alert_email_group_request import (
52
- UpdateTenantAlertEmailGroupRequest,
53
- )
54
- from hatchet_sdk.v0.clients.rest.models.update_tenant_request import UpdateTenantRequest
55
- from hatchet_sdk.v0.clients.rest.rest import RESTResponseType
56
-
57
-
58
- class TenantApi:
59
- """NOTE: This class is auto generated by OpenAPI Generator
60
- Ref: https://openapi-generator.tech
61
-
62
- Do not edit the class manually.
63
- """
64
-
65
- def __init__(self, api_client=None) -> None:
66
- if api_client is None:
67
- api_client = ApiClient.get_default()
68
- self.api_client = api_client
69
-
70
- @validate_call
71
- async def alert_email_group_create(
72
- self,
73
- tenant: Annotated[
74
- str,
75
- Field(
76
- min_length=36, strict=True, max_length=36, description="The tenant id"
77
- ),
78
- ],
79
- create_tenant_alert_email_group_request: Annotated[
80
- CreateTenantAlertEmailGroupRequest,
81
- Field(description="The tenant alert email group to create"),
82
- ],
83
- _request_timeout: Union[
84
- None,
85
- Annotated[StrictFloat, Field(gt=0)],
86
- Tuple[
87
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
88
- ],
89
- ] = None,
90
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
91
- _content_type: Optional[StrictStr] = None,
92
- _headers: Optional[Dict[StrictStr, Any]] = None,
93
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
94
- ) -> TenantAlertEmailGroup:
95
- """Create tenant alert email group
96
-
97
- Creates a new tenant alert email group
98
-
99
- :param tenant: The tenant id (required)
100
- :type tenant: str
101
- :param create_tenant_alert_email_group_request: The tenant alert email group to create (required)
102
- :type create_tenant_alert_email_group_request: CreateTenantAlertEmailGroupRequest
103
- :param _request_timeout: timeout setting for this request. If one
104
- number provided, it will be total request
105
- timeout. It can also be a pair (tuple) of
106
- (connection, read) timeouts.
107
- :type _request_timeout: int, tuple(int, int), optional
108
- :param _request_auth: set to override the auth_settings for an a single
109
- request; this effectively ignores the
110
- authentication in the spec for a single request.
111
- :type _request_auth: dict, optional
112
- :param _content_type: force content-type for the request.
113
- :type _content_type: str, Optional
114
- :param _headers: set to override the headers for a single
115
- request; this effectively ignores the headers
116
- in the spec for a single request.
117
- :type _headers: dict, optional
118
- :param _host_index: set to override the host_index for a single
119
- request; this effectively ignores the host_index
120
- in the spec for a single request.
121
- :type _host_index: int, optional
122
- :return: Returns the result object.
123
- """ # noqa: E501
124
-
125
- _param = self._alert_email_group_create_serialize(
126
- tenant=tenant,
127
- create_tenant_alert_email_group_request=create_tenant_alert_email_group_request,
128
- _request_auth=_request_auth,
129
- _content_type=_content_type,
130
- _headers=_headers,
131
- _host_index=_host_index,
132
- )
133
-
134
- _response_types_map: Dict[str, Optional[str]] = {
135
- "201": "TenantAlertEmailGroup",
136
- "400": "APIErrors",
137
- "403": "APIError",
138
- }
139
- response_data = await self.api_client.call_api(
140
- *_param, _request_timeout=_request_timeout
141
- )
142
- await response_data.read()
143
- return self.api_client.response_deserialize(
144
- response_data=response_data,
145
- response_types_map=_response_types_map,
146
- ).data
147
-
148
- @validate_call
149
- async def alert_email_group_create_with_http_info(
150
- self,
151
- tenant: Annotated[
152
- str,
153
- Field(
154
- min_length=36, strict=True, max_length=36, description="The tenant id"
155
- ),
156
- ],
157
- create_tenant_alert_email_group_request: Annotated[
158
- CreateTenantAlertEmailGroupRequest,
159
- Field(description="The tenant alert email group to create"),
160
- ],
161
- _request_timeout: Union[
162
- None,
163
- Annotated[StrictFloat, Field(gt=0)],
164
- Tuple[
165
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
166
- ],
167
- ] = None,
168
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
169
- _content_type: Optional[StrictStr] = None,
170
- _headers: Optional[Dict[StrictStr, Any]] = None,
171
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
172
- ) -> ApiResponse[TenantAlertEmailGroup]:
173
- """Create tenant alert email group
174
-
175
- Creates a new tenant alert email group
176
-
177
- :param tenant: The tenant id (required)
178
- :type tenant: str
179
- :param create_tenant_alert_email_group_request: The tenant alert email group to create (required)
180
- :type create_tenant_alert_email_group_request: CreateTenantAlertEmailGroupRequest
181
- :param _request_timeout: timeout setting for this request. If one
182
- number provided, it will be total request
183
- timeout. It can also be a pair (tuple) of
184
- (connection, read) timeouts.
185
- :type _request_timeout: int, tuple(int, int), optional
186
- :param _request_auth: set to override the auth_settings for an a single
187
- request; this effectively ignores the
188
- authentication in the spec for a single request.
189
- :type _request_auth: dict, optional
190
- :param _content_type: force content-type for the request.
191
- :type _content_type: str, Optional
192
- :param _headers: set to override the headers for a single
193
- request; this effectively ignores the headers
194
- in the spec for a single request.
195
- :type _headers: dict, optional
196
- :param _host_index: set to override the host_index for a single
197
- request; this effectively ignores the host_index
198
- in the spec for a single request.
199
- :type _host_index: int, optional
200
- :return: Returns the result object.
201
- """ # noqa: E501
202
-
203
- _param = self._alert_email_group_create_serialize(
204
- tenant=tenant,
205
- create_tenant_alert_email_group_request=create_tenant_alert_email_group_request,
206
- _request_auth=_request_auth,
207
- _content_type=_content_type,
208
- _headers=_headers,
209
- _host_index=_host_index,
210
- )
211
-
212
- _response_types_map: Dict[str, Optional[str]] = {
213
- "201": "TenantAlertEmailGroup",
214
- "400": "APIErrors",
215
- "403": "APIError",
216
- }
217
- response_data = await self.api_client.call_api(
218
- *_param, _request_timeout=_request_timeout
219
- )
220
- await response_data.read()
221
- return self.api_client.response_deserialize(
222
- response_data=response_data,
223
- response_types_map=_response_types_map,
224
- )
225
-
226
- @validate_call
227
- async def alert_email_group_create_without_preload_content(
228
- self,
229
- tenant: Annotated[
230
- str,
231
- Field(
232
- min_length=36, strict=True, max_length=36, description="The tenant id"
233
- ),
234
- ],
235
- create_tenant_alert_email_group_request: Annotated[
236
- CreateTenantAlertEmailGroupRequest,
237
- Field(description="The tenant alert email group to create"),
238
- ],
239
- _request_timeout: Union[
240
- None,
241
- Annotated[StrictFloat, Field(gt=0)],
242
- Tuple[
243
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
244
- ],
245
- ] = None,
246
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
247
- _content_type: Optional[StrictStr] = None,
248
- _headers: Optional[Dict[StrictStr, Any]] = None,
249
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
250
- ) -> RESTResponseType:
251
- """Create tenant alert email group
252
-
253
- Creates a new tenant alert email group
254
-
255
- :param tenant: The tenant id (required)
256
- :type tenant: str
257
- :param create_tenant_alert_email_group_request: The tenant alert email group to create (required)
258
- :type create_tenant_alert_email_group_request: CreateTenantAlertEmailGroupRequest
259
- :param _request_timeout: timeout setting for this request. If one
260
- number provided, it will be total request
261
- timeout. It can also be a pair (tuple) of
262
- (connection, read) timeouts.
263
- :type _request_timeout: int, tuple(int, int), optional
264
- :param _request_auth: set to override the auth_settings for an a single
265
- request; this effectively ignores the
266
- authentication in the spec for a single request.
267
- :type _request_auth: dict, optional
268
- :param _content_type: force content-type for the request.
269
- :type _content_type: str, Optional
270
- :param _headers: set to override the headers for a single
271
- request; this effectively ignores the headers
272
- in the spec for a single request.
273
- :type _headers: dict, optional
274
- :param _host_index: set to override the host_index for a single
275
- request; this effectively ignores the host_index
276
- in the spec for a single request.
277
- :type _host_index: int, optional
278
- :return: Returns the result object.
279
- """ # noqa: E501
280
-
281
- _param = self._alert_email_group_create_serialize(
282
- tenant=tenant,
283
- create_tenant_alert_email_group_request=create_tenant_alert_email_group_request,
284
- _request_auth=_request_auth,
285
- _content_type=_content_type,
286
- _headers=_headers,
287
- _host_index=_host_index,
288
- )
289
-
290
- _response_types_map: Dict[str, Optional[str]] = {
291
- "201": "TenantAlertEmailGroup",
292
- "400": "APIErrors",
293
- "403": "APIError",
294
- }
295
- response_data = await self.api_client.call_api(
296
- *_param, _request_timeout=_request_timeout
297
- )
298
- return response_data.response
299
-
300
- def _alert_email_group_create_serialize(
301
- self,
302
- tenant,
303
- create_tenant_alert_email_group_request,
304
- _request_auth,
305
- _content_type,
306
- _headers,
307
- _host_index,
308
- ) -> RequestSerialized:
309
-
310
- _host = None
311
-
312
- _collection_formats: Dict[str, str] = {}
313
-
314
- _path_params: Dict[str, str] = {}
315
- _query_params: List[Tuple[str, str]] = []
316
- _header_params: Dict[str, Optional[str]] = _headers or {}
317
- _form_params: List[Tuple[str, str]] = []
318
- _files: Dict[
319
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
320
- ] = {}
321
- _body_params: Optional[bytes] = None
322
-
323
- # process the path parameters
324
- if tenant is not None:
325
- _path_params["tenant"] = tenant
326
- # process the query parameters
327
- # process the header parameters
328
- # process the form parameters
329
- # process the body parameter
330
- if create_tenant_alert_email_group_request is not None:
331
- _body_params = create_tenant_alert_email_group_request
332
-
333
- # set the HTTP header `Accept`
334
- if "Accept" not in _header_params:
335
- _header_params["Accept"] = self.api_client.select_header_accept(
336
- ["application/json"]
337
- )
338
-
339
- # set the HTTP header `Content-Type`
340
- if _content_type:
341
- _header_params["Content-Type"] = _content_type
342
- else:
343
- _default_content_type = self.api_client.select_header_content_type(
344
- ["application/json"]
345
- )
346
- if _default_content_type is not None:
347
- _header_params["Content-Type"] = _default_content_type
348
-
349
- # authentication setting
350
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
351
-
352
- return self.api_client.param_serialize(
353
- method="POST",
354
- resource_path="/api/v1/tenants/{tenant}/alerting-email-groups",
355
- path_params=_path_params,
356
- query_params=_query_params,
357
- header_params=_header_params,
358
- body=_body_params,
359
- post_params=_form_params,
360
- files=_files,
361
- auth_settings=_auth_settings,
362
- collection_formats=_collection_formats,
363
- _host=_host,
364
- _request_auth=_request_auth,
365
- )
366
-
367
- @validate_call
368
- async def alert_email_group_delete(
369
- self,
370
- alert_email_group: Annotated[
371
- str,
372
- Field(
373
- min_length=36,
374
- strict=True,
375
- max_length=36,
376
- description="The tenant alert email group id",
377
- ),
378
- ],
379
- _request_timeout: Union[
380
- None,
381
- Annotated[StrictFloat, Field(gt=0)],
382
- Tuple[
383
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
384
- ],
385
- ] = None,
386
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
387
- _content_type: Optional[StrictStr] = None,
388
- _headers: Optional[Dict[StrictStr, Any]] = None,
389
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
390
- ) -> None:
391
- """Delete tenant alert email group
392
-
393
- Deletes a tenant alert email group
394
-
395
- :param alert_email_group: The tenant alert email group id (required)
396
- :type alert_email_group: str
397
- :param _request_timeout: timeout setting for this request. If one
398
- number provided, it will be total request
399
- timeout. It can also be a pair (tuple) of
400
- (connection, read) timeouts.
401
- :type _request_timeout: int, tuple(int, int), optional
402
- :param _request_auth: set to override the auth_settings for an a single
403
- request; this effectively ignores the
404
- authentication in the spec for a single request.
405
- :type _request_auth: dict, optional
406
- :param _content_type: force content-type for the request.
407
- :type _content_type: str, Optional
408
- :param _headers: set to override the headers for a single
409
- request; this effectively ignores the headers
410
- in the spec for a single request.
411
- :type _headers: dict, optional
412
- :param _host_index: set to override the host_index for a single
413
- request; this effectively ignores the host_index
414
- in the spec for a single request.
415
- :type _host_index: int, optional
416
- :return: Returns the result object.
417
- """ # noqa: E501
418
-
419
- _param = self._alert_email_group_delete_serialize(
420
- alert_email_group=alert_email_group,
421
- _request_auth=_request_auth,
422
- _content_type=_content_type,
423
- _headers=_headers,
424
- _host_index=_host_index,
425
- )
426
-
427
- _response_types_map: Dict[str, Optional[str]] = {
428
- "204": None,
429
- "400": "APIErrors",
430
- "403": "APIError",
431
- }
432
- response_data = await self.api_client.call_api(
433
- *_param, _request_timeout=_request_timeout
434
- )
435
- await response_data.read()
436
- return self.api_client.response_deserialize(
437
- response_data=response_data,
438
- response_types_map=_response_types_map,
439
- ).data
440
-
441
- @validate_call
442
- async def alert_email_group_delete_with_http_info(
443
- self,
444
- alert_email_group: Annotated[
445
- str,
446
- Field(
447
- min_length=36,
448
- strict=True,
449
- max_length=36,
450
- description="The tenant alert email group id",
451
- ),
452
- ],
453
- _request_timeout: Union[
454
- None,
455
- Annotated[StrictFloat, Field(gt=0)],
456
- Tuple[
457
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
458
- ],
459
- ] = None,
460
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
461
- _content_type: Optional[StrictStr] = None,
462
- _headers: Optional[Dict[StrictStr, Any]] = None,
463
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
464
- ) -> ApiResponse[None]:
465
- """Delete tenant alert email group
466
-
467
- Deletes a tenant alert email group
468
-
469
- :param alert_email_group: The tenant alert email group id (required)
470
- :type alert_email_group: str
471
- :param _request_timeout: timeout setting for this request. If one
472
- number provided, it will be total request
473
- timeout. It can also be a pair (tuple) of
474
- (connection, read) timeouts.
475
- :type _request_timeout: int, tuple(int, int), optional
476
- :param _request_auth: set to override the auth_settings for an a single
477
- request; this effectively ignores the
478
- authentication in the spec for a single request.
479
- :type _request_auth: dict, optional
480
- :param _content_type: force content-type for the request.
481
- :type _content_type: str, Optional
482
- :param _headers: set to override the headers for a single
483
- request; this effectively ignores the headers
484
- in the spec for a single request.
485
- :type _headers: dict, optional
486
- :param _host_index: set to override the host_index for a single
487
- request; this effectively ignores the host_index
488
- in the spec for a single request.
489
- :type _host_index: int, optional
490
- :return: Returns the result object.
491
- """ # noqa: E501
492
-
493
- _param = self._alert_email_group_delete_serialize(
494
- alert_email_group=alert_email_group,
495
- _request_auth=_request_auth,
496
- _content_type=_content_type,
497
- _headers=_headers,
498
- _host_index=_host_index,
499
- )
500
-
501
- _response_types_map: Dict[str, Optional[str]] = {
502
- "204": None,
503
- "400": "APIErrors",
504
- "403": "APIError",
505
- }
506
- response_data = await self.api_client.call_api(
507
- *_param, _request_timeout=_request_timeout
508
- )
509
- await response_data.read()
510
- return self.api_client.response_deserialize(
511
- response_data=response_data,
512
- response_types_map=_response_types_map,
513
- )
514
-
515
- @validate_call
516
- async def alert_email_group_delete_without_preload_content(
517
- self,
518
- alert_email_group: Annotated[
519
- str,
520
- Field(
521
- min_length=36,
522
- strict=True,
523
- max_length=36,
524
- description="The tenant alert email group id",
525
- ),
526
- ],
527
- _request_timeout: Union[
528
- None,
529
- Annotated[StrictFloat, Field(gt=0)],
530
- Tuple[
531
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
532
- ],
533
- ] = None,
534
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
535
- _content_type: Optional[StrictStr] = None,
536
- _headers: Optional[Dict[StrictStr, Any]] = None,
537
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
538
- ) -> RESTResponseType:
539
- """Delete tenant alert email group
540
-
541
- Deletes a tenant alert email group
542
-
543
- :param alert_email_group: The tenant alert email group id (required)
544
- :type alert_email_group: str
545
- :param _request_timeout: timeout setting for this request. If one
546
- number provided, it will be total request
547
- timeout. It can also be a pair (tuple) of
548
- (connection, read) timeouts.
549
- :type _request_timeout: int, tuple(int, int), optional
550
- :param _request_auth: set to override the auth_settings for an a single
551
- request; this effectively ignores the
552
- authentication in the spec for a single request.
553
- :type _request_auth: dict, optional
554
- :param _content_type: force content-type for the request.
555
- :type _content_type: str, Optional
556
- :param _headers: set to override the headers for a single
557
- request; this effectively ignores the headers
558
- in the spec for a single request.
559
- :type _headers: dict, optional
560
- :param _host_index: set to override the host_index for a single
561
- request; this effectively ignores the host_index
562
- in the spec for a single request.
563
- :type _host_index: int, optional
564
- :return: Returns the result object.
565
- """ # noqa: E501
566
-
567
- _param = self._alert_email_group_delete_serialize(
568
- alert_email_group=alert_email_group,
569
- _request_auth=_request_auth,
570
- _content_type=_content_type,
571
- _headers=_headers,
572
- _host_index=_host_index,
573
- )
574
-
575
- _response_types_map: Dict[str, Optional[str]] = {
576
- "204": None,
577
- "400": "APIErrors",
578
- "403": "APIError",
579
- }
580
- response_data = await self.api_client.call_api(
581
- *_param, _request_timeout=_request_timeout
582
- )
583
- return response_data.response
584
-
585
- def _alert_email_group_delete_serialize(
586
- self,
587
- alert_email_group,
588
- _request_auth,
589
- _content_type,
590
- _headers,
591
- _host_index,
592
- ) -> RequestSerialized:
593
-
594
- _host = None
595
-
596
- _collection_formats: Dict[str, str] = {}
597
-
598
- _path_params: Dict[str, str] = {}
599
- _query_params: List[Tuple[str, str]] = []
600
- _header_params: Dict[str, Optional[str]] = _headers or {}
601
- _form_params: List[Tuple[str, str]] = []
602
- _files: Dict[
603
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
604
- ] = {}
605
- _body_params: Optional[bytes] = None
606
-
607
- # process the path parameters
608
- if alert_email_group is not None:
609
- _path_params["alert-email-group"] = alert_email_group
610
- # process the query parameters
611
- # process the header parameters
612
- # process the form parameters
613
- # process the body parameter
614
-
615
- # set the HTTP header `Accept`
616
- if "Accept" not in _header_params:
617
- _header_params["Accept"] = self.api_client.select_header_accept(
618
- ["application/json"]
619
- )
620
-
621
- # authentication setting
622
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
623
-
624
- return self.api_client.param_serialize(
625
- method="DELETE",
626
- resource_path="/api/v1/alerting-email-groups/{alert-email-group}",
627
- path_params=_path_params,
628
- query_params=_query_params,
629
- header_params=_header_params,
630
- body=_body_params,
631
- post_params=_form_params,
632
- files=_files,
633
- auth_settings=_auth_settings,
634
- collection_formats=_collection_formats,
635
- _host=_host,
636
- _request_auth=_request_auth,
637
- )
638
-
639
- @validate_call
640
- async def alert_email_group_list(
641
- self,
642
- tenant: Annotated[
643
- str,
644
- Field(
645
- min_length=36, strict=True, max_length=36, description="The tenant id"
646
- ),
647
- ],
648
- _request_timeout: Union[
649
- None,
650
- Annotated[StrictFloat, Field(gt=0)],
651
- Tuple[
652
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
653
- ],
654
- ] = None,
655
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
656
- _content_type: Optional[StrictStr] = None,
657
- _headers: Optional[Dict[StrictStr, Any]] = None,
658
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
659
- ) -> TenantAlertEmailGroupList:
660
- """List tenant alert email groups
661
-
662
- Gets a list of tenant alert email groups
663
-
664
- :param tenant: The tenant id (required)
665
- :type tenant: str
666
- :param _request_timeout: timeout setting for this request. If one
667
- number provided, it will be total request
668
- timeout. It can also be a pair (tuple) of
669
- (connection, read) timeouts.
670
- :type _request_timeout: int, tuple(int, int), optional
671
- :param _request_auth: set to override the auth_settings for an a single
672
- request; this effectively ignores the
673
- authentication in the spec for a single request.
674
- :type _request_auth: dict, optional
675
- :param _content_type: force content-type for the request.
676
- :type _content_type: str, Optional
677
- :param _headers: set to override the headers for a single
678
- request; this effectively ignores the headers
679
- in the spec for a single request.
680
- :type _headers: dict, optional
681
- :param _host_index: set to override the host_index for a single
682
- request; this effectively ignores the host_index
683
- in the spec for a single request.
684
- :type _host_index: int, optional
685
- :return: Returns the result object.
686
- """ # noqa: E501
687
-
688
- _param = self._alert_email_group_list_serialize(
689
- tenant=tenant,
690
- _request_auth=_request_auth,
691
- _content_type=_content_type,
692
- _headers=_headers,
693
- _host_index=_host_index,
694
- )
695
-
696
- _response_types_map: Dict[str, Optional[str]] = {
697
- "200": "TenantAlertEmailGroupList",
698
- "400": "APIErrors",
699
- "403": "APIError",
700
- }
701
- response_data = await self.api_client.call_api(
702
- *_param, _request_timeout=_request_timeout
703
- )
704
- await response_data.read()
705
- return self.api_client.response_deserialize(
706
- response_data=response_data,
707
- response_types_map=_response_types_map,
708
- ).data
709
-
710
- @validate_call
711
- async def alert_email_group_list_with_http_info(
712
- self,
713
- tenant: Annotated[
714
- str,
715
- Field(
716
- min_length=36, strict=True, max_length=36, description="The tenant id"
717
- ),
718
- ],
719
- _request_timeout: Union[
720
- None,
721
- Annotated[StrictFloat, Field(gt=0)],
722
- Tuple[
723
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
724
- ],
725
- ] = None,
726
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
727
- _content_type: Optional[StrictStr] = None,
728
- _headers: Optional[Dict[StrictStr, Any]] = None,
729
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
730
- ) -> ApiResponse[TenantAlertEmailGroupList]:
731
- """List tenant alert email groups
732
-
733
- Gets a list of tenant alert email groups
734
-
735
- :param tenant: The tenant id (required)
736
- :type tenant: str
737
- :param _request_timeout: timeout setting for this request. If one
738
- number provided, it will be total request
739
- timeout. It can also be a pair (tuple) of
740
- (connection, read) timeouts.
741
- :type _request_timeout: int, tuple(int, int), optional
742
- :param _request_auth: set to override the auth_settings for an a single
743
- request; this effectively ignores the
744
- authentication in the spec for a single request.
745
- :type _request_auth: dict, optional
746
- :param _content_type: force content-type for the request.
747
- :type _content_type: str, Optional
748
- :param _headers: set to override the headers for a single
749
- request; this effectively ignores the headers
750
- in the spec for a single request.
751
- :type _headers: dict, optional
752
- :param _host_index: set to override the host_index for a single
753
- request; this effectively ignores the host_index
754
- in the spec for a single request.
755
- :type _host_index: int, optional
756
- :return: Returns the result object.
757
- """ # noqa: E501
758
-
759
- _param = self._alert_email_group_list_serialize(
760
- tenant=tenant,
761
- _request_auth=_request_auth,
762
- _content_type=_content_type,
763
- _headers=_headers,
764
- _host_index=_host_index,
765
- )
766
-
767
- _response_types_map: Dict[str, Optional[str]] = {
768
- "200": "TenantAlertEmailGroupList",
769
- "400": "APIErrors",
770
- "403": "APIError",
771
- }
772
- response_data = await self.api_client.call_api(
773
- *_param, _request_timeout=_request_timeout
774
- )
775
- await response_data.read()
776
- return self.api_client.response_deserialize(
777
- response_data=response_data,
778
- response_types_map=_response_types_map,
779
- )
780
-
781
- @validate_call
782
- async def alert_email_group_list_without_preload_content(
783
- self,
784
- tenant: Annotated[
785
- str,
786
- Field(
787
- min_length=36, strict=True, max_length=36, description="The tenant id"
788
- ),
789
- ],
790
- _request_timeout: Union[
791
- None,
792
- Annotated[StrictFloat, Field(gt=0)],
793
- Tuple[
794
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
795
- ],
796
- ] = None,
797
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
798
- _content_type: Optional[StrictStr] = None,
799
- _headers: Optional[Dict[StrictStr, Any]] = None,
800
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
801
- ) -> RESTResponseType:
802
- """List tenant alert email groups
803
-
804
- Gets a list of tenant alert email groups
805
-
806
- :param tenant: The tenant id (required)
807
- :type tenant: str
808
- :param _request_timeout: timeout setting for this request. If one
809
- number provided, it will be total request
810
- timeout. It can also be a pair (tuple) of
811
- (connection, read) timeouts.
812
- :type _request_timeout: int, tuple(int, int), optional
813
- :param _request_auth: set to override the auth_settings for an a single
814
- request; this effectively ignores the
815
- authentication in the spec for a single request.
816
- :type _request_auth: dict, optional
817
- :param _content_type: force content-type for the request.
818
- :type _content_type: str, Optional
819
- :param _headers: set to override the headers for a single
820
- request; this effectively ignores the headers
821
- in the spec for a single request.
822
- :type _headers: dict, optional
823
- :param _host_index: set to override the host_index for a single
824
- request; this effectively ignores the host_index
825
- in the spec for a single request.
826
- :type _host_index: int, optional
827
- :return: Returns the result object.
828
- """ # noqa: E501
829
-
830
- _param = self._alert_email_group_list_serialize(
831
- tenant=tenant,
832
- _request_auth=_request_auth,
833
- _content_type=_content_type,
834
- _headers=_headers,
835
- _host_index=_host_index,
836
- )
837
-
838
- _response_types_map: Dict[str, Optional[str]] = {
839
- "200": "TenantAlertEmailGroupList",
840
- "400": "APIErrors",
841
- "403": "APIError",
842
- }
843
- response_data = await self.api_client.call_api(
844
- *_param, _request_timeout=_request_timeout
845
- )
846
- return response_data.response
847
-
848
- def _alert_email_group_list_serialize(
849
- self,
850
- tenant,
851
- _request_auth,
852
- _content_type,
853
- _headers,
854
- _host_index,
855
- ) -> RequestSerialized:
856
-
857
- _host = None
858
-
859
- _collection_formats: Dict[str, str] = {}
860
-
861
- _path_params: Dict[str, str] = {}
862
- _query_params: List[Tuple[str, str]] = []
863
- _header_params: Dict[str, Optional[str]] = _headers or {}
864
- _form_params: List[Tuple[str, str]] = []
865
- _files: Dict[
866
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
867
- ] = {}
868
- _body_params: Optional[bytes] = None
869
-
870
- # process the path parameters
871
- if tenant is not None:
872
- _path_params["tenant"] = tenant
873
- # process the query parameters
874
- # process the header parameters
875
- # process the form parameters
876
- # process the body parameter
877
-
878
- # set the HTTP header `Accept`
879
- if "Accept" not in _header_params:
880
- _header_params["Accept"] = self.api_client.select_header_accept(
881
- ["application/json"]
882
- )
883
-
884
- # authentication setting
885
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
886
-
887
- return self.api_client.param_serialize(
888
- method="GET",
889
- resource_path="/api/v1/tenants/{tenant}/alerting-email-groups",
890
- path_params=_path_params,
891
- query_params=_query_params,
892
- header_params=_header_params,
893
- body=_body_params,
894
- post_params=_form_params,
895
- files=_files,
896
- auth_settings=_auth_settings,
897
- collection_formats=_collection_formats,
898
- _host=_host,
899
- _request_auth=_request_auth,
900
- )
901
-
902
- @validate_call
903
- async def alert_email_group_update(
904
- self,
905
- alert_email_group: Annotated[
906
- str,
907
- Field(
908
- min_length=36,
909
- strict=True,
910
- max_length=36,
911
- description="The tenant alert email group id",
912
- ),
913
- ],
914
- update_tenant_alert_email_group_request: Annotated[
915
- UpdateTenantAlertEmailGroupRequest,
916
- Field(description="The tenant alert email group to update"),
917
- ],
918
- _request_timeout: Union[
919
- None,
920
- Annotated[StrictFloat, Field(gt=0)],
921
- Tuple[
922
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
923
- ],
924
- ] = None,
925
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
926
- _content_type: Optional[StrictStr] = None,
927
- _headers: Optional[Dict[StrictStr, Any]] = None,
928
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
929
- ) -> TenantAlertEmailGroup:
930
- """Update tenant alert email group
931
-
932
- Updates a tenant alert email group
933
-
934
- :param alert_email_group: The tenant alert email group id (required)
935
- :type alert_email_group: str
936
- :param update_tenant_alert_email_group_request: The tenant alert email group to update (required)
937
- :type update_tenant_alert_email_group_request: UpdateTenantAlertEmailGroupRequest
938
- :param _request_timeout: timeout setting for this request. If one
939
- number provided, it will be total request
940
- timeout. It can also be a pair (tuple) of
941
- (connection, read) timeouts.
942
- :type _request_timeout: int, tuple(int, int), optional
943
- :param _request_auth: set to override the auth_settings for an a single
944
- request; this effectively ignores the
945
- authentication in the spec for a single request.
946
- :type _request_auth: dict, optional
947
- :param _content_type: force content-type for the request.
948
- :type _content_type: str, Optional
949
- :param _headers: set to override the headers for a single
950
- request; this effectively ignores the headers
951
- in the spec for a single request.
952
- :type _headers: dict, optional
953
- :param _host_index: set to override the host_index for a single
954
- request; this effectively ignores the host_index
955
- in the spec for a single request.
956
- :type _host_index: int, optional
957
- :return: Returns the result object.
958
- """ # noqa: E501
959
-
960
- _param = self._alert_email_group_update_serialize(
961
- alert_email_group=alert_email_group,
962
- update_tenant_alert_email_group_request=update_tenant_alert_email_group_request,
963
- _request_auth=_request_auth,
964
- _content_type=_content_type,
965
- _headers=_headers,
966
- _host_index=_host_index,
967
- )
968
-
969
- _response_types_map: Dict[str, Optional[str]] = {
970
- "200": "TenantAlertEmailGroup",
971
- "400": "APIErrors",
972
- "403": "APIError",
973
- }
974
- response_data = await self.api_client.call_api(
975
- *_param, _request_timeout=_request_timeout
976
- )
977
- await response_data.read()
978
- return self.api_client.response_deserialize(
979
- response_data=response_data,
980
- response_types_map=_response_types_map,
981
- ).data
982
-
983
- @validate_call
984
- async def alert_email_group_update_with_http_info(
985
- self,
986
- alert_email_group: Annotated[
987
- str,
988
- Field(
989
- min_length=36,
990
- strict=True,
991
- max_length=36,
992
- description="The tenant alert email group id",
993
- ),
994
- ],
995
- update_tenant_alert_email_group_request: Annotated[
996
- UpdateTenantAlertEmailGroupRequest,
997
- Field(description="The tenant alert email group to update"),
998
- ],
999
- _request_timeout: Union[
1000
- None,
1001
- Annotated[StrictFloat, Field(gt=0)],
1002
- Tuple[
1003
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1004
- ],
1005
- ] = None,
1006
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1007
- _content_type: Optional[StrictStr] = None,
1008
- _headers: Optional[Dict[StrictStr, Any]] = None,
1009
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1010
- ) -> ApiResponse[TenantAlertEmailGroup]:
1011
- """Update tenant alert email group
1012
-
1013
- Updates a tenant alert email group
1014
-
1015
- :param alert_email_group: The tenant alert email group id (required)
1016
- :type alert_email_group: str
1017
- :param update_tenant_alert_email_group_request: The tenant alert email group to update (required)
1018
- :type update_tenant_alert_email_group_request: UpdateTenantAlertEmailGroupRequest
1019
- :param _request_timeout: timeout setting for this request. If one
1020
- number provided, it will be total request
1021
- timeout. It can also be a pair (tuple) of
1022
- (connection, read) timeouts.
1023
- :type _request_timeout: int, tuple(int, int), optional
1024
- :param _request_auth: set to override the auth_settings for an a single
1025
- request; this effectively ignores the
1026
- authentication in the spec for a single request.
1027
- :type _request_auth: dict, optional
1028
- :param _content_type: force content-type for the request.
1029
- :type _content_type: str, Optional
1030
- :param _headers: set to override the headers for a single
1031
- request; this effectively ignores the headers
1032
- in the spec for a single request.
1033
- :type _headers: dict, optional
1034
- :param _host_index: set to override the host_index for a single
1035
- request; this effectively ignores the host_index
1036
- in the spec for a single request.
1037
- :type _host_index: int, optional
1038
- :return: Returns the result object.
1039
- """ # noqa: E501
1040
-
1041
- _param = self._alert_email_group_update_serialize(
1042
- alert_email_group=alert_email_group,
1043
- update_tenant_alert_email_group_request=update_tenant_alert_email_group_request,
1044
- _request_auth=_request_auth,
1045
- _content_type=_content_type,
1046
- _headers=_headers,
1047
- _host_index=_host_index,
1048
- )
1049
-
1050
- _response_types_map: Dict[str, Optional[str]] = {
1051
- "200": "TenantAlertEmailGroup",
1052
- "400": "APIErrors",
1053
- "403": "APIError",
1054
- }
1055
- response_data = await self.api_client.call_api(
1056
- *_param, _request_timeout=_request_timeout
1057
- )
1058
- await response_data.read()
1059
- return self.api_client.response_deserialize(
1060
- response_data=response_data,
1061
- response_types_map=_response_types_map,
1062
- )
1063
-
1064
- @validate_call
1065
- async def alert_email_group_update_without_preload_content(
1066
- self,
1067
- alert_email_group: Annotated[
1068
- str,
1069
- Field(
1070
- min_length=36,
1071
- strict=True,
1072
- max_length=36,
1073
- description="The tenant alert email group id",
1074
- ),
1075
- ],
1076
- update_tenant_alert_email_group_request: Annotated[
1077
- UpdateTenantAlertEmailGroupRequest,
1078
- Field(description="The tenant alert email group to update"),
1079
- ],
1080
- _request_timeout: Union[
1081
- None,
1082
- Annotated[StrictFloat, Field(gt=0)],
1083
- Tuple[
1084
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1085
- ],
1086
- ] = None,
1087
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1088
- _content_type: Optional[StrictStr] = None,
1089
- _headers: Optional[Dict[StrictStr, Any]] = None,
1090
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1091
- ) -> RESTResponseType:
1092
- """Update tenant alert email group
1093
-
1094
- Updates a tenant alert email group
1095
-
1096
- :param alert_email_group: The tenant alert email group id (required)
1097
- :type alert_email_group: str
1098
- :param update_tenant_alert_email_group_request: The tenant alert email group to update (required)
1099
- :type update_tenant_alert_email_group_request: UpdateTenantAlertEmailGroupRequest
1100
- :param _request_timeout: timeout setting for this request. If one
1101
- number provided, it will be total request
1102
- timeout. It can also be a pair (tuple) of
1103
- (connection, read) timeouts.
1104
- :type _request_timeout: int, tuple(int, int), optional
1105
- :param _request_auth: set to override the auth_settings for an a single
1106
- request; this effectively ignores the
1107
- authentication in the spec for a single request.
1108
- :type _request_auth: dict, optional
1109
- :param _content_type: force content-type for the request.
1110
- :type _content_type: str, Optional
1111
- :param _headers: set to override the headers for a single
1112
- request; this effectively ignores the headers
1113
- in the spec for a single request.
1114
- :type _headers: dict, optional
1115
- :param _host_index: set to override the host_index for a single
1116
- request; this effectively ignores the host_index
1117
- in the spec for a single request.
1118
- :type _host_index: int, optional
1119
- :return: Returns the result object.
1120
- """ # noqa: E501
1121
-
1122
- _param = self._alert_email_group_update_serialize(
1123
- alert_email_group=alert_email_group,
1124
- update_tenant_alert_email_group_request=update_tenant_alert_email_group_request,
1125
- _request_auth=_request_auth,
1126
- _content_type=_content_type,
1127
- _headers=_headers,
1128
- _host_index=_host_index,
1129
- )
1130
-
1131
- _response_types_map: Dict[str, Optional[str]] = {
1132
- "200": "TenantAlertEmailGroup",
1133
- "400": "APIErrors",
1134
- "403": "APIError",
1135
- }
1136
- response_data = await self.api_client.call_api(
1137
- *_param, _request_timeout=_request_timeout
1138
- )
1139
- return response_data.response
1140
-
1141
- def _alert_email_group_update_serialize(
1142
- self,
1143
- alert_email_group,
1144
- update_tenant_alert_email_group_request,
1145
- _request_auth,
1146
- _content_type,
1147
- _headers,
1148
- _host_index,
1149
- ) -> RequestSerialized:
1150
-
1151
- _host = None
1152
-
1153
- _collection_formats: Dict[str, str] = {}
1154
-
1155
- _path_params: Dict[str, str] = {}
1156
- _query_params: List[Tuple[str, str]] = []
1157
- _header_params: Dict[str, Optional[str]] = _headers or {}
1158
- _form_params: List[Tuple[str, str]] = []
1159
- _files: Dict[
1160
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1161
- ] = {}
1162
- _body_params: Optional[bytes] = None
1163
-
1164
- # process the path parameters
1165
- if alert_email_group is not None:
1166
- _path_params["alert-email-group"] = alert_email_group
1167
- # process the query parameters
1168
- # process the header parameters
1169
- # process the form parameters
1170
- # process the body parameter
1171
- if update_tenant_alert_email_group_request is not None:
1172
- _body_params = update_tenant_alert_email_group_request
1173
-
1174
- # set the HTTP header `Accept`
1175
- if "Accept" not in _header_params:
1176
- _header_params["Accept"] = self.api_client.select_header_accept(
1177
- ["application/json"]
1178
- )
1179
-
1180
- # set the HTTP header `Content-Type`
1181
- if _content_type:
1182
- _header_params["Content-Type"] = _content_type
1183
- else:
1184
- _default_content_type = self.api_client.select_header_content_type(
1185
- ["application/json"]
1186
- )
1187
- if _default_content_type is not None:
1188
- _header_params["Content-Type"] = _default_content_type
1189
-
1190
- # authentication setting
1191
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1192
-
1193
- return self.api_client.param_serialize(
1194
- method="PATCH",
1195
- resource_path="/api/v1/alerting-email-groups/{alert-email-group}",
1196
- path_params=_path_params,
1197
- query_params=_query_params,
1198
- header_params=_header_params,
1199
- body=_body_params,
1200
- post_params=_form_params,
1201
- files=_files,
1202
- auth_settings=_auth_settings,
1203
- collection_formats=_collection_formats,
1204
- _host=_host,
1205
- _request_auth=_request_auth,
1206
- )
1207
-
1208
- @validate_call
1209
- async def tenant_alerting_settings_get(
1210
- self,
1211
- tenant: Annotated[
1212
- str,
1213
- Field(
1214
- min_length=36, strict=True, max_length=36, description="The tenant id"
1215
- ),
1216
- ],
1217
- _request_timeout: Union[
1218
- None,
1219
- Annotated[StrictFloat, Field(gt=0)],
1220
- Tuple[
1221
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1222
- ],
1223
- ] = None,
1224
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1225
- _content_type: Optional[StrictStr] = None,
1226
- _headers: Optional[Dict[StrictStr, Any]] = None,
1227
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1228
- ) -> TenantAlertingSettings:
1229
- """Get tenant alerting settings
1230
-
1231
- Gets the alerting settings for a tenant
1232
-
1233
- :param tenant: The tenant id (required)
1234
- :type tenant: str
1235
- :param _request_timeout: timeout setting for this request. If one
1236
- number provided, it will be total request
1237
- timeout. It can also be a pair (tuple) of
1238
- (connection, read) timeouts.
1239
- :type _request_timeout: int, tuple(int, int), optional
1240
- :param _request_auth: set to override the auth_settings for an a single
1241
- request; this effectively ignores the
1242
- authentication in the spec for a single request.
1243
- :type _request_auth: dict, optional
1244
- :param _content_type: force content-type for the request.
1245
- :type _content_type: str, Optional
1246
- :param _headers: set to override the headers for a single
1247
- request; this effectively ignores the headers
1248
- in the spec for a single request.
1249
- :type _headers: dict, optional
1250
- :param _host_index: set to override the host_index for a single
1251
- request; this effectively ignores the host_index
1252
- in the spec for a single request.
1253
- :type _host_index: int, optional
1254
- :return: Returns the result object.
1255
- """ # noqa: E501
1256
-
1257
- _param = self._tenant_alerting_settings_get_serialize(
1258
- tenant=tenant,
1259
- _request_auth=_request_auth,
1260
- _content_type=_content_type,
1261
- _headers=_headers,
1262
- _host_index=_host_index,
1263
- )
1264
-
1265
- _response_types_map: Dict[str, Optional[str]] = {
1266
- "200": "TenantAlertingSettings",
1267
- "400": "APIErrors",
1268
- "403": "APIError",
1269
- }
1270
- response_data = await self.api_client.call_api(
1271
- *_param, _request_timeout=_request_timeout
1272
- )
1273
- await response_data.read()
1274
- return self.api_client.response_deserialize(
1275
- response_data=response_data,
1276
- response_types_map=_response_types_map,
1277
- ).data
1278
-
1279
- @validate_call
1280
- async def tenant_alerting_settings_get_with_http_info(
1281
- self,
1282
- tenant: Annotated[
1283
- str,
1284
- Field(
1285
- min_length=36, strict=True, max_length=36, description="The tenant id"
1286
- ),
1287
- ],
1288
- _request_timeout: Union[
1289
- None,
1290
- Annotated[StrictFloat, Field(gt=0)],
1291
- Tuple[
1292
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1293
- ],
1294
- ] = None,
1295
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1296
- _content_type: Optional[StrictStr] = None,
1297
- _headers: Optional[Dict[StrictStr, Any]] = None,
1298
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1299
- ) -> ApiResponse[TenantAlertingSettings]:
1300
- """Get tenant alerting settings
1301
-
1302
- Gets the alerting settings for a tenant
1303
-
1304
- :param tenant: The tenant id (required)
1305
- :type tenant: str
1306
- :param _request_timeout: timeout setting for this request. If one
1307
- number provided, it will be total request
1308
- timeout. It can also be a pair (tuple) of
1309
- (connection, read) timeouts.
1310
- :type _request_timeout: int, tuple(int, int), optional
1311
- :param _request_auth: set to override the auth_settings for an a single
1312
- request; this effectively ignores the
1313
- authentication in the spec for a single request.
1314
- :type _request_auth: dict, optional
1315
- :param _content_type: force content-type for the request.
1316
- :type _content_type: str, Optional
1317
- :param _headers: set to override the headers for a single
1318
- request; this effectively ignores the headers
1319
- in the spec for a single request.
1320
- :type _headers: dict, optional
1321
- :param _host_index: set to override the host_index for a single
1322
- request; this effectively ignores the host_index
1323
- in the spec for a single request.
1324
- :type _host_index: int, optional
1325
- :return: Returns the result object.
1326
- """ # noqa: E501
1327
-
1328
- _param = self._tenant_alerting_settings_get_serialize(
1329
- tenant=tenant,
1330
- _request_auth=_request_auth,
1331
- _content_type=_content_type,
1332
- _headers=_headers,
1333
- _host_index=_host_index,
1334
- )
1335
-
1336
- _response_types_map: Dict[str, Optional[str]] = {
1337
- "200": "TenantAlertingSettings",
1338
- "400": "APIErrors",
1339
- "403": "APIError",
1340
- }
1341
- response_data = await self.api_client.call_api(
1342
- *_param, _request_timeout=_request_timeout
1343
- )
1344
- await response_data.read()
1345
- return self.api_client.response_deserialize(
1346
- response_data=response_data,
1347
- response_types_map=_response_types_map,
1348
- )
1349
-
1350
- @validate_call
1351
- async def tenant_alerting_settings_get_without_preload_content(
1352
- self,
1353
- tenant: Annotated[
1354
- str,
1355
- Field(
1356
- min_length=36, strict=True, max_length=36, description="The tenant id"
1357
- ),
1358
- ],
1359
- _request_timeout: Union[
1360
- None,
1361
- Annotated[StrictFloat, Field(gt=0)],
1362
- Tuple[
1363
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1364
- ],
1365
- ] = None,
1366
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1367
- _content_type: Optional[StrictStr] = None,
1368
- _headers: Optional[Dict[StrictStr, Any]] = None,
1369
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1370
- ) -> RESTResponseType:
1371
- """Get tenant alerting settings
1372
-
1373
- Gets the alerting settings for a tenant
1374
-
1375
- :param tenant: The tenant id (required)
1376
- :type tenant: str
1377
- :param _request_timeout: timeout setting for this request. If one
1378
- number provided, it will be total request
1379
- timeout. It can also be a pair (tuple) of
1380
- (connection, read) timeouts.
1381
- :type _request_timeout: int, tuple(int, int), optional
1382
- :param _request_auth: set to override the auth_settings for an a single
1383
- request; this effectively ignores the
1384
- authentication in the spec for a single request.
1385
- :type _request_auth: dict, optional
1386
- :param _content_type: force content-type for the request.
1387
- :type _content_type: str, Optional
1388
- :param _headers: set to override the headers for a single
1389
- request; this effectively ignores the headers
1390
- in the spec for a single request.
1391
- :type _headers: dict, optional
1392
- :param _host_index: set to override the host_index for a single
1393
- request; this effectively ignores the host_index
1394
- in the spec for a single request.
1395
- :type _host_index: int, optional
1396
- :return: Returns the result object.
1397
- """ # noqa: E501
1398
-
1399
- _param = self._tenant_alerting_settings_get_serialize(
1400
- tenant=tenant,
1401
- _request_auth=_request_auth,
1402
- _content_type=_content_type,
1403
- _headers=_headers,
1404
- _host_index=_host_index,
1405
- )
1406
-
1407
- _response_types_map: Dict[str, Optional[str]] = {
1408
- "200": "TenantAlertingSettings",
1409
- "400": "APIErrors",
1410
- "403": "APIError",
1411
- }
1412
- response_data = await self.api_client.call_api(
1413
- *_param, _request_timeout=_request_timeout
1414
- )
1415
- return response_data.response
1416
-
1417
- def _tenant_alerting_settings_get_serialize(
1418
- self,
1419
- tenant,
1420
- _request_auth,
1421
- _content_type,
1422
- _headers,
1423
- _host_index,
1424
- ) -> RequestSerialized:
1425
-
1426
- _host = None
1427
-
1428
- _collection_formats: Dict[str, str] = {}
1429
-
1430
- _path_params: Dict[str, str] = {}
1431
- _query_params: List[Tuple[str, str]] = []
1432
- _header_params: Dict[str, Optional[str]] = _headers or {}
1433
- _form_params: List[Tuple[str, str]] = []
1434
- _files: Dict[
1435
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1436
- ] = {}
1437
- _body_params: Optional[bytes] = None
1438
-
1439
- # process the path parameters
1440
- if tenant is not None:
1441
- _path_params["tenant"] = tenant
1442
- # process the query parameters
1443
- # process the header parameters
1444
- # process the form parameters
1445
- # process the body parameter
1446
-
1447
- # set the HTTP header `Accept`
1448
- if "Accept" not in _header_params:
1449
- _header_params["Accept"] = self.api_client.select_header_accept(
1450
- ["application/json"]
1451
- )
1452
-
1453
- # authentication setting
1454
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1455
-
1456
- return self.api_client.param_serialize(
1457
- method="GET",
1458
- resource_path="/api/v1/tenants/{tenant}/alerting/settings",
1459
- path_params=_path_params,
1460
- query_params=_query_params,
1461
- header_params=_header_params,
1462
- body=_body_params,
1463
- post_params=_form_params,
1464
- files=_files,
1465
- auth_settings=_auth_settings,
1466
- collection_formats=_collection_formats,
1467
- _host=_host,
1468
- _request_auth=_request_auth,
1469
- )
1470
-
1471
- @validate_call
1472
- async def tenant_create(
1473
- self,
1474
- create_tenant_request: Annotated[
1475
- CreateTenantRequest, Field(description="The tenant to create")
1476
- ],
1477
- _request_timeout: Union[
1478
- None,
1479
- Annotated[StrictFloat, Field(gt=0)],
1480
- Tuple[
1481
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1482
- ],
1483
- ] = None,
1484
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1485
- _content_type: Optional[StrictStr] = None,
1486
- _headers: Optional[Dict[StrictStr, Any]] = None,
1487
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1488
- ) -> Tenant:
1489
- """Create tenant
1490
-
1491
- Creates a new tenant
1492
-
1493
- :param create_tenant_request: The tenant to create (required)
1494
- :type create_tenant_request: CreateTenantRequest
1495
- :param _request_timeout: timeout setting for this request. If one
1496
- number provided, it will be total request
1497
- timeout. It can also be a pair (tuple) of
1498
- (connection, read) timeouts.
1499
- :type _request_timeout: int, tuple(int, int), optional
1500
- :param _request_auth: set to override the auth_settings for an a single
1501
- request; this effectively ignores the
1502
- authentication in the spec for a single request.
1503
- :type _request_auth: dict, optional
1504
- :param _content_type: force content-type for the request.
1505
- :type _content_type: str, Optional
1506
- :param _headers: set to override the headers for a single
1507
- request; this effectively ignores the headers
1508
- in the spec for a single request.
1509
- :type _headers: dict, optional
1510
- :param _host_index: set to override the host_index for a single
1511
- request; this effectively ignores the host_index
1512
- in the spec for a single request.
1513
- :type _host_index: int, optional
1514
- :return: Returns the result object.
1515
- """ # noqa: E501
1516
-
1517
- _param = self._tenant_create_serialize(
1518
- create_tenant_request=create_tenant_request,
1519
- _request_auth=_request_auth,
1520
- _content_type=_content_type,
1521
- _headers=_headers,
1522
- _host_index=_host_index,
1523
- )
1524
-
1525
- _response_types_map: Dict[str, Optional[str]] = {
1526
- "200": "Tenant",
1527
- "400": "APIErrors",
1528
- "403": "APIError",
1529
- }
1530
- response_data = await self.api_client.call_api(
1531
- *_param, _request_timeout=_request_timeout
1532
- )
1533
- await response_data.read()
1534
- return self.api_client.response_deserialize(
1535
- response_data=response_data,
1536
- response_types_map=_response_types_map,
1537
- ).data
1538
-
1539
- @validate_call
1540
- async def tenant_create_with_http_info(
1541
- self,
1542
- create_tenant_request: Annotated[
1543
- CreateTenantRequest, Field(description="The tenant to create")
1544
- ],
1545
- _request_timeout: Union[
1546
- None,
1547
- Annotated[StrictFloat, Field(gt=0)],
1548
- Tuple[
1549
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1550
- ],
1551
- ] = None,
1552
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1553
- _content_type: Optional[StrictStr] = None,
1554
- _headers: Optional[Dict[StrictStr, Any]] = None,
1555
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1556
- ) -> ApiResponse[Tenant]:
1557
- """Create tenant
1558
-
1559
- Creates a new tenant
1560
-
1561
- :param create_tenant_request: The tenant to create (required)
1562
- :type create_tenant_request: CreateTenantRequest
1563
- :param _request_timeout: timeout setting for this request. If one
1564
- number provided, it will be total request
1565
- timeout. It can also be a pair (tuple) of
1566
- (connection, read) timeouts.
1567
- :type _request_timeout: int, tuple(int, int), optional
1568
- :param _request_auth: set to override the auth_settings for an a single
1569
- request; this effectively ignores the
1570
- authentication in the spec for a single request.
1571
- :type _request_auth: dict, optional
1572
- :param _content_type: force content-type for the request.
1573
- :type _content_type: str, Optional
1574
- :param _headers: set to override the headers for a single
1575
- request; this effectively ignores the headers
1576
- in the spec for a single request.
1577
- :type _headers: dict, optional
1578
- :param _host_index: set to override the host_index for a single
1579
- request; this effectively ignores the host_index
1580
- in the spec for a single request.
1581
- :type _host_index: int, optional
1582
- :return: Returns the result object.
1583
- """ # noqa: E501
1584
-
1585
- _param = self._tenant_create_serialize(
1586
- create_tenant_request=create_tenant_request,
1587
- _request_auth=_request_auth,
1588
- _content_type=_content_type,
1589
- _headers=_headers,
1590
- _host_index=_host_index,
1591
- )
1592
-
1593
- _response_types_map: Dict[str, Optional[str]] = {
1594
- "200": "Tenant",
1595
- "400": "APIErrors",
1596
- "403": "APIError",
1597
- }
1598
- response_data = await self.api_client.call_api(
1599
- *_param, _request_timeout=_request_timeout
1600
- )
1601
- await response_data.read()
1602
- return self.api_client.response_deserialize(
1603
- response_data=response_data,
1604
- response_types_map=_response_types_map,
1605
- )
1606
-
1607
- @validate_call
1608
- async def tenant_create_without_preload_content(
1609
- self,
1610
- create_tenant_request: Annotated[
1611
- CreateTenantRequest, Field(description="The tenant to create")
1612
- ],
1613
- _request_timeout: Union[
1614
- None,
1615
- Annotated[StrictFloat, Field(gt=0)],
1616
- Tuple[
1617
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1618
- ],
1619
- ] = None,
1620
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1621
- _content_type: Optional[StrictStr] = None,
1622
- _headers: Optional[Dict[StrictStr, Any]] = None,
1623
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1624
- ) -> RESTResponseType:
1625
- """Create tenant
1626
-
1627
- Creates a new tenant
1628
-
1629
- :param create_tenant_request: The tenant to create (required)
1630
- :type create_tenant_request: CreateTenantRequest
1631
- :param _request_timeout: timeout setting for this request. If one
1632
- number provided, it will be total request
1633
- timeout. It can also be a pair (tuple) of
1634
- (connection, read) timeouts.
1635
- :type _request_timeout: int, tuple(int, int), optional
1636
- :param _request_auth: set to override the auth_settings for an a single
1637
- request; this effectively ignores the
1638
- authentication in the spec for a single request.
1639
- :type _request_auth: dict, optional
1640
- :param _content_type: force content-type for the request.
1641
- :type _content_type: str, Optional
1642
- :param _headers: set to override the headers for a single
1643
- request; this effectively ignores the headers
1644
- in the spec for a single request.
1645
- :type _headers: dict, optional
1646
- :param _host_index: set to override the host_index for a single
1647
- request; this effectively ignores the host_index
1648
- in the spec for a single request.
1649
- :type _host_index: int, optional
1650
- :return: Returns the result object.
1651
- """ # noqa: E501
1652
-
1653
- _param = self._tenant_create_serialize(
1654
- create_tenant_request=create_tenant_request,
1655
- _request_auth=_request_auth,
1656
- _content_type=_content_type,
1657
- _headers=_headers,
1658
- _host_index=_host_index,
1659
- )
1660
-
1661
- _response_types_map: Dict[str, Optional[str]] = {
1662
- "200": "Tenant",
1663
- "400": "APIErrors",
1664
- "403": "APIError",
1665
- }
1666
- response_data = await self.api_client.call_api(
1667
- *_param, _request_timeout=_request_timeout
1668
- )
1669
- return response_data.response
1670
-
1671
- def _tenant_create_serialize(
1672
- self,
1673
- create_tenant_request,
1674
- _request_auth,
1675
- _content_type,
1676
- _headers,
1677
- _host_index,
1678
- ) -> RequestSerialized:
1679
-
1680
- _host = None
1681
-
1682
- _collection_formats: Dict[str, str] = {}
1683
-
1684
- _path_params: Dict[str, str] = {}
1685
- _query_params: List[Tuple[str, str]] = []
1686
- _header_params: Dict[str, Optional[str]] = _headers or {}
1687
- _form_params: List[Tuple[str, str]] = []
1688
- _files: Dict[
1689
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1690
- ] = {}
1691
- _body_params: Optional[bytes] = None
1692
-
1693
- # process the path parameters
1694
- # process the query parameters
1695
- # process the header parameters
1696
- # process the form parameters
1697
- # process the body parameter
1698
- if create_tenant_request is not None:
1699
- _body_params = create_tenant_request
1700
-
1701
- # set the HTTP header `Accept`
1702
- if "Accept" not in _header_params:
1703
- _header_params["Accept"] = self.api_client.select_header_accept(
1704
- ["application/json"]
1705
- )
1706
-
1707
- # set the HTTP header `Content-Type`
1708
- if _content_type:
1709
- _header_params["Content-Type"] = _content_type
1710
- else:
1711
- _default_content_type = self.api_client.select_header_content_type(
1712
- ["application/json"]
1713
- )
1714
- if _default_content_type is not None:
1715
- _header_params["Content-Type"] = _default_content_type
1716
-
1717
- # authentication setting
1718
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1719
-
1720
- return self.api_client.param_serialize(
1721
- method="POST",
1722
- resource_path="/api/v1/tenants",
1723
- path_params=_path_params,
1724
- query_params=_query_params,
1725
- header_params=_header_params,
1726
- body=_body_params,
1727
- post_params=_form_params,
1728
- files=_files,
1729
- auth_settings=_auth_settings,
1730
- collection_formats=_collection_formats,
1731
- _host=_host,
1732
- _request_auth=_request_auth,
1733
- )
1734
-
1735
- @validate_call
1736
- async def tenant_get_step_run_queue_metrics(
1737
- self,
1738
- tenant: Annotated[
1739
- str,
1740
- Field(
1741
- min_length=36, strict=True, max_length=36, description="The tenant id"
1742
- ),
1743
- ],
1744
- _request_timeout: Union[
1745
- None,
1746
- Annotated[StrictFloat, Field(gt=0)],
1747
- Tuple[
1748
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1749
- ],
1750
- ] = None,
1751
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1752
- _content_type: Optional[StrictStr] = None,
1753
- _headers: Optional[Dict[StrictStr, Any]] = None,
1754
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1755
- ) -> TenantStepRunQueueMetrics:
1756
- """Get step run metrics
1757
-
1758
- Get the queue metrics for the tenant
1759
-
1760
- :param tenant: The tenant id (required)
1761
- :type tenant: str
1762
- :param _request_timeout: timeout setting for this request. If one
1763
- number provided, it will be total request
1764
- timeout. It can also be a pair (tuple) of
1765
- (connection, read) timeouts.
1766
- :type _request_timeout: int, tuple(int, int), optional
1767
- :param _request_auth: set to override the auth_settings for an a single
1768
- request; this effectively ignores the
1769
- authentication in the spec for a single request.
1770
- :type _request_auth: dict, optional
1771
- :param _content_type: force content-type for the request.
1772
- :type _content_type: str, Optional
1773
- :param _headers: set to override the headers for a single
1774
- request; this effectively ignores the headers
1775
- in the spec for a single request.
1776
- :type _headers: dict, optional
1777
- :param _host_index: set to override the host_index for a single
1778
- request; this effectively ignores the host_index
1779
- in the spec for a single request.
1780
- :type _host_index: int, optional
1781
- :return: Returns the result object.
1782
- """ # noqa: E501
1783
-
1784
- _param = self._tenant_get_step_run_queue_metrics_serialize(
1785
- tenant=tenant,
1786
- _request_auth=_request_auth,
1787
- _content_type=_content_type,
1788
- _headers=_headers,
1789
- _host_index=_host_index,
1790
- )
1791
-
1792
- _response_types_map: Dict[str, Optional[str]] = {
1793
- "200": "TenantStepRunQueueMetrics",
1794
- "400": "APIErrors",
1795
- "403": "APIErrors",
1796
- "404": "APIErrors",
1797
- }
1798
- response_data = await self.api_client.call_api(
1799
- *_param, _request_timeout=_request_timeout
1800
- )
1801
- await response_data.read()
1802
- return self.api_client.response_deserialize(
1803
- response_data=response_data,
1804
- response_types_map=_response_types_map,
1805
- ).data
1806
-
1807
- @validate_call
1808
- async def tenant_get_step_run_queue_metrics_with_http_info(
1809
- self,
1810
- tenant: Annotated[
1811
- str,
1812
- Field(
1813
- min_length=36, strict=True, max_length=36, description="The tenant id"
1814
- ),
1815
- ],
1816
- _request_timeout: Union[
1817
- None,
1818
- Annotated[StrictFloat, Field(gt=0)],
1819
- Tuple[
1820
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1821
- ],
1822
- ] = None,
1823
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1824
- _content_type: Optional[StrictStr] = None,
1825
- _headers: Optional[Dict[StrictStr, Any]] = None,
1826
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1827
- ) -> ApiResponse[TenantStepRunQueueMetrics]:
1828
- """Get step run metrics
1829
-
1830
- Get the queue metrics for the tenant
1831
-
1832
- :param tenant: The tenant id (required)
1833
- :type tenant: str
1834
- :param _request_timeout: timeout setting for this request. If one
1835
- number provided, it will be total request
1836
- timeout. It can also be a pair (tuple) of
1837
- (connection, read) timeouts.
1838
- :type _request_timeout: int, tuple(int, int), optional
1839
- :param _request_auth: set to override the auth_settings for an a single
1840
- request; this effectively ignores the
1841
- authentication in the spec for a single request.
1842
- :type _request_auth: dict, optional
1843
- :param _content_type: force content-type for the request.
1844
- :type _content_type: str, Optional
1845
- :param _headers: set to override the headers for a single
1846
- request; this effectively ignores the headers
1847
- in the spec for a single request.
1848
- :type _headers: dict, optional
1849
- :param _host_index: set to override the host_index for a single
1850
- request; this effectively ignores the host_index
1851
- in the spec for a single request.
1852
- :type _host_index: int, optional
1853
- :return: Returns the result object.
1854
- """ # noqa: E501
1855
-
1856
- _param = self._tenant_get_step_run_queue_metrics_serialize(
1857
- tenant=tenant,
1858
- _request_auth=_request_auth,
1859
- _content_type=_content_type,
1860
- _headers=_headers,
1861
- _host_index=_host_index,
1862
- )
1863
-
1864
- _response_types_map: Dict[str, Optional[str]] = {
1865
- "200": "TenantStepRunQueueMetrics",
1866
- "400": "APIErrors",
1867
- "403": "APIErrors",
1868
- "404": "APIErrors",
1869
- }
1870
- response_data = await self.api_client.call_api(
1871
- *_param, _request_timeout=_request_timeout
1872
- )
1873
- await response_data.read()
1874
- return self.api_client.response_deserialize(
1875
- response_data=response_data,
1876
- response_types_map=_response_types_map,
1877
- )
1878
-
1879
- @validate_call
1880
- async def tenant_get_step_run_queue_metrics_without_preload_content(
1881
- self,
1882
- tenant: Annotated[
1883
- str,
1884
- Field(
1885
- min_length=36, strict=True, max_length=36, description="The tenant id"
1886
- ),
1887
- ],
1888
- _request_timeout: Union[
1889
- None,
1890
- Annotated[StrictFloat, Field(gt=0)],
1891
- Tuple[
1892
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1893
- ],
1894
- ] = None,
1895
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1896
- _content_type: Optional[StrictStr] = None,
1897
- _headers: Optional[Dict[StrictStr, Any]] = None,
1898
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1899
- ) -> RESTResponseType:
1900
- """Get step run metrics
1901
-
1902
- Get the queue metrics for the tenant
1903
-
1904
- :param tenant: The tenant id (required)
1905
- :type tenant: str
1906
- :param _request_timeout: timeout setting for this request. If one
1907
- number provided, it will be total request
1908
- timeout. It can also be a pair (tuple) of
1909
- (connection, read) timeouts.
1910
- :type _request_timeout: int, tuple(int, int), optional
1911
- :param _request_auth: set to override the auth_settings for an a single
1912
- request; this effectively ignores the
1913
- authentication in the spec for a single request.
1914
- :type _request_auth: dict, optional
1915
- :param _content_type: force content-type for the request.
1916
- :type _content_type: str, Optional
1917
- :param _headers: set to override the headers for a single
1918
- request; this effectively ignores the headers
1919
- in the spec for a single request.
1920
- :type _headers: dict, optional
1921
- :param _host_index: set to override the host_index for a single
1922
- request; this effectively ignores the host_index
1923
- in the spec for a single request.
1924
- :type _host_index: int, optional
1925
- :return: Returns the result object.
1926
- """ # noqa: E501
1927
-
1928
- _param = self._tenant_get_step_run_queue_metrics_serialize(
1929
- tenant=tenant,
1930
- _request_auth=_request_auth,
1931
- _content_type=_content_type,
1932
- _headers=_headers,
1933
- _host_index=_host_index,
1934
- )
1935
-
1936
- _response_types_map: Dict[str, Optional[str]] = {
1937
- "200": "TenantStepRunQueueMetrics",
1938
- "400": "APIErrors",
1939
- "403": "APIErrors",
1940
- "404": "APIErrors",
1941
- }
1942
- response_data = await self.api_client.call_api(
1943
- *_param, _request_timeout=_request_timeout
1944
- )
1945
- return response_data.response
1946
-
1947
- def _tenant_get_step_run_queue_metrics_serialize(
1948
- self,
1949
- tenant,
1950
- _request_auth,
1951
- _content_type,
1952
- _headers,
1953
- _host_index,
1954
- ) -> RequestSerialized:
1955
-
1956
- _host = None
1957
-
1958
- _collection_formats: Dict[str, str] = {}
1959
-
1960
- _path_params: Dict[str, str] = {}
1961
- _query_params: List[Tuple[str, str]] = []
1962
- _header_params: Dict[str, Optional[str]] = _headers or {}
1963
- _form_params: List[Tuple[str, str]] = []
1964
- _files: Dict[
1965
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1966
- ] = {}
1967
- _body_params: Optional[bytes] = None
1968
-
1969
- # process the path parameters
1970
- if tenant is not None:
1971
- _path_params["tenant"] = tenant
1972
- # process the query parameters
1973
- # process the header parameters
1974
- # process the form parameters
1975
- # process the body parameter
1976
-
1977
- # set the HTTP header `Accept`
1978
- if "Accept" not in _header_params:
1979
- _header_params["Accept"] = self.api_client.select_header_accept(
1980
- ["application/json"]
1981
- )
1982
-
1983
- # authentication setting
1984
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1985
-
1986
- return self.api_client.param_serialize(
1987
- method="GET",
1988
- resource_path="/api/v1/tenants/{tenant}/step-run-queue-metrics",
1989
- path_params=_path_params,
1990
- query_params=_query_params,
1991
- header_params=_header_params,
1992
- body=_body_params,
1993
- post_params=_form_params,
1994
- files=_files,
1995
- auth_settings=_auth_settings,
1996
- collection_formats=_collection_formats,
1997
- _host=_host,
1998
- _request_auth=_request_auth,
1999
- )
2000
-
2001
- @validate_call
2002
- async def tenant_invite_accept(
2003
- self,
2004
- accept_invite_request: Optional[AcceptInviteRequest] = None,
2005
- _request_timeout: Union[
2006
- None,
2007
- Annotated[StrictFloat, Field(gt=0)],
2008
- Tuple[
2009
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2010
- ],
2011
- ] = None,
2012
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2013
- _content_type: Optional[StrictStr] = None,
2014
- _headers: Optional[Dict[StrictStr, Any]] = None,
2015
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2016
- ) -> None:
2017
- """Accept tenant invite
2018
-
2019
- Accepts a tenant invite
2020
-
2021
- :param accept_invite_request:
2022
- :type accept_invite_request: AcceptInviteRequest
2023
- :param _request_timeout: timeout setting for this request. If one
2024
- number provided, it will be total request
2025
- timeout. It can also be a pair (tuple) of
2026
- (connection, read) timeouts.
2027
- :type _request_timeout: int, tuple(int, int), optional
2028
- :param _request_auth: set to override the auth_settings for an a single
2029
- request; this effectively ignores the
2030
- authentication in the spec for a single request.
2031
- :type _request_auth: dict, optional
2032
- :param _content_type: force content-type for the request.
2033
- :type _content_type: str, Optional
2034
- :param _headers: set to override the headers for a single
2035
- request; this effectively ignores the headers
2036
- in the spec for a single request.
2037
- :type _headers: dict, optional
2038
- :param _host_index: set to override the host_index for a single
2039
- request; this effectively ignores the host_index
2040
- in the spec for a single request.
2041
- :type _host_index: int, optional
2042
- :return: Returns the result object.
2043
- """ # noqa: E501
2044
-
2045
- _param = self._tenant_invite_accept_serialize(
2046
- accept_invite_request=accept_invite_request,
2047
- _request_auth=_request_auth,
2048
- _content_type=_content_type,
2049
- _headers=_headers,
2050
- _host_index=_host_index,
2051
- )
2052
-
2053
- _response_types_map: Dict[str, Optional[str]] = {
2054
- "200": None,
2055
- "400": "APIErrors",
2056
- "403": "APIError",
2057
- }
2058
- response_data = await self.api_client.call_api(
2059
- *_param, _request_timeout=_request_timeout
2060
- )
2061
- await response_data.read()
2062
- return self.api_client.response_deserialize(
2063
- response_data=response_data,
2064
- response_types_map=_response_types_map,
2065
- ).data
2066
-
2067
- @validate_call
2068
- async def tenant_invite_accept_with_http_info(
2069
- self,
2070
- accept_invite_request: Optional[AcceptInviteRequest] = None,
2071
- _request_timeout: Union[
2072
- None,
2073
- Annotated[StrictFloat, Field(gt=0)],
2074
- Tuple[
2075
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2076
- ],
2077
- ] = None,
2078
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2079
- _content_type: Optional[StrictStr] = None,
2080
- _headers: Optional[Dict[StrictStr, Any]] = None,
2081
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2082
- ) -> ApiResponse[None]:
2083
- """Accept tenant invite
2084
-
2085
- Accepts a tenant invite
2086
-
2087
- :param accept_invite_request:
2088
- :type accept_invite_request: AcceptInviteRequest
2089
- :param _request_timeout: timeout setting for this request. If one
2090
- number provided, it will be total request
2091
- timeout. It can also be a pair (tuple) of
2092
- (connection, read) timeouts.
2093
- :type _request_timeout: int, tuple(int, int), optional
2094
- :param _request_auth: set to override the auth_settings for an a single
2095
- request; this effectively ignores the
2096
- authentication in the spec for a single request.
2097
- :type _request_auth: dict, optional
2098
- :param _content_type: force content-type for the request.
2099
- :type _content_type: str, Optional
2100
- :param _headers: set to override the headers for a single
2101
- request; this effectively ignores the headers
2102
- in the spec for a single request.
2103
- :type _headers: dict, optional
2104
- :param _host_index: set to override the host_index for a single
2105
- request; this effectively ignores the host_index
2106
- in the spec for a single request.
2107
- :type _host_index: int, optional
2108
- :return: Returns the result object.
2109
- """ # noqa: E501
2110
-
2111
- _param = self._tenant_invite_accept_serialize(
2112
- accept_invite_request=accept_invite_request,
2113
- _request_auth=_request_auth,
2114
- _content_type=_content_type,
2115
- _headers=_headers,
2116
- _host_index=_host_index,
2117
- )
2118
-
2119
- _response_types_map: Dict[str, Optional[str]] = {
2120
- "200": None,
2121
- "400": "APIErrors",
2122
- "403": "APIError",
2123
- }
2124
- response_data = await self.api_client.call_api(
2125
- *_param, _request_timeout=_request_timeout
2126
- )
2127
- await response_data.read()
2128
- return self.api_client.response_deserialize(
2129
- response_data=response_data,
2130
- response_types_map=_response_types_map,
2131
- )
2132
-
2133
- @validate_call
2134
- async def tenant_invite_accept_without_preload_content(
2135
- self,
2136
- accept_invite_request: Optional[AcceptInviteRequest] = None,
2137
- _request_timeout: Union[
2138
- None,
2139
- Annotated[StrictFloat, Field(gt=0)],
2140
- Tuple[
2141
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2142
- ],
2143
- ] = None,
2144
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2145
- _content_type: Optional[StrictStr] = None,
2146
- _headers: Optional[Dict[StrictStr, Any]] = None,
2147
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2148
- ) -> RESTResponseType:
2149
- """Accept tenant invite
2150
-
2151
- Accepts a tenant invite
2152
-
2153
- :param accept_invite_request:
2154
- :type accept_invite_request: AcceptInviteRequest
2155
- :param _request_timeout: timeout setting for this request. If one
2156
- number provided, it will be total request
2157
- timeout. It can also be a pair (tuple) of
2158
- (connection, read) timeouts.
2159
- :type _request_timeout: int, tuple(int, int), optional
2160
- :param _request_auth: set to override the auth_settings for an a single
2161
- request; this effectively ignores the
2162
- authentication in the spec for a single request.
2163
- :type _request_auth: dict, optional
2164
- :param _content_type: force content-type for the request.
2165
- :type _content_type: str, Optional
2166
- :param _headers: set to override the headers for a single
2167
- request; this effectively ignores the headers
2168
- in the spec for a single request.
2169
- :type _headers: dict, optional
2170
- :param _host_index: set to override the host_index for a single
2171
- request; this effectively ignores the host_index
2172
- in the spec for a single request.
2173
- :type _host_index: int, optional
2174
- :return: Returns the result object.
2175
- """ # noqa: E501
2176
-
2177
- _param = self._tenant_invite_accept_serialize(
2178
- accept_invite_request=accept_invite_request,
2179
- _request_auth=_request_auth,
2180
- _content_type=_content_type,
2181
- _headers=_headers,
2182
- _host_index=_host_index,
2183
- )
2184
-
2185
- _response_types_map: Dict[str, Optional[str]] = {
2186
- "200": None,
2187
- "400": "APIErrors",
2188
- "403": "APIError",
2189
- }
2190
- response_data = await self.api_client.call_api(
2191
- *_param, _request_timeout=_request_timeout
2192
- )
2193
- return response_data.response
2194
-
2195
- def _tenant_invite_accept_serialize(
2196
- self,
2197
- accept_invite_request,
2198
- _request_auth,
2199
- _content_type,
2200
- _headers,
2201
- _host_index,
2202
- ) -> RequestSerialized:
2203
-
2204
- _host = None
2205
-
2206
- _collection_formats: Dict[str, str] = {}
2207
-
2208
- _path_params: Dict[str, str] = {}
2209
- _query_params: List[Tuple[str, str]] = []
2210
- _header_params: Dict[str, Optional[str]] = _headers or {}
2211
- _form_params: List[Tuple[str, str]] = []
2212
- _files: Dict[
2213
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2214
- ] = {}
2215
- _body_params: Optional[bytes] = None
2216
-
2217
- # process the path parameters
2218
- # process the query parameters
2219
- # process the header parameters
2220
- # process the form parameters
2221
- # process the body parameter
2222
- if accept_invite_request is not None:
2223
- _body_params = accept_invite_request
2224
-
2225
- # set the HTTP header `Accept`
2226
- if "Accept" not in _header_params:
2227
- _header_params["Accept"] = self.api_client.select_header_accept(
2228
- ["application/json"]
2229
- )
2230
-
2231
- # set the HTTP header `Content-Type`
2232
- if _content_type:
2233
- _header_params["Content-Type"] = _content_type
2234
- else:
2235
- _default_content_type = self.api_client.select_header_content_type(
2236
- ["application/json"]
2237
- )
2238
- if _default_content_type is not None:
2239
- _header_params["Content-Type"] = _default_content_type
2240
-
2241
- # authentication setting
2242
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
2243
-
2244
- return self.api_client.param_serialize(
2245
- method="POST",
2246
- resource_path="/api/v1/users/invites/accept",
2247
- path_params=_path_params,
2248
- query_params=_query_params,
2249
- header_params=_header_params,
2250
- body=_body_params,
2251
- post_params=_form_params,
2252
- files=_files,
2253
- auth_settings=_auth_settings,
2254
- collection_formats=_collection_formats,
2255
- _host=_host,
2256
- _request_auth=_request_auth,
2257
- )
2258
-
2259
- @validate_call
2260
- async def tenant_invite_create(
2261
- self,
2262
- tenant: Annotated[
2263
- str,
2264
- Field(
2265
- min_length=36, strict=True, max_length=36, description="The tenant id"
2266
- ),
2267
- ],
2268
- create_tenant_invite_request: Annotated[
2269
- CreateTenantInviteRequest, Field(description="The tenant invite to create")
2270
- ],
2271
- _request_timeout: Union[
2272
- None,
2273
- Annotated[StrictFloat, Field(gt=0)],
2274
- Tuple[
2275
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2276
- ],
2277
- ] = None,
2278
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2279
- _content_type: Optional[StrictStr] = None,
2280
- _headers: Optional[Dict[StrictStr, Any]] = None,
2281
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2282
- ) -> TenantInvite:
2283
- """Create tenant invite
2284
-
2285
- Creates a new tenant invite
2286
-
2287
- :param tenant: The tenant id (required)
2288
- :type tenant: str
2289
- :param create_tenant_invite_request: The tenant invite to create (required)
2290
- :type create_tenant_invite_request: CreateTenantInviteRequest
2291
- :param _request_timeout: timeout setting for this request. If one
2292
- number provided, it will be total request
2293
- timeout. It can also be a pair (tuple) of
2294
- (connection, read) timeouts.
2295
- :type _request_timeout: int, tuple(int, int), optional
2296
- :param _request_auth: set to override the auth_settings for an a single
2297
- request; this effectively ignores the
2298
- authentication in the spec for a single request.
2299
- :type _request_auth: dict, optional
2300
- :param _content_type: force content-type for the request.
2301
- :type _content_type: str, Optional
2302
- :param _headers: set to override the headers for a single
2303
- request; this effectively ignores the headers
2304
- in the spec for a single request.
2305
- :type _headers: dict, optional
2306
- :param _host_index: set to override the host_index for a single
2307
- request; this effectively ignores the host_index
2308
- in the spec for a single request.
2309
- :type _host_index: int, optional
2310
- :return: Returns the result object.
2311
- """ # noqa: E501
2312
-
2313
- _param = self._tenant_invite_create_serialize(
2314
- tenant=tenant,
2315
- create_tenant_invite_request=create_tenant_invite_request,
2316
- _request_auth=_request_auth,
2317
- _content_type=_content_type,
2318
- _headers=_headers,
2319
- _host_index=_host_index,
2320
- )
2321
-
2322
- _response_types_map: Dict[str, Optional[str]] = {
2323
- "201": "TenantInvite",
2324
- "400": "APIErrors",
2325
- "403": "APIError",
2326
- }
2327
- response_data = await self.api_client.call_api(
2328
- *_param, _request_timeout=_request_timeout
2329
- )
2330
- await response_data.read()
2331
- return self.api_client.response_deserialize(
2332
- response_data=response_data,
2333
- response_types_map=_response_types_map,
2334
- ).data
2335
-
2336
- @validate_call
2337
- async def tenant_invite_create_with_http_info(
2338
- self,
2339
- tenant: Annotated[
2340
- str,
2341
- Field(
2342
- min_length=36, strict=True, max_length=36, description="The tenant id"
2343
- ),
2344
- ],
2345
- create_tenant_invite_request: Annotated[
2346
- CreateTenantInviteRequest, Field(description="The tenant invite to create")
2347
- ],
2348
- _request_timeout: Union[
2349
- None,
2350
- Annotated[StrictFloat, Field(gt=0)],
2351
- Tuple[
2352
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2353
- ],
2354
- ] = None,
2355
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2356
- _content_type: Optional[StrictStr] = None,
2357
- _headers: Optional[Dict[StrictStr, Any]] = None,
2358
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2359
- ) -> ApiResponse[TenantInvite]:
2360
- """Create tenant invite
2361
-
2362
- Creates a new tenant invite
2363
-
2364
- :param tenant: The tenant id (required)
2365
- :type tenant: str
2366
- :param create_tenant_invite_request: The tenant invite to create (required)
2367
- :type create_tenant_invite_request: CreateTenantInviteRequest
2368
- :param _request_timeout: timeout setting for this request. If one
2369
- number provided, it will be total request
2370
- timeout. It can also be a pair (tuple) of
2371
- (connection, read) timeouts.
2372
- :type _request_timeout: int, tuple(int, int), optional
2373
- :param _request_auth: set to override the auth_settings for an a single
2374
- request; this effectively ignores the
2375
- authentication in the spec for a single request.
2376
- :type _request_auth: dict, optional
2377
- :param _content_type: force content-type for the request.
2378
- :type _content_type: str, Optional
2379
- :param _headers: set to override the headers for a single
2380
- request; this effectively ignores the headers
2381
- in the spec for a single request.
2382
- :type _headers: dict, optional
2383
- :param _host_index: set to override the host_index for a single
2384
- request; this effectively ignores the host_index
2385
- in the spec for a single request.
2386
- :type _host_index: int, optional
2387
- :return: Returns the result object.
2388
- """ # noqa: E501
2389
-
2390
- _param = self._tenant_invite_create_serialize(
2391
- tenant=tenant,
2392
- create_tenant_invite_request=create_tenant_invite_request,
2393
- _request_auth=_request_auth,
2394
- _content_type=_content_type,
2395
- _headers=_headers,
2396
- _host_index=_host_index,
2397
- )
2398
-
2399
- _response_types_map: Dict[str, Optional[str]] = {
2400
- "201": "TenantInvite",
2401
- "400": "APIErrors",
2402
- "403": "APIError",
2403
- }
2404
- response_data = await self.api_client.call_api(
2405
- *_param, _request_timeout=_request_timeout
2406
- )
2407
- await response_data.read()
2408
- return self.api_client.response_deserialize(
2409
- response_data=response_data,
2410
- response_types_map=_response_types_map,
2411
- )
2412
-
2413
- @validate_call
2414
- async def tenant_invite_create_without_preload_content(
2415
- self,
2416
- tenant: Annotated[
2417
- str,
2418
- Field(
2419
- min_length=36, strict=True, max_length=36, description="The tenant id"
2420
- ),
2421
- ],
2422
- create_tenant_invite_request: Annotated[
2423
- CreateTenantInviteRequest, Field(description="The tenant invite to create")
2424
- ],
2425
- _request_timeout: Union[
2426
- None,
2427
- Annotated[StrictFloat, Field(gt=0)],
2428
- Tuple[
2429
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2430
- ],
2431
- ] = None,
2432
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2433
- _content_type: Optional[StrictStr] = None,
2434
- _headers: Optional[Dict[StrictStr, Any]] = None,
2435
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2436
- ) -> RESTResponseType:
2437
- """Create tenant invite
2438
-
2439
- Creates a new tenant invite
2440
-
2441
- :param tenant: The tenant id (required)
2442
- :type tenant: str
2443
- :param create_tenant_invite_request: The tenant invite to create (required)
2444
- :type create_tenant_invite_request: CreateTenantInviteRequest
2445
- :param _request_timeout: timeout setting for this request. If one
2446
- number provided, it will be total request
2447
- timeout. It can also be a pair (tuple) of
2448
- (connection, read) timeouts.
2449
- :type _request_timeout: int, tuple(int, int), optional
2450
- :param _request_auth: set to override the auth_settings for an a single
2451
- request; this effectively ignores the
2452
- authentication in the spec for a single request.
2453
- :type _request_auth: dict, optional
2454
- :param _content_type: force content-type for the request.
2455
- :type _content_type: str, Optional
2456
- :param _headers: set to override the headers for a single
2457
- request; this effectively ignores the headers
2458
- in the spec for a single request.
2459
- :type _headers: dict, optional
2460
- :param _host_index: set to override the host_index for a single
2461
- request; this effectively ignores the host_index
2462
- in the spec for a single request.
2463
- :type _host_index: int, optional
2464
- :return: Returns the result object.
2465
- """ # noqa: E501
2466
-
2467
- _param = self._tenant_invite_create_serialize(
2468
- tenant=tenant,
2469
- create_tenant_invite_request=create_tenant_invite_request,
2470
- _request_auth=_request_auth,
2471
- _content_type=_content_type,
2472
- _headers=_headers,
2473
- _host_index=_host_index,
2474
- )
2475
-
2476
- _response_types_map: Dict[str, Optional[str]] = {
2477
- "201": "TenantInvite",
2478
- "400": "APIErrors",
2479
- "403": "APIError",
2480
- }
2481
- response_data = await self.api_client.call_api(
2482
- *_param, _request_timeout=_request_timeout
2483
- )
2484
- return response_data.response
2485
-
2486
- def _tenant_invite_create_serialize(
2487
- self,
2488
- tenant,
2489
- create_tenant_invite_request,
2490
- _request_auth,
2491
- _content_type,
2492
- _headers,
2493
- _host_index,
2494
- ) -> RequestSerialized:
2495
-
2496
- _host = None
2497
-
2498
- _collection_formats: Dict[str, str] = {}
2499
-
2500
- _path_params: Dict[str, str] = {}
2501
- _query_params: List[Tuple[str, str]] = []
2502
- _header_params: Dict[str, Optional[str]] = _headers or {}
2503
- _form_params: List[Tuple[str, str]] = []
2504
- _files: Dict[
2505
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2506
- ] = {}
2507
- _body_params: Optional[bytes] = None
2508
-
2509
- # process the path parameters
2510
- if tenant is not None:
2511
- _path_params["tenant"] = tenant
2512
- # process the query parameters
2513
- # process the header parameters
2514
- # process the form parameters
2515
- # process the body parameter
2516
- if create_tenant_invite_request is not None:
2517
- _body_params = create_tenant_invite_request
2518
-
2519
- # set the HTTP header `Accept`
2520
- if "Accept" not in _header_params:
2521
- _header_params["Accept"] = self.api_client.select_header_accept(
2522
- ["application/json"]
2523
- )
2524
-
2525
- # set the HTTP header `Content-Type`
2526
- if _content_type:
2527
- _header_params["Content-Type"] = _content_type
2528
- else:
2529
- _default_content_type = self.api_client.select_header_content_type(
2530
- ["application/json"]
2531
- )
2532
- if _default_content_type is not None:
2533
- _header_params["Content-Type"] = _default_content_type
2534
-
2535
- # authentication setting
2536
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
2537
-
2538
- return self.api_client.param_serialize(
2539
- method="POST",
2540
- resource_path="/api/v1/tenants/{tenant}/invites",
2541
- path_params=_path_params,
2542
- query_params=_query_params,
2543
- header_params=_header_params,
2544
- body=_body_params,
2545
- post_params=_form_params,
2546
- files=_files,
2547
- auth_settings=_auth_settings,
2548
- collection_formats=_collection_formats,
2549
- _host=_host,
2550
- _request_auth=_request_auth,
2551
- )
2552
-
2553
- @validate_call
2554
- async def tenant_invite_list(
2555
- self,
2556
- tenant: Annotated[
2557
- str,
2558
- Field(
2559
- min_length=36, strict=True, max_length=36, description="The tenant id"
2560
- ),
2561
- ],
2562
- _request_timeout: Union[
2563
- None,
2564
- Annotated[StrictFloat, Field(gt=0)],
2565
- Tuple[
2566
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2567
- ],
2568
- ] = None,
2569
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2570
- _content_type: Optional[StrictStr] = None,
2571
- _headers: Optional[Dict[StrictStr, Any]] = None,
2572
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2573
- ) -> TenantInviteList:
2574
- """List tenant invites
2575
-
2576
- Gets a list of tenant invites
2577
-
2578
- :param tenant: The tenant id (required)
2579
- :type tenant: str
2580
- :param _request_timeout: timeout setting for this request. If one
2581
- number provided, it will be total request
2582
- timeout. It can also be a pair (tuple) of
2583
- (connection, read) timeouts.
2584
- :type _request_timeout: int, tuple(int, int), optional
2585
- :param _request_auth: set to override the auth_settings for an a single
2586
- request; this effectively ignores the
2587
- authentication in the spec for a single request.
2588
- :type _request_auth: dict, optional
2589
- :param _content_type: force content-type for the request.
2590
- :type _content_type: str, Optional
2591
- :param _headers: set to override the headers for a single
2592
- request; this effectively ignores the headers
2593
- in the spec for a single request.
2594
- :type _headers: dict, optional
2595
- :param _host_index: set to override the host_index for a single
2596
- request; this effectively ignores the host_index
2597
- in the spec for a single request.
2598
- :type _host_index: int, optional
2599
- :return: Returns the result object.
2600
- """ # noqa: E501
2601
-
2602
- _param = self._tenant_invite_list_serialize(
2603
- tenant=tenant,
2604
- _request_auth=_request_auth,
2605
- _content_type=_content_type,
2606
- _headers=_headers,
2607
- _host_index=_host_index,
2608
- )
2609
-
2610
- _response_types_map: Dict[str, Optional[str]] = {
2611
- "200": "TenantInviteList",
2612
- "400": "APIErrors",
2613
- "403": "APIError",
2614
- }
2615
- response_data = await self.api_client.call_api(
2616
- *_param, _request_timeout=_request_timeout
2617
- )
2618
- await response_data.read()
2619
- return self.api_client.response_deserialize(
2620
- response_data=response_data,
2621
- response_types_map=_response_types_map,
2622
- ).data
2623
-
2624
- @validate_call
2625
- async def tenant_invite_list_with_http_info(
2626
- self,
2627
- tenant: Annotated[
2628
- str,
2629
- Field(
2630
- min_length=36, strict=True, max_length=36, description="The tenant id"
2631
- ),
2632
- ],
2633
- _request_timeout: Union[
2634
- None,
2635
- Annotated[StrictFloat, Field(gt=0)],
2636
- Tuple[
2637
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2638
- ],
2639
- ] = None,
2640
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2641
- _content_type: Optional[StrictStr] = None,
2642
- _headers: Optional[Dict[StrictStr, Any]] = None,
2643
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2644
- ) -> ApiResponse[TenantInviteList]:
2645
- """List tenant invites
2646
-
2647
- Gets a list of tenant invites
2648
-
2649
- :param tenant: The tenant id (required)
2650
- :type tenant: str
2651
- :param _request_timeout: timeout setting for this request. If one
2652
- number provided, it will be total request
2653
- timeout. It can also be a pair (tuple) of
2654
- (connection, read) timeouts.
2655
- :type _request_timeout: int, tuple(int, int), optional
2656
- :param _request_auth: set to override the auth_settings for an a single
2657
- request; this effectively ignores the
2658
- authentication in the spec for a single request.
2659
- :type _request_auth: dict, optional
2660
- :param _content_type: force content-type for the request.
2661
- :type _content_type: str, Optional
2662
- :param _headers: set to override the headers for a single
2663
- request; this effectively ignores the headers
2664
- in the spec for a single request.
2665
- :type _headers: dict, optional
2666
- :param _host_index: set to override the host_index for a single
2667
- request; this effectively ignores the host_index
2668
- in the spec for a single request.
2669
- :type _host_index: int, optional
2670
- :return: Returns the result object.
2671
- """ # noqa: E501
2672
-
2673
- _param = self._tenant_invite_list_serialize(
2674
- tenant=tenant,
2675
- _request_auth=_request_auth,
2676
- _content_type=_content_type,
2677
- _headers=_headers,
2678
- _host_index=_host_index,
2679
- )
2680
-
2681
- _response_types_map: Dict[str, Optional[str]] = {
2682
- "200": "TenantInviteList",
2683
- "400": "APIErrors",
2684
- "403": "APIError",
2685
- }
2686
- response_data = await self.api_client.call_api(
2687
- *_param, _request_timeout=_request_timeout
2688
- )
2689
- await response_data.read()
2690
- return self.api_client.response_deserialize(
2691
- response_data=response_data,
2692
- response_types_map=_response_types_map,
2693
- )
2694
-
2695
- @validate_call
2696
- async def tenant_invite_list_without_preload_content(
2697
- self,
2698
- tenant: Annotated[
2699
- str,
2700
- Field(
2701
- min_length=36, strict=True, max_length=36, description="The tenant id"
2702
- ),
2703
- ],
2704
- _request_timeout: Union[
2705
- None,
2706
- Annotated[StrictFloat, Field(gt=0)],
2707
- Tuple[
2708
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2709
- ],
2710
- ] = None,
2711
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2712
- _content_type: Optional[StrictStr] = None,
2713
- _headers: Optional[Dict[StrictStr, Any]] = None,
2714
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2715
- ) -> RESTResponseType:
2716
- """List tenant invites
2717
-
2718
- Gets a list of tenant invites
2719
-
2720
- :param tenant: The tenant id (required)
2721
- :type tenant: str
2722
- :param _request_timeout: timeout setting for this request. If one
2723
- number provided, it will be total request
2724
- timeout. It can also be a pair (tuple) of
2725
- (connection, read) timeouts.
2726
- :type _request_timeout: int, tuple(int, int), optional
2727
- :param _request_auth: set to override the auth_settings for an a single
2728
- request; this effectively ignores the
2729
- authentication in the spec for a single request.
2730
- :type _request_auth: dict, optional
2731
- :param _content_type: force content-type for the request.
2732
- :type _content_type: str, Optional
2733
- :param _headers: set to override the headers for a single
2734
- request; this effectively ignores the headers
2735
- in the spec for a single request.
2736
- :type _headers: dict, optional
2737
- :param _host_index: set to override the host_index for a single
2738
- request; this effectively ignores the host_index
2739
- in the spec for a single request.
2740
- :type _host_index: int, optional
2741
- :return: Returns the result object.
2742
- """ # noqa: E501
2743
-
2744
- _param = self._tenant_invite_list_serialize(
2745
- tenant=tenant,
2746
- _request_auth=_request_auth,
2747
- _content_type=_content_type,
2748
- _headers=_headers,
2749
- _host_index=_host_index,
2750
- )
2751
-
2752
- _response_types_map: Dict[str, Optional[str]] = {
2753
- "200": "TenantInviteList",
2754
- "400": "APIErrors",
2755
- "403": "APIError",
2756
- }
2757
- response_data = await self.api_client.call_api(
2758
- *_param, _request_timeout=_request_timeout
2759
- )
2760
- return response_data.response
2761
-
2762
- def _tenant_invite_list_serialize(
2763
- self,
2764
- tenant,
2765
- _request_auth,
2766
- _content_type,
2767
- _headers,
2768
- _host_index,
2769
- ) -> RequestSerialized:
2770
-
2771
- _host = None
2772
-
2773
- _collection_formats: Dict[str, str] = {}
2774
-
2775
- _path_params: Dict[str, str] = {}
2776
- _query_params: List[Tuple[str, str]] = []
2777
- _header_params: Dict[str, Optional[str]] = _headers or {}
2778
- _form_params: List[Tuple[str, str]] = []
2779
- _files: Dict[
2780
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2781
- ] = {}
2782
- _body_params: Optional[bytes] = None
2783
-
2784
- # process the path parameters
2785
- if tenant is not None:
2786
- _path_params["tenant"] = tenant
2787
- # process the query parameters
2788
- # process the header parameters
2789
- # process the form parameters
2790
- # process the body parameter
2791
-
2792
- # set the HTTP header `Accept`
2793
- if "Accept" not in _header_params:
2794
- _header_params["Accept"] = self.api_client.select_header_accept(
2795
- ["application/json"]
2796
- )
2797
-
2798
- # authentication setting
2799
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
2800
-
2801
- return self.api_client.param_serialize(
2802
- method="GET",
2803
- resource_path="/api/v1/tenants/{tenant}/invites",
2804
- path_params=_path_params,
2805
- query_params=_query_params,
2806
- header_params=_header_params,
2807
- body=_body_params,
2808
- post_params=_form_params,
2809
- files=_files,
2810
- auth_settings=_auth_settings,
2811
- collection_formats=_collection_formats,
2812
- _host=_host,
2813
- _request_auth=_request_auth,
2814
- )
2815
-
2816
- @validate_call
2817
- async def tenant_invite_reject(
2818
- self,
2819
- reject_invite_request: Optional[RejectInviteRequest] = None,
2820
- _request_timeout: Union[
2821
- None,
2822
- Annotated[StrictFloat, Field(gt=0)],
2823
- Tuple[
2824
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2825
- ],
2826
- ] = None,
2827
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2828
- _content_type: Optional[StrictStr] = None,
2829
- _headers: Optional[Dict[StrictStr, Any]] = None,
2830
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2831
- ) -> None:
2832
- """Reject tenant invite
2833
-
2834
- Rejects a tenant invite
2835
-
2836
- :param reject_invite_request:
2837
- :type reject_invite_request: RejectInviteRequest
2838
- :param _request_timeout: timeout setting for this request. If one
2839
- number provided, it will be total request
2840
- timeout. It can also be a pair (tuple) of
2841
- (connection, read) timeouts.
2842
- :type _request_timeout: int, tuple(int, int), optional
2843
- :param _request_auth: set to override the auth_settings for an a single
2844
- request; this effectively ignores the
2845
- authentication in the spec for a single request.
2846
- :type _request_auth: dict, optional
2847
- :param _content_type: force content-type for the request.
2848
- :type _content_type: str, Optional
2849
- :param _headers: set to override the headers for a single
2850
- request; this effectively ignores the headers
2851
- in the spec for a single request.
2852
- :type _headers: dict, optional
2853
- :param _host_index: set to override the host_index for a single
2854
- request; this effectively ignores the host_index
2855
- in the spec for a single request.
2856
- :type _host_index: int, optional
2857
- :return: Returns the result object.
2858
- """ # noqa: E501
2859
-
2860
- _param = self._tenant_invite_reject_serialize(
2861
- reject_invite_request=reject_invite_request,
2862
- _request_auth=_request_auth,
2863
- _content_type=_content_type,
2864
- _headers=_headers,
2865
- _host_index=_host_index,
2866
- )
2867
-
2868
- _response_types_map: Dict[str, Optional[str]] = {
2869
- "200": None,
2870
- "400": "APIErrors",
2871
- "403": "APIError",
2872
- }
2873
- response_data = await self.api_client.call_api(
2874
- *_param, _request_timeout=_request_timeout
2875
- )
2876
- await response_data.read()
2877
- return self.api_client.response_deserialize(
2878
- response_data=response_data,
2879
- response_types_map=_response_types_map,
2880
- ).data
2881
-
2882
- @validate_call
2883
- async def tenant_invite_reject_with_http_info(
2884
- self,
2885
- reject_invite_request: Optional[RejectInviteRequest] = None,
2886
- _request_timeout: Union[
2887
- None,
2888
- Annotated[StrictFloat, Field(gt=0)],
2889
- Tuple[
2890
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2891
- ],
2892
- ] = None,
2893
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2894
- _content_type: Optional[StrictStr] = None,
2895
- _headers: Optional[Dict[StrictStr, Any]] = None,
2896
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2897
- ) -> ApiResponse[None]:
2898
- """Reject tenant invite
2899
-
2900
- Rejects a tenant invite
2901
-
2902
- :param reject_invite_request:
2903
- :type reject_invite_request: RejectInviteRequest
2904
- :param _request_timeout: timeout setting for this request. If one
2905
- number provided, it will be total request
2906
- timeout. It can also be a pair (tuple) of
2907
- (connection, read) timeouts.
2908
- :type _request_timeout: int, tuple(int, int), optional
2909
- :param _request_auth: set to override the auth_settings for an a single
2910
- request; this effectively ignores the
2911
- authentication in the spec for a single request.
2912
- :type _request_auth: dict, optional
2913
- :param _content_type: force content-type for the request.
2914
- :type _content_type: str, Optional
2915
- :param _headers: set to override the headers for a single
2916
- request; this effectively ignores the headers
2917
- in the spec for a single request.
2918
- :type _headers: dict, optional
2919
- :param _host_index: set to override the host_index for a single
2920
- request; this effectively ignores the host_index
2921
- in the spec for a single request.
2922
- :type _host_index: int, optional
2923
- :return: Returns the result object.
2924
- """ # noqa: E501
2925
-
2926
- _param = self._tenant_invite_reject_serialize(
2927
- reject_invite_request=reject_invite_request,
2928
- _request_auth=_request_auth,
2929
- _content_type=_content_type,
2930
- _headers=_headers,
2931
- _host_index=_host_index,
2932
- )
2933
-
2934
- _response_types_map: Dict[str, Optional[str]] = {
2935
- "200": None,
2936
- "400": "APIErrors",
2937
- "403": "APIError",
2938
- }
2939
- response_data = await self.api_client.call_api(
2940
- *_param, _request_timeout=_request_timeout
2941
- )
2942
- await response_data.read()
2943
- return self.api_client.response_deserialize(
2944
- response_data=response_data,
2945
- response_types_map=_response_types_map,
2946
- )
2947
-
2948
- @validate_call
2949
- async def tenant_invite_reject_without_preload_content(
2950
- self,
2951
- reject_invite_request: Optional[RejectInviteRequest] = None,
2952
- _request_timeout: Union[
2953
- None,
2954
- Annotated[StrictFloat, Field(gt=0)],
2955
- Tuple[
2956
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2957
- ],
2958
- ] = None,
2959
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2960
- _content_type: Optional[StrictStr] = None,
2961
- _headers: Optional[Dict[StrictStr, Any]] = None,
2962
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2963
- ) -> RESTResponseType:
2964
- """Reject tenant invite
2965
-
2966
- Rejects a tenant invite
2967
-
2968
- :param reject_invite_request:
2969
- :type reject_invite_request: RejectInviteRequest
2970
- :param _request_timeout: timeout setting for this request. If one
2971
- number provided, it will be total request
2972
- timeout. It can also be a pair (tuple) of
2973
- (connection, read) timeouts.
2974
- :type _request_timeout: int, tuple(int, int), optional
2975
- :param _request_auth: set to override the auth_settings for an a single
2976
- request; this effectively ignores the
2977
- authentication in the spec for a single request.
2978
- :type _request_auth: dict, optional
2979
- :param _content_type: force content-type for the request.
2980
- :type _content_type: str, Optional
2981
- :param _headers: set to override the headers for a single
2982
- request; this effectively ignores the headers
2983
- in the spec for a single request.
2984
- :type _headers: dict, optional
2985
- :param _host_index: set to override the host_index for a single
2986
- request; this effectively ignores the host_index
2987
- in the spec for a single request.
2988
- :type _host_index: int, optional
2989
- :return: Returns the result object.
2990
- """ # noqa: E501
2991
-
2992
- _param = self._tenant_invite_reject_serialize(
2993
- reject_invite_request=reject_invite_request,
2994
- _request_auth=_request_auth,
2995
- _content_type=_content_type,
2996
- _headers=_headers,
2997
- _host_index=_host_index,
2998
- )
2999
-
3000
- _response_types_map: Dict[str, Optional[str]] = {
3001
- "200": None,
3002
- "400": "APIErrors",
3003
- "403": "APIError",
3004
- }
3005
- response_data = await self.api_client.call_api(
3006
- *_param, _request_timeout=_request_timeout
3007
- )
3008
- return response_data.response
3009
-
3010
- def _tenant_invite_reject_serialize(
3011
- self,
3012
- reject_invite_request,
3013
- _request_auth,
3014
- _content_type,
3015
- _headers,
3016
- _host_index,
3017
- ) -> RequestSerialized:
3018
-
3019
- _host = None
3020
-
3021
- _collection_formats: Dict[str, str] = {}
3022
-
3023
- _path_params: Dict[str, str] = {}
3024
- _query_params: List[Tuple[str, str]] = []
3025
- _header_params: Dict[str, Optional[str]] = _headers or {}
3026
- _form_params: List[Tuple[str, str]] = []
3027
- _files: Dict[
3028
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3029
- ] = {}
3030
- _body_params: Optional[bytes] = None
3031
-
3032
- # process the path parameters
3033
- # process the query parameters
3034
- # process the header parameters
3035
- # process the form parameters
3036
- # process the body parameter
3037
- if reject_invite_request is not None:
3038
- _body_params = reject_invite_request
3039
-
3040
- # set the HTTP header `Accept`
3041
- if "Accept" not in _header_params:
3042
- _header_params["Accept"] = self.api_client.select_header_accept(
3043
- ["application/json"]
3044
- )
3045
-
3046
- # set the HTTP header `Content-Type`
3047
- if _content_type:
3048
- _header_params["Content-Type"] = _content_type
3049
- else:
3050
- _default_content_type = self.api_client.select_header_content_type(
3051
- ["application/json"]
3052
- )
3053
- if _default_content_type is not None:
3054
- _header_params["Content-Type"] = _default_content_type
3055
-
3056
- # authentication setting
3057
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
3058
-
3059
- return self.api_client.param_serialize(
3060
- method="POST",
3061
- resource_path="/api/v1/users/invites/reject",
3062
- path_params=_path_params,
3063
- query_params=_query_params,
3064
- header_params=_header_params,
3065
- body=_body_params,
3066
- post_params=_form_params,
3067
- files=_files,
3068
- auth_settings=_auth_settings,
3069
- collection_formats=_collection_formats,
3070
- _host=_host,
3071
- _request_auth=_request_auth,
3072
- )
3073
-
3074
- @validate_call
3075
- async def tenant_member_delete(
3076
- self,
3077
- tenant: Annotated[
3078
- str,
3079
- Field(
3080
- min_length=36, strict=True, max_length=36, description="The tenant id"
3081
- ),
3082
- ],
3083
- member: Annotated[
3084
- str,
3085
- Field(
3086
- min_length=36,
3087
- strict=True,
3088
- max_length=36,
3089
- description="The tenant member id",
3090
- ),
3091
- ],
3092
- _request_timeout: Union[
3093
- None,
3094
- Annotated[StrictFloat, Field(gt=0)],
3095
- Tuple[
3096
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3097
- ],
3098
- ] = None,
3099
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3100
- _content_type: Optional[StrictStr] = None,
3101
- _headers: Optional[Dict[StrictStr, Any]] = None,
3102
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3103
- ) -> TenantMember:
3104
- """Delete a tenant member
3105
-
3106
- Delete a member from a tenant
3107
-
3108
- :param tenant: The tenant id (required)
3109
- :type tenant: str
3110
- :param member: The tenant member id (required)
3111
- :type member: str
3112
- :param _request_timeout: timeout setting for this request. If one
3113
- number provided, it will be total request
3114
- timeout. It can also be a pair (tuple) of
3115
- (connection, read) timeouts.
3116
- :type _request_timeout: int, tuple(int, int), optional
3117
- :param _request_auth: set to override the auth_settings for an a single
3118
- request; this effectively ignores the
3119
- authentication in the spec for a single request.
3120
- :type _request_auth: dict, optional
3121
- :param _content_type: force content-type for the request.
3122
- :type _content_type: str, Optional
3123
- :param _headers: set to override the headers for a single
3124
- request; this effectively ignores the headers
3125
- in the spec for a single request.
3126
- :type _headers: dict, optional
3127
- :param _host_index: set to override the host_index for a single
3128
- request; this effectively ignores the host_index
3129
- in the spec for a single request.
3130
- :type _host_index: int, optional
3131
- :return: Returns the result object.
3132
- """ # noqa: E501
3133
-
3134
- _param = self._tenant_member_delete_serialize(
3135
- tenant=tenant,
3136
- member=member,
3137
- _request_auth=_request_auth,
3138
- _content_type=_content_type,
3139
- _headers=_headers,
3140
- _host_index=_host_index,
3141
- )
3142
-
3143
- _response_types_map: Dict[str, Optional[str]] = {
3144
- "204": "TenantMember",
3145
- "400": "APIErrors",
3146
- "403": "APIErrors",
3147
- "404": "APIErrors",
3148
- }
3149
- response_data = await self.api_client.call_api(
3150
- *_param, _request_timeout=_request_timeout
3151
- )
3152
- await response_data.read()
3153
- return self.api_client.response_deserialize(
3154
- response_data=response_data,
3155
- response_types_map=_response_types_map,
3156
- ).data
3157
-
3158
- @validate_call
3159
- async def tenant_member_delete_with_http_info(
3160
- self,
3161
- tenant: Annotated[
3162
- str,
3163
- Field(
3164
- min_length=36, strict=True, max_length=36, description="The tenant id"
3165
- ),
3166
- ],
3167
- member: Annotated[
3168
- str,
3169
- Field(
3170
- min_length=36,
3171
- strict=True,
3172
- max_length=36,
3173
- description="The tenant member id",
3174
- ),
3175
- ],
3176
- _request_timeout: Union[
3177
- None,
3178
- Annotated[StrictFloat, Field(gt=0)],
3179
- Tuple[
3180
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3181
- ],
3182
- ] = None,
3183
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3184
- _content_type: Optional[StrictStr] = None,
3185
- _headers: Optional[Dict[StrictStr, Any]] = None,
3186
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3187
- ) -> ApiResponse[TenantMember]:
3188
- """Delete a tenant member
3189
-
3190
- Delete a member from a tenant
3191
-
3192
- :param tenant: The tenant id (required)
3193
- :type tenant: str
3194
- :param member: The tenant member id (required)
3195
- :type member: str
3196
- :param _request_timeout: timeout setting for this request. If one
3197
- number provided, it will be total request
3198
- timeout. It can also be a pair (tuple) of
3199
- (connection, read) timeouts.
3200
- :type _request_timeout: int, tuple(int, int), optional
3201
- :param _request_auth: set to override the auth_settings for an a single
3202
- request; this effectively ignores the
3203
- authentication in the spec for a single request.
3204
- :type _request_auth: dict, optional
3205
- :param _content_type: force content-type for the request.
3206
- :type _content_type: str, Optional
3207
- :param _headers: set to override the headers for a single
3208
- request; this effectively ignores the headers
3209
- in the spec for a single request.
3210
- :type _headers: dict, optional
3211
- :param _host_index: set to override the host_index for a single
3212
- request; this effectively ignores the host_index
3213
- in the spec for a single request.
3214
- :type _host_index: int, optional
3215
- :return: Returns the result object.
3216
- """ # noqa: E501
3217
-
3218
- _param = self._tenant_member_delete_serialize(
3219
- tenant=tenant,
3220
- member=member,
3221
- _request_auth=_request_auth,
3222
- _content_type=_content_type,
3223
- _headers=_headers,
3224
- _host_index=_host_index,
3225
- )
3226
-
3227
- _response_types_map: Dict[str, Optional[str]] = {
3228
- "204": "TenantMember",
3229
- "400": "APIErrors",
3230
- "403": "APIErrors",
3231
- "404": "APIErrors",
3232
- }
3233
- response_data = await self.api_client.call_api(
3234
- *_param, _request_timeout=_request_timeout
3235
- )
3236
- await response_data.read()
3237
- return self.api_client.response_deserialize(
3238
- response_data=response_data,
3239
- response_types_map=_response_types_map,
3240
- )
3241
-
3242
- @validate_call
3243
- async def tenant_member_delete_without_preload_content(
3244
- self,
3245
- tenant: Annotated[
3246
- str,
3247
- Field(
3248
- min_length=36, strict=True, max_length=36, description="The tenant id"
3249
- ),
3250
- ],
3251
- member: Annotated[
3252
- str,
3253
- Field(
3254
- min_length=36,
3255
- strict=True,
3256
- max_length=36,
3257
- description="The tenant member id",
3258
- ),
3259
- ],
3260
- _request_timeout: Union[
3261
- None,
3262
- Annotated[StrictFloat, Field(gt=0)],
3263
- Tuple[
3264
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3265
- ],
3266
- ] = None,
3267
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3268
- _content_type: Optional[StrictStr] = None,
3269
- _headers: Optional[Dict[StrictStr, Any]] = None,
3270
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3271
- ) -> RESTResponseType:
3272
- """Delete a tenant member
3273
-
3274
- Delete a member from a tenant
3275
-
3276
- :param tenant: The tenant id (required)
3277
- :type tenant: str
3278
- :param member: The tenant member id (required)
3279
- :type member: str
3280
- :param _request_timeout: timeout setting for this request. If one
3281
- number provided, it will be total request
3282
- timeout. It can also be a pair (tuple) of
3283
- (connection, read) timeouts.
3284
- :type _request_timeout: int, tuple(int, int), optional
3285
- :param _request_auth: set to override the auth_settings for an a single
3286
- request; this effectively ignores the
3287
- authentication in the spec for a single request.
3288
- :type _request_auth: dict, optional
3289
- :param _content_type: force content-type for the request.
3290
- :type _content_type: str, Optional
3291
- :param _headers: set to override the headers for a single
3292
- request; this effectively ignores the headers
3293
- in the spec for a single request.
3294
- :type _headers: dict, optional
3295
- :param _host_index: set to override the host_index for a single
3296
- request; this effectively ignores the host_index
3297
- in the spec for a single request.
3298
- :type _host_index: int, optional
3299
- :return: Returns the result object.
3300
- """ # noqa: E501
3301
-
3302
- _param = self._tenant_member_delete_serialize(
3303
- tenant=tenant,
3304
- member=member,
3305
- _request_auth=_request_auth,
3306
- _content_type=_content_type,
3307
- _headers=_headers,
3308
- _host_index=_host_index,
3309
- )
3310
-
3311
- _response_types_map: Dict[str, Optional[str]] = {
3312
- "204": "TenantMember",
3313
- "400": "APIErrors",
3314
- "403": "APIErrors",
3315
- "404": "APIErrors",
3316
- }
3317
- response_data = await self.api_client.call_api(
3318
- *_param, _request_timeout=_request_timeout
3319
- )
3320
- return response_data.response
3321
-
3322
- def _tenant_member_delete_serialize(
3323
- self,
3324
- tenant,
3325
- member,
3326
- _request_auth,
3327
- _content_type,
3328
- _headers,
3329
- _host_index,
3330
- ) -> RequestSerialized:
3331
-
3332
- _host = None
3333
-
3334
- _collection_formats: Dict[str, str] = {}
3335
-
3336
- _path_params: Dict[str, str] = {}
3337
- _query_params: List[Tuple[str, str]] = []
3338
- _header_params: Dict[str, Optional[str]] = _headers or {}
3339
- _form_params: List[Tuple[str, str]] = []
3340
- _files: Dict[
3341
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3342
- ] = {}
3343
- _body_params: Optional[bytes] = None
3344
-
3345
- # process the path parameters
3346
- if tenant is not None:
3347
- _path_params["tenant"] = tenant
3348
- if member is not None:
3349
- _path_params["member"] = member
3350
- # process the query parameters
3351
- # process the header parameters
3352
- # process the form parameters
3353
- # process the body parameter
3354
-
3355
- # set the HTTP header `Accept`
3356
- if "Accept" not in _header_params:
3357
- _header_params["Accept"] = self.api_client.select_header_accept(
3358
- ["application/json"]
3359
- )
3360
-
3361
- # authentication setting
3362
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
3363
-
3364
- return self.api_client.param_serialize(
3365
- method="DELETE",
3366
- resource_path="/api/v1/tenants/{tenant}/members/{member}",
3367
- path_params=_path_params,
3368
- query_params=_query_params,
3369
- header_params=_header_params,
3370
- body=_body_params,
3371
- post_params=_form_params,
3372
- files=_files,
3373
- auth_settings=_auth_settings,
3374
- collection_formats=_collection_formats,
3375
- _host=_host,
3376
- _request_auth=_request_auth,
3377
- )
3378
-
3379
- @validate_call
3380
- async def tenant_member_list(
3381
- self,
3382
- tenant: Annotated[
3383
- str,
3384
- Field(
3385
- min_length=36, strict=True, max_length=36, description="The tenant id"
3386
- ),
3387
- ],
3388
- _request_timeout: Union[
3389
- None,
3390
- Annotated[StrictFloat, Field(gt=0)],
3391
- Tuple[
3392
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3393
- ],
3394
- ] = None,
3395
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3396
- _content_type: Optional[StrictStr] = None,
3397
- _headers: Optional[Dict[StrictStr, Any]] = None,
3398
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3399
- ) -> TenantMemberList:
3400
- """List tenant members
3401
-
3402
- Gets a list of tenant members
3403
-
3404
- :param tenant: The tenant id (required)
3405
- :type tenant: str
3406
- :param _request_timeout: timeout setting for this request. If one
3407
- number provided, it will be total request
3408
- timeout. It can also be a pair (tuple) of
3409
- (connection, read) timeouts.
3410
- :type _request_timeout: int, tuple(int, int), optional
3411
- :param _request_auth: set to override the auth_settings for an a single
3412
- request; this effectively ignores the
3413
- authentication in the spec for a single request.
3414
- :type _request_auth: dict, optional
3415
- :param _content_type: force content-type for the request.
3416
- :type _content_type: str, Optional
3417
- :param _headers: set to override the headers for a single
3418
- request; this effectively ignores the headers
3419
- in the spec for a single request.
3420
- :type _headers: dict, optional
3421
- :param _host_index: set to override the host_index for a single
3422
- request; this effectively ignores the host_index
3423
- in the spec for a single request.
3424
- :type _host_index: int, optional
3425
- :return: Returns the result object.
3426
- """ # noqa: E501
3427
-
3428
- _param = self._tenant_member_list_serialize(
3429
- tenant=tenant,
3430
- _request_auth=_request_auth,
3431
- _content_type=_content_type,
3432
- _headers=_headers,
3433
- _host_index=_host_index,
3434
- )
3435
-
3436
- _response_types_map: Dict[str, Optional[str]] = {
3437
- "200": "TenantMemberList",
3438
- "400": "APIErrors",
3439
- "403": "APIError",
3440
- }
3441
- response_data = await self.api_client.call_api(
3442
- *_param, _request_timeout=_request_timeout
3443
- )
3444
- await response_data.read()
3445
- return self.api_client.response_deserialize(
3446
- response_data=response_data,
3447
- response_types_map=_response_types_map,
3448
- ).data
3449
-
3450
- @validate_call
3451
- async def tenant_member_list_with_http_info(
3452
- self,
3453
- tenant: Annotated[
3454
- str,
3455
- Field(
3456
- min_length=36, strict=True, max_length=36, description="The tenant id"
3457
- ),
3458
- ],
3459
- _request_timeout: Union[
3460
- None,
3461
- Annotated[StrictFloat, Field(gt=0)],
3462
- Tuple[
3463
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3464
- ],
3465
- ] = None,
3466
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3467
- _content_type: Optional[StrictStr] = None,
3468
- _headers: Optional[Dict[StrictStr, Any]] = None,
3469
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3470
- ) -> ApiResponse[TenantMemberList]:
3471
- """List tenant members
3472
-
3473
- Gets a list of tenant members
3474
-
3475
- :param tenant: The tenant id (required)
3476
- :type tenant: str
3477
- :param _request_timeout: timeout setting for this request. If one
3478
- number provided, it will be total request
3479
- timeout. It can also be a pair (tuple) of
3480
- (connection, read) timeouts.
3481
- :type _request_timeout: int, tuple(int, int), optional
3482
- :param _request_auth: set to override the auth_settings for an a single
3483
- request; this effectively ignores the
3484
- authentication in the spec for a single request.
3485
- :type _request_auth: dict, optional
3486
- :param _content_type: force content-type for the request.
3487
- :type _content_type: str, Optional
3488
- :param _headers: set to override the headers for a single
3489
- request; this effectively ignores the headers
3490
- in the spec for a single request.
3491
- :type _headers: dict, optional
3492
- :param _host_index: set to override the host_index for a single
3493
- request; this effectively ignores the host_index
3494
- in the spec for a single request.
3495
- :type _host_index: int, optional
3496
- :return: Returns the result object.
3497
- """ # noqa: E501
3498
-
3499
- _param = self._tenant_member_list_serialize(
3500
- tenant=tenant,
3501
- _request_auth=_request_auth,
3502
- _content_type=_content_type,
3503
- _headers=_headers,
3504
- _host_index=_host_index,
3505
- )
3506
-
3507
- _response_types_map: Dict[str, Optional[str]] = {
3508
- "200": "TenantMemberList",
3509
- "400": "APIErrors",
3510
- "403": "APIError",
3511
- }
3512
- response_data = await self.api_client.call_api(
3513
- *_param, _request_timeout=_request_timeout
3514
- )
3515
- await response_data.read()
3516
- return self.api_client.response_deserialize(
3517
- response_data=response_data,
3518
- response_types_map=_response_types_map,
3519
- )
3520
-
3521
- @validate_call
3522
- async def tenant_member_list_without_preload_content(
3523
- self,
3524
- tenant: Annotated[
3525
- str,
3526
- Field(
3527
- min_length=36, strict=True, max_length=36, description="The tenant id"
3528
- ),
3529
- ],
3530
- _request_timeout: Union[
3531
- None,
3532
- Annotated[StrictFloat, Field(gt=0)],
3533
- Tuple[
3534
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3535
- ],
3536
- ] = None,
3537
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3538
- _content_type: Optional[StrictStr] = None,
3539
- _headers: Optional[Dict[StrictStr, Any]] = None,
3540
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3541
- ) -> RESTResponseType:
3542
- """List tenant members
3543
-
3544
- Gets a list of tenant members
3545
-
3546
- :param tenant: The tenant id (required)
3547
- :type tenant: str
3548
- :param _request_timeout: timeout setting for this request. If one
3549
- number provided, it will be total request
3550
- timeout. It can also be a pair (tuple) of
3551
- (connection, read) timeouts.
3552
- :type _request_timeout: int, tuple(int, int), optional
3553
- :param _request_auth: set to override the auth_settings for an a single
3554
- request; this effectively ignores the
3555
- authentication in the spec for a single request.
3556
- :type _request_auth: dict, optional
3557
- :param _content_type: force content-type for the request.
3558
- :type _content_type: str, Optional
3559
- :param _headers: set to override the headers for a single
3560
- request; this effectively ignores the headers
3561
- in the spec for a single request.
3562
- :type _headers: dict, optional
3563
- :param _host_index: set to override the host_index for a single
3564
- request; this effectively ignores the host_index
3565
- in the spec for a single request.
3566
- :type _host_index: int, optional
3567
- :return: Returns the result object.
3568
- """ # noqa: E501
3569
-
3570
- _param = self._tenant_member_list_serialize(
3571
- tenant=tenant,
3572
- _request_auth=_request_auth,
3573
- _content_type=_content_type,
3574
- _headers=_headers,
3575
- _host_index=_host_index,
3576
- )
3577
-
3578
- _response_types_map: Dict[str, Optional[str]] = {
3579
- "200": "TenantMemberList",
3580
- "400": "APIErrors",
3581
- "403": "APIError",
3582
- }
3583
- response_data = await self.api_client.call_api(
3584
- *_param, _request_timeout=_request_timeout
3585
- )
3586
- return response_data.response
3587
-
3588
- def _tenant_member_list_serialize(
3589
- self,
3590
- tenant,
3591
- _request_auth,
3592
- _content_type,
3593
- _headers,
3594
- _host_index,
3595
- ) -> RequestSerialized:
3596
-
3597
- _host = None
3598
-
3599
- _collection_formats: Dict[str, str] = {}
3600
-
3601
- _path_params: Dict[str, str] = {}
3602
- _query_params: List[Tuple[str, str]] = []
3603
- _header_params: Dict[str, Optional[str]] = _headers or {}
3604
- _form_params: List[Tuple[str, str]] = []
3605
- _files: Dict[
3606
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3607
- ] = {}
3608
- _body_params: Optional[bytes] = None
3609
-
3610
- # process the path parameters
3611
- if tenant is not None:
3612
- _path_params["tenant"] = tenant
3613
- # process the query parameters
3614
- # process the header parameters
3615
- # process the form parameters
3616
- # process the body parameter
3617
-
3618
- # set the HTTP header `Accept`
3619
- if "Accept" not in _header_params:
3620
- _header_params["Accept"] = self.api_client.select_header_accept(
3621
- ["application/json"]
3622
- )
3623
-
3624
- # authentication setting
3625
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
3626
-
3627
- return self.api_client.param_serialize(
3628
- method="GET",
3629
- resource_path="/api/v1/tenants/{tenant}/members",
3630
- path_params=_path_params,
3631
- query_params=_query_params,
3632
- header_params=_header_params,
3633
- body=_body_params,
3634
- post_params=_form_params,
3635
- files=_files,
3636
- auth_settings=_auth_settings,
3637
- collection_formats=_collection_formats,
3638
- _host=_host,
3639
- _request_auth=_request_auth,
3640
- )
3641
-
3642
- @validate_call
3643
- async def tenant_resource_policy_get(
3644
- self,
3645
- tenant: Annotated[
3646
- str,
3647
- Field(
3648
- min_length=36, strict=True, max_length=36, description="The tenant id"
3649
- ),
3650
- ],
3651
- _request_timeout: Union[
3652
- None,
3653
- Annotated[StrictFloat, Field(gt=0)],
3654
- Tuple[
3655
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3656
- ],
3657
- ] = None,
3658
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3659
- _content_type: Optional[StrictStr] = None,
3660
- _headers: Optional[Dict[StrictStr, Any]] = None,
3661
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3662
- ) -> TenantResourcePolicy:
3663
- """Create tenant alert email group
3664
-
3665
- Gets the resource policy for a tenant
3666
-
3667
- :param tenant: The tenant id (required)
3668
- :type tenant: str
3669
- :param _request_timeout: timeout setting for this request. If one
3670
- number provided, it will be total request
3671
- timeout. It can also be a pair (tuple) of
3672
- (connection, read) timeouts.
3673
- :type _request_timeout: int, tuple(int, int), optional
3674
- :param _request_auth: set to override the auth_settings for an a single
3675
- request; this effectively ignores the
3676
- authentication in the spec for a single request.
3677
- :type _request_auth: dict, optional
3678
- :param _content_type: force content-type for the request.
3679
- :type _content_type: str, Optional
3680
- :param _headers: set to override the headers for a single
3681
- request; this effectively ignores the headers
3682
- in the spec for a single request.
3683
- :type _headers: dict, optional
3684
- :param _host_index: set to override the host_index for a single
3685
- request; this effectively ignores the host_index
3686
- in the spec for a single request.
3687
- :type _host_index: int, optional
3688
- :return: Returns the result object.
3689
- """ # noqa: E501
3690
-
3691
- _param = self._tenant_resource_policy_get_serialize(
3692
- tenant=tenant,
3693
- _request_auth=_request_auth,
3694
- _content_type=_content_type,
3695
- _headers=_headers,
3696
- _host_index=_host_index,
3697
- )
3698
-
3699
- _response_types_map: Dict[str, Optional[str]] = {
3700
- "200": "TenantResourcePolicy",
3701
- "400": "APIErrors",
3702
- "403": "APIError",
3703
- }
3704
- response_data = await self.api_client.call_api(
3705
- *_param, _request_timeout=_request_timeout
3706
- )
3707
- await response_data.read()
3708
- return self.api_client.response_deserialize(
3709
- response_data=response_data,
3710
- response_types_map=_response_types_map,
3711
- ).data
3712
-
3713
- @validate_call
3714
- async def tenant_resource_policy_get_with_http_info(
3715
- self,
3716
- tenant: Annotated[
3717
- str,
3718
- Field(
3719
- min_length=36, strict=True, max_length=36, description="The tenant id"
3720
- ),
3721
- ],
3722
- _request_timeout: Union[
3723
- None,
3724
- Annotated[StrictFloat, Field(gt=0)],
3725
- Tuple[
3726
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3727
- ],
3728
- ] = None,
3729
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3730
- _content_type: Optional[StrictStr] = None,
3731
- _headers: Optional[Dict[StrictStr, Any]] = None,
3732
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3733
- ) -> ApiResponse[TenantResourcePolicy]:
3734
- """Create tenant alert email group
3735
-
3736
- Gets the resource policy for a tenant
3737
-
3738
- :param tenant: The tenant id (required)
3739
- :type tenant: str
3740
- :param _request_timeout: timeout setting for this request. If one
3741
- number provided, it will be total request
3742
- timeout. It can also be a pair (tuple) of
3743
- (connection, read) timeouts.
3744
- :type _request_timeout: int, tuple(int, int), optional
3745
- :param _request_auth: set to override the auth_settings for an a single
3746
- request; this effectively ignores the
3747
- authentication in the spec for a single request.
3748
- :type _request_auth: dict, optional
3749
- :param _content_type: force content-type for the request.
3750
- :type _content_type: str, Optional
3751
- :param _headers: set to override the headers for a single
3752
- request; this effectively ignores the headers
3753
- in the spec for a single request.
3754
- :type _headers: dict, optional
3755
- :param _host_index: set to override the host_index for a single
3756
- request; this effectively ignores the host_index
3757
- in the spec for a single request.
3758
- :type _host_index: int, optional
3759
- :return: Returns the result object.
3760
- """ # noqa: E501
3761
-
3762
- _param = self._tenant_resource_policy_get_serialize(
3763
- tenant=tenant,
3764
- _request_auth=_request_auth,
3765
- _content_type=_content_type,
3766
- _headers=_headers,
3767
- _host_index=_host_index,
3768
- )
3769
-
3770
- _response_types_map: Dict[str, Optional[str]] = {
3771
- "200": "TenantResourcePolicy",
3772
- "400": "APIErrors",
3773
- "403": "APIError",
3774
- }
3775
- response_data = await self.api_client.call_api(
3776
- *_param, _request_timeout=_request_timeout
3777
- )
3778
- await response_data.read()
3779
- return self.api_client.response_deserialize(
3780
- response_data=response_data,
3781
- response_types_map=_response_types_map,
3782
- )
3783
-
3784
- @validate_call
3785
- async def tenant_resource_policy_get_without_preload_content(
3786
- self,
3787
- tenant: Annotated[
3788
- str,
3789
- Field(
3790
- min_length=36, strict=True, max_length=36, description="The tenant id"
3791
- ),
3792
- ],
3793
- _request_timeout: Union[
3794
- None,
3795
- Annotated[StrictFloat, Field(gt=0)],
3796
- Tuple[
3797
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3798
- ],
3799
- ] = None,
3800
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3801
- _content_type: Optional[StrictStr] = None,
3802
- _headers: Optional[Dict[StrictStr, Any]] = None,
3803
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3804
- ) -> RESTResponseType:
3805
- """Create tenant alert email group
3806
-
3807
- Gets the resource policy for a tenant
3808
-
3809
- :param tenant: The tenant id (required)
3810
- :type tenant: str
3811
- :param _request_timeout: timeout setting for this request. If one
3812
- number provided, it will be total request
3813
- timeout. It can also be a pair (tuple) of
3814
- (connection, read) timeouts.
3815
- :type _request_timeout: int, tuple(int, int), optional
3816
- :param _request_auth: set to override the auth_settings for an a single
3817
- request; this effectively ignores the
3818
- authentication in the spec for a single request.
3819
- :type _request_auth: dict, optional
3820
- :param _content_type: force content-type for the request.
3821
- :type _content_type: str, Optional
3822
- :param _headers: set to override the headers for a single
3823
- request; this effectively ignores the headers
3824
- in the spec for a single request.
3825
- :type _headers: dict, optional
3826
- :param _host_index: set to override the host_index for a single
3827
- request; this effectively ignores the host_index
3828
- in the spec for a single request.
3829
- :type _host_index: int, optional
3830
- :return: Returns the result object.
3831
- """ # noqa: E501
3832
-
3833
- _param = self._tenant_resource_policy_get_serialize(
3834
- tenant=tenant,
3835
- _request_auth=_request_auth,
3836
- _content_type=_content_type,
3837
- _headers=_headers,
3838
- _host_index=_host_index,
3839
- )
3840
-
3841
- _response_types_map: Dict[str, Optional[str]] = {
3842
- "200": "TenantResourcePolicy",
3843
- "400": "APIErrors",
3844
- "403": "APIError",
3845
- }
3846
- response_data = await self.api_client.call_api(
3847
- *_param, _request_timeout=_request_timeout
3848
- )
3849
- return response_data.response
3850
-
3851
- def _tenant_resource_policy_get_serialize(
3852
- self,
3853
- tenant,
3854
- _request_auth,
3855
- _content_type,
3856
- _headers,
3857
- _host_index,
3858
- ) -> RequestSerialized:
3859
-
3860
- _host = None
3861
-
3862
- _collection_formats: Dict[str, str] = {}
3863
-
3864
- _path_params: Dict[str, str] = {}
3865
- _query_params: List[Tuple[str, str]] = []
3866
- _header_params: Dict[str, Optional[str]] = _headers or {}
3867
- _form_params: List[Tuple[str, str]] = []
3868
- _files: Dict[
3869
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3870
- ] = {}
3871
- _body_params: Optional[bytes] = None
3872
-
3873
- # process the path parameters
3874
- if tenant is not None:
3875
- _path_params["tenant"] = tenant
3876
- # process the query parameters
3877
- # process the header parameters
3878
- # process the form parameters
3879
- # process the body parameter
3880
-
3881
- # set the HTTP header `Accept`
3882
- if "Accept" not in _header_params:
3883
- _header_params["Accept"] = self.api_client.select_header_accept(
3884
- ["application/json"]
3885
- )
3886
-
3887
- # authentication setting
3888
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
3889
-
3890
- return self.api_client.param_serialize(
3891
- method="GET",
3892
- resource_path="/api/v1/tenants/{tenant}/resource-policy",
3893
- path_params=_path_params,
3894
- query_params=_query_params,
3895
- header_params=_header_params,
3896
- body=_body_params,
3897
- post_params=_form_params,
3898
- files=_files,
3899
- auth_settings=_auth_settings,
3900
- collection_formats=_collection_formats,
3901
- _host=_host,
3902
- _request_auth=_request_auth,
3903
- )
3904
-
3905
- @validate_call
3906
- async def tenant_update(
3907
- self,
3908
- tenant: Annotated[
3909
- str,
3910
- Field(
3911
- min_length=36, strict=True, max_length=36, description="The tenant id"
3912
- ),
3913
- ],
3914
- update_tenant_request: Annotated[
3915
- UpdateTenantRequest, Field(description="The tenant properties to update")
3916
- ],
3917
- _request_timeout: Union[
3918
- None,
3919
- Annotated[StrictFloat, Field(gt=0)],
3920
- Tuple[
3921
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3922
- ],
3923
- ] = None,
3924
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3925
- _content_type: Optional[StrictStr] = None,
3926
- _headers: Optional[Dict[StrictStr, Any]] = None,
3927
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3928
- ) -> Tenant:
3929
- """Update tenant
3930
-
3931
- Update an existing tenant
3932
-
3933
- :param tenant: The tenant id (required)
3934
- :type tenant: str
3935
- :param update_tenant_request: The tenant properties to update (required)
3936
- :type update_tenant_request: UpdateTenantRequest
3937
- :param _request_timeout: timeout setting for this request. If one
3938
- number provided, it will be total request
3939
- timeout. It can also be a pair (tuple) of
3940
- (connection, read) timeouts.
3941
- :type _request_timeout: int, tuple(int, int), optional
3942
- :param _request_auth: set to override the auth_settings for an a single
3943
- request; this effectively ignores the
3944
- authentication in the spec for a single request.
3945
- :type _request_auth: dict, optional
3946
- :param _content_type: force content-type for the request.
3947
- :type _content_type: str, Optional
3948
- :param _headers: set to override the headers for a single
3949
- request; this effectively ignores the headers
3950
- in the spec for a single request.
3951
- :type _headers: dict, optional
3952
- :param _host_index: set to override the host_index for a single
3953
- request; this effectively ignores the host_index
3954
- in the spec for a single request.
3955
- :type _host_index: int, optional
3956
- :return: Returns the result object.
3957
- """ # noqa: E501
3958
-
3959
- _param = self._tenant_update_serialize(
3960
- tenant=tenant,
3961
- update_tenant_request=update_tenant_request,
3962
- _request_auth=_request_auth,
3963
- _content_type=_content_type,
3964
- _headers=_headers,
3965
- _host_index=_host_index,
3966
- )
3967
-
3968
- _response_types_map: Dict[str, Optional[str]] = {
3969
- "200": "Tenant",
3970
- "400": "APIErrors",
3971
- "403": "APIError",
3972
- }
3973
- response_data = await self.api_client.call_api(
3974
- *_param, _request_timeout=_request_timeout
3975
- )
3976
- await response_data.read()
3977
- return self.api_client.response_deserialize(
3978
- response_data=response_data,
3979
- response_types_map=_response_types_map,
3980
- ).data
3981
-
3982
- @validate_call
3983
- async def tenant_update_with_http_info(
3984
- self,
3985
- tenant: Annotated[
3986
- str,
3987
- Field(
3988
- min_length=36, strict=True, max_length=36, description="The tenant id"
3989
- ),
3990
- ],
3991
- update_tenant_request: Annotated[
3992
- UpdateTenantRequest, Field(description="The tenant properties to update")
3993
- ],
3994
- _request_timeout: Union[
3995
- None,
3996
- Annotated[StrictFloat, Field(gt=0)],
3997
- Tuple[
3998
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
3999
- ],
4000
- ] = None,
4001
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
4002
- _content_type: Optional[StrictStr] = None,
4003
- _headers: Optional[Dict[StrictStr, Any]] = None,
4004
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4005
- ) -> ApiResponse[Tenant]:
4006
- """Update tenant
4007
-
4008
- Update an existing tenant
4009
-
4010
- :param tenant: The tenant id (required)
4011
- :type tenant: str
4012
- :param update_tenant_request: The tenant properties to update (required)
4013
- :type update_tenant_request: UpdateTenantRequest
4014
- :param _request_timeout: timeout setting for this request. If one
4015
- number provided, it will be total request
4016
- timeout. It can also be a pair (tuple) of
4017
- (connection, read) timeouts.
4018
- :type _request_timeout: int, tuple(int, int), optional
4019
- :param _request_auth: set to override the auth_settings for an a single
4020
- request; this effectively ignores the
4021
- authentication in the spec for a single request.
4022
- :type _request_auth: dict, optional
4023
- :param _content_type: force content-type for the request.
4024
- :type _content_type: str, Optional
4025
- :param _headers: set to override the headers for a single
4026
- request; this effectively ignores the headers
4027
- in the spec for a single request.
4028
- :type _headers: dict, optional
4029
- :param _host_index: set to override the host_index for a single
4030
- request; this effectively ignores the host_index
4031
- in the spec for a single request.
4032
- :type _host_index: int, optional
4033
- :return: Returns the result object.
4034
- """ # noqa: E501
4035
-
4036
- _param = self._tenant_update_serialize(
4037
- tenant=tenant,
4038
- update_tenant_request=update_tenant_request,
4039
- _request_auth=_request_auth,
4040
- _content_type=_content_type,
4041
- _headers=_headers,
4042
- _host_index=_host_index,
4043
- )
4044
-
4045
- _response_types_map: Dict[str, Optional[str]] = {
4046
- "200": "Tenant",
4047
- "400": "APIErrors",
4048
- "403": "APIError",
4049
- }
4050
- response_data = await self.api_client.call_api(
4051
- *_param, _request_timeout=_request_timeout
4052
- )
4053
- await response_data.read()
4054
- return self.api_client.response_deserialize(
4055
- response_data=response_data,
4056
- response_types_map=_response_types_map,
4057
- )
4058
-
4059
- @validate_call
4060
- async def tenant_update_without_preload_content(
4061
- self,
4062
- tenant: Annotated[
4063
- str,
4064
- Field(
4065
- min_length=36, strict=True, max_length=36, description="The tenant id"
4066
- ),
4067
- ],
4068
- update_tenant_request: Annotated[
4069
- UpdateTenantRequest, Field(description="The tenant properties to update")
4070
- ],
4071
- _request_timeout: Union[
4072
- None,
4073
- Annotated[StrictFloat, Field(gt=0)],
4074
- Tuple[
4075
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
4076
- ],
4077
- ] = None,
4078
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
4079
- _content_type: Optional[StrictStr] = None,
4080
- _headers: Optional[Dict[StrictStr, Any]] = None,
4081
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4082
- ) -> RESTResponseType:
4083
- """Update tenant
4084
-
4085
- Update an existing tenant
4086
-
4087
- :param tenant: The tenant id (required)
4088
- :type tenant: str
4089
- :param update_tenant_request: The tenant properties to update (required)
4090
- :type update_tenant_request: UpdateTenantRequest
4091
- :param _request_timeout: timeout setting for this request. If one
4092
- number provided, it will be total request
4093
- timeout. It can also be a pair (tuple) of
4094
- (connection, read) timeouts.
4095
- :type _request_timeout: int, tuple(int, int), optional
4096
- :param _request_auth: set to override the auth_settings for an a single
4097
- request; this effectively ignores the
4098
- authentication in the spec for a single request.
4099
- :type _request_auth: dict, optional
4100
- :param _content_type: force content-type for the request.
4101
- :type _content_type: str, Optional
4102
- :param _headers: set to override the headers for a single
4103
- request; this effectively ignores the headers
4104
- in the spec for a single request.
4105
- :type _headers: dict, optional
4106
- :param _host_index: set to override the host_index for a single
4107
- request; this effectively ignores the host_index
4108
- in the spec for a single request.
4109
- :type _host_index: int, optional
4110
- :return: Returns the result object.
4111
- """ # noqa: E501
4112
-
4113
- _param = self._tenant_update_serialize(
4114
- tenant=tenant,
4115
- update_tenant_request=update_tenant_request,
4116
- _request_auth=_request_auth,
4117
- _content_type=_content_type,
4118
- _headers=_headers,
4119
- _host_index=_host_index,
4120
- )
4121
-
4122
- _response_types_map: Dict[str, Optional[str]] = {
4123
- "200": "Tenant",
4124
- "400": "APIErrors",
4125
- "403": "APIError",
4126
- }
4127
- response_data = await self.api_client.call_api(
4128
- *_param, _request_timeout=_request_timeout
4129
- )
4130
- return response_data.response
4131
-
4132
- def _tenant_update_serialize(
4133
- self,
4134
- tenant,
4135
- update_tenant_request,
4136
- _request_auth,
4137
- _content_type,
4138
- _headers,
4139
- _host_index,
4140
- ) -> RequestSerialized:
4141
-
4142
- _host = None
4143
-
4144
- _collection_formats: Dict[str, str] = {}
4145
-
4146
- _path_params: Dict[str, str] = {}
4147
- _query_params: List[Tuple[str, str]] = []
4148
- _header_params: Dict[str, Optional[str]] = _headers or {}
4149
- _form_params: List[Tuple[str, str]] = []
4150
- _files: Dict[
4151
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
4152
- ] = {}
4153
- _body_params: Optional[bytes] = None
4154
-
4155
- # process the path parameters
4156
- if tenant is not None:
4157
- _path_params["tenant"] = tenant
4158
- # process the query parameters
4159
- # process the header parameters
4160
- # process the form parameters
4161
- # process the body parameter
4162
- if update_tenant_request is not None:
4163
- _body_params = update_tenant_request
4164
-
4165
- # set the HTTP header `Accept`
4166
- if "Accept" not in _header_params:
4167
- _header_params["Accept"] = self.api_client.select_header_accept(
4168
- ["application/json"]
4169
- )
4170
-
4171
- # set the HTTP header `Content-Type`
4172
- if _content_type:
4173
- _header_params["Content-Type"] = _content_type
4174
- else:
4175
- _default_content_type = self.api_client.select_header_content_type(
4176
- ["application/json"]
4177
- )
4178
- if _default_content_type is not None:
4179
- _header_params["Content-Type"] = _default_content_type
4180
-
4181
- # authentication setting
4182
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
4183
-
4184
- return self.api_client.param_serialize(
4185
- method="PATCH",
4186
- resource_path="/api/v1/tenants/{tenant}",
4187
- path_params=_path_params,
4188
- query_params=_query_params,
4189
- header_params=_header_params,
4190
- body=_body_params,
4191
- post_params=_form_params,
4192
- files=_files,
4193
- auth_settings=_auth_settings,
4194
- collection_formats=_collection_formats,
4195
- _host=_host,
4196
- _request_auth=_request_auth,
4197
- )
4198
-
4199
- @validate_call
4200
- async def user_list_tenant_invites(
4201
- self,
4202
- _request_timeout: Union[
4203
- None,
4204
- Annotated[StrictFloat, Field(gt=0)],
4205
- Tuple[
4206
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
4207
- ],
4208
- ] = None,
4209
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
4210
- _content_type: Optional[StrictStr] = None,
4211
- _headers: Optional[Dict[StrictStr, Any]] = None,
4212
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4213
- ) -> TenantInviteList:
4214
- """List tenant invites
4215
-
4216
- Lists all tenant invites for the current user
4217
-
4218
- :param _request_timeout: timeout setting for this request. If one
4219
- number provided, it will be total request
4220
- timeout. It can also be a pair (tuple) of
4221
- (connection, read) timeouts.
4222
- :type _request_timeout: int, tuple(int, int), optional
4223
- :param _request_auth: set to override the auth_settings for an a single
4224
- request; this effectively ignores the
4225
- authentication in the spec for a single request.
4226
- :type _request_auth: dict, optional
4227
- :param _content_type: force content-type for the request.
4228
- :type _content_type: str, Optional
4229
- :param _headers: set to override the headers for a single
4230
- request; this effectively ignores the headers
4231
- in the spec for a single request.
4232
- :type _headers: dict, optional
4233
- :param _host_index: set to override the host_index for a single
4234
- request; this effectively ignores the host_index
4235
- in the spec for a single request.
4236
- :type _host_index: int, optional
4237
- :return: Returns the result object.
4238
- """ # noqa: E501
4239
-
4240
- _param = self._user_list_tenant_invites_serialize(
4241
- _request_auth=_request_auth,
4242
- _content_type=_content_type,
4243
- _headers=_headers,
4244
- _host_index=_host_index,
4245
- )
4246
-
4247
- _response_types_map: Dict[str, Optional[str]] = {
4248
- "200": "TenantInviteList",
4249
- "400": "APIErrors",
4250
- "403": "APIErrors",
4251
- }
4252
- response_data = await self.api_client.call_api(
4253
- *_param, _request_timeout=_request_timeout
4254
- )
4255
- await response_data.read()
4256
- return self.api_client.response_deserialize(
4257
- response_data=response_data,
4258
- response_types_map=_response_types_map,
4259
- ).data
4260
-
4261
- @validate_call
4262
- async def user_list_tenant_invites_with_http_info(
4263
- self,
4264
- _request_timeout: Union[
4265
- None,
4266
- Annotated[StrictFloat, Field(gt=0)],
4267
- Tuple[
4268
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
4269
- ],
4270
- ] = None,
4271
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
4272
- _content_type: Optional[StrictStr] = None,
4273
- _headers: Optional[Dict[StrictStr, Any]] = None,
4274
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4275
- ) -> ApiResponse[TenantInviteList]:
4276
- """List tenant invites
4277
-
4278
- Lists all tenant invites for the current user
4279
-
4280
- :param _request_timeout: timeout setting for this request. If one
4281
- number provided, it will be total request
4282
- timeout. It can also be a pair (tuple) of
4283
- (connection, read) timeouts.
4284
- :type _request_timeout: int, tuple(int, int), optional
4285
- :param _request_auth: set to override the auth_settings for an a single
4286
- request; this effectively ignores the
4287
- authentication in the spec for a single request.
4288
- :type _request_auth: dict, optional
4289
- :param _content_type: force content-type for the request.
4290
- :type _content_type: str, Optional
4291
- :param _headers: set to override the headers for a single
4292
- request; this effectively ignores the headers
4293
- in the spec for a single request.
4294
- :type _headers: dict, optional
4295
- :param _host_index: set to override the host_index for a single
4296
- request; this effectively ignores the host_index
4297
- in the spec for a single request.
4298
- :type _host_index: int, optional
4299
- :return: Returns the result object.
4300
- """ # noqa: E501
4301
-
4302
- _param = self._user_list_tenant_invites_serialize(
4303
- _request_auth=_request_auth,
4304
- _content_type=_content_type,
4305
- _headers=_headers,
4306
- _host_index=_host_index,
4307
- )
4308
-
4309
- _response_types_map: Dict[str, Optional[str]] = {
4310
- "200": "TenantInviteList",
4311
- "400": "APIErrors",
4312
- "403": "APIErrors",
4313
- }
4314
- response_data = await self.api_client.call_api(
4315
- *_param, _request_timeout=_request_timeout
4316
- )
4317
- await response_data.read()
4318
- return self.api_client.response_deserialize(
4319
- response_data=response_data,
4320
- response_types_map=_response_types_map,
4321
- )
4322
-
4323
- @validate_call
4324
- async def user_list_tenant_invites_without_preload_content(
4325
- self,
4326
- _request_timeout: Union[
4327
- None,
4328
- Annotated[StrictFloat, Field(gt=0)],
4329
- Tuple[
4330
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
4331
- ],
4332
- ] = None,
4333
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
4334
- _content_type: Optional[StrictStr] = None,
4335
- _headers: Optional[Dict[StrictStr, Any]] = None,
4336
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4337
- ) -> RESTResponseType:
4338
- """List tenant invites
4339
-
4340
- Lists all tenant invites for the current user
4341
-
4342
- :param _request_timeout: timeout setting for this request. If one
4343
- number provided, it will be total request
4344
- timeout. It can also be a pair (tuple) of
4345
- (connection, read) timeouts.
4346
- :type _request_timeout: int, tuple(int, int), optional
4347
- :param _request_auth: set to override the auth_settings for an a single
4348
- request; this effectively ignores the
4349
- authentication in the spec for a single request.
4350
- :type _request_auth: dict, optional
4351
- :param _content_type: force content-type for the request.
4352
- :type _content_type: str, Optional
4353
- :param _headers: set to override the headers for a single
4354
- request; this effectively ignores the headers
4355
- in the spec for a single request.
4356
- :type _headers: dict, optional
4357
- :param _host_index: set to override the host_index for a single
4358
- request; this effectively ignores the host_index
4359
- in the spec for a single request.
4360
- :type _host_index: int, optional
4361
- :return: Returns the result object.
4362
- """ # noqa: E501
4363
-
4364
- _param = self._user_list_tenant_invites_serialize(
4365
- _request_auth=_request_auth,
4366
- _content_type=_content_type,
4367
- _headers=_headers,
4368
- _host_index=_host_index,
4369
- )
4370
-
4371
- _response_types_map: Dict[str, Optional[str]] = {
4372
- "200": "TenantInviteList",
4373
- "400": "APIErrors",
4374
- "403": "APIErrors",
4375
- }
4376
- response_data = await self.api_client.call_api(
4377
- *_param, _request_timeout=_request_timeout
4378
- )
4379
- return response_data.response
4380
-
4381
- def _user_list_tenant_invites_serialize(
4382
- self,
4383
- _request_auth,
4384
- _content_type,
4385
- _headers,
4386
- _host_index,
4387
- ) -> RequestSerialized:
4388
-
4389
- _host = None
4390
-
4391
- _collection_formats: Dict[str, str] = {}
4392
-
4393
- _path_params: Dict[str, str] = {}
4394
- _query_params: List[Tuple[str, str]] = []
4395
- _header_params: Dict[str, Optional[str]] = _headers or {}
4396
- _form_params: List[Tuple[str, str]] = []
4397
- _files: Dict[
4398
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
4399
- ] = {}
4400
- _body_params: Optional[bytes] = None
4401
-
4402
- # process the path parameters
4403
- # process the query parameters
4404
- # process the header parameters
4405
- # process the form parameters
4406
- # process the body parameter
4407
-
4408
- # set the HTTP header `Accept`
4409
- if "Accept" not in _header_params:
4410
- _header_params["Accept"] = self.api_client.select_header_accept(
4411
- ["application/json"]
4412
- )
4413
-
4414
- # authentication setting
4415
- _auth_settings: List[str] = ["cookieAuth"]
4416
-
4417
- return self.api_client.param_serialize(
4418
- method="GET",
4419
- resource_path="/api/v1/users/invites",
4420
- path_params=_path_params,
4421
- query_params=_query_params,
4422
- header_params=_header_params,
4423
- body=_body_params,
4424
- post_params=_form_params,
4425
- files=_files,
4426
- auth_settings=_auth_settings,
4427
- collection_formats=_collection_formats,
4428
- _host=_host,
4429
- _request_auth=_request_auth,
4430
- )