permify 0.0.1__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.
Files changed (147) hide show
  1. permify/__init__.py +166 -0
  2. permify/api/__init__.py +10 -0
  3. permify/api/bundle_api.py +893 -0
  4. permify/api/data_api.py +2033 -0
  5. permify/api/permission_api.py +1748 -0
  6. permify/api/schema_api.py +1178 -0
  7. permify/api/tenancy_api.py +834 -0
  8. permify/api/watch_api.py +323 -0
  9. permify/api_client.py +782 -0
  10. permify/api_response.py +21 -0
  11. permify/configuration.py +480 -0
  12. permify/exceptions.py +200 -0
  13. permify/models/__init__.py +144 -0
  14. permify/models/abstract_type.py +100 -0
  15. permify/models/any.py +101 -0
  16. permify/models/argument.py +98 -0
  17. permify/models/attribute.py +100 -0
  18. permify/models/attribute_definition.py +91 -0
  19. permify/models/attribute_filter.py +94 -0
  20. permify/models/attribute_read_request_metadata.py +88 -0
  21. permify/models/attribute_read_response.py +98 -0
  22. permify/models/attribute_type.py +44 -0
  23. permify/models/bundle_delete_body.py +88 -0
  24. permify/models/bundle_delete_response.py +88 -0
  25. permify/models/bundle_read_body.py +88 -0
  26. permify/models/bundle_read_response.py +92 -0
  27. permify/models/bundle_run_response.py +88 -0
  28. permify/models/bundle_write_body.py +96 -0
  29. permify/models/bundle_write_response.py +88 -0
  30. permify/models/check_body.py +122 -0
  31. permify/models/check_result.py +38 -0
  32. permify/models/checked_expr.py +130 -0
  33. permify/models/child.py +100 -0
  34. permify/models/comprehension.py +118 -0
  35. permify/models/computed_attribute.py +88 -0
  36. permify/models/computed_user_set.py +88 -0
  37. permify/models/constant.py +116 -0
  38. permify/models/context.py +108 -0
  39. permify/models/context_attribute.py +88 -0
  40. permify/models/create_list.py +100 -0
  41. permify/models/create_struct.py +100 -0
  42. permify/models/data_bundle.py +100 -0
  43. permify/models/data_change.py +101 -0
  44. permify/models/data_change_operation.py +38 -0
  45. permify/models/data_changes.py +98 -0
  46. permify/models/data_delete_body.py +98 -0
  47. permify/models/data_delete_response.py +88 -0
  48. permify/models/data_write_body.py +112 -0
  49. permify/models/data_write_request_metadata.py +88 -0
  50. permify/models/data_write_response.py +88 -0
  51. permify/models/delete_relationships_body.py +92 -0
  52. permify/models/entity.py +90 -0
  53. permify/models/entity_definition.py +136 -0
  54. permify/models/entity_definition_reference.py +39 -0
  55. permify/models/entity_filter.py +90 -0
  56. permify/models/entry.py +105 -0
  57. permify/models/expand_leaf.py +104 -0
  58. permify/models/expand_tree_node.py +101 -0
  59. permify/models/expand_tree_node_operation.py +39 -0
  60. permify/models/expr.py +132 -0
  61. permify/models/expr_call.py +105 -0
  62. permify/models/function_type.py +103 -0
  63. permify/models/ident.py +88 -0
  64. permify/models/leaf.py +110 -0
  65. permify/models/list_type.py +94 -0
  66. permify/models/lookup_entity_body.py +108 -0
  67. permify/models/lookup_entity_stream_body.py +108 -0
  68. permify/models/lookup_subject_body.py +112 -0
  69. permify/models/map_type.py +99 -0
  70. permify/models/partial_write_body.py +107 -0
  71. permify/models/partials.py +92 -0
  72. permify/models/permission_check_request_metadata.py +92 -0
  73. permify/models/permission_check_response.py +95 -0
  74. permify/models/permission_check_response_metadata.py +88 -0
  75. permify/models/permission_definition.py +94 -0
  76. permify/models/permission_expand_body.py +116 -0
  77. permify/models/permission_expand_request_metadata.py +90 -0
  78. permify/models/permission_expand_response.py +92 -0
  79. permify/models/permission_lookup_entity_request_metadata.py +92 -0
  80. permify/models/permission_lookup_entity_response.py +88 -0
  81. permify/models/permission_lookup_entity_stream_response.py +88 -0
  82. permify/models/permission_lookup_subject_request_metadata.py +92 -0
  83. permify/models/permission_lookup_subject_response.py +88 -0
  84. permify/models/permission_subject_permission_request_metadata.py +94 -0
  85. permify/models/permission_subject_permission_response.py +89 -0
  86. permify/models/primitive_type.py +42 -0
  87. permify/models/read_attributes_body.py +102 -0
  88. permify/models/read_relationships_body.py +102 -0
  89. permify/models/relation_definition.py +98 -0
  90. permify/models/relation_reference.py +90 -0
  91. permify/models/relationship_delete_response.py +88 -0
  92. permify/models/relationship_read_request_metadata.py +88 -0
  93. permify/models/relationship_read_response.py +98 -0
  94. permify/models/relationship_write_request_metadata.py +88 -0
  95. permify/models/relationship_write_response.py +88 -0
  96. permify/models/rewrite.py +101 -0
  97. permify/models/rewrite_operation.py +39 -0
  98. permify/models/rule_definition.py +97 -0
  99. permify/models/run_bundle_body.py +90 -0
  100. permify/models/schema_definition.py +119 -0
  101. permify/models/schema_definition_reference.py +38 -0
  102. permify/models/schema_list.py +90 -0
  103. permify/models/schema_list_body.py +90 -0
  104. permify/models/schema_list_response.py +100 -0
  105. permify/models/schema_partial_write_request_metadata.py +88 -0
  106. permify/models/schema_partial_write_response.py +88 -0
  107. permify/models/schema_read_body.py +92 -0
  108. permify/models/schema_read_request_metadata.py +88 -0
  109. permify/models/schema_read_response.py +92 -0
  110. permify/models/schema_write_body.py +88 -0
  111. permify/models/schema_write_response.py +88 -0
  112. permify/models/select.py +98 -0
  113. permify/models/source_info.py +109 -0
  114. permify/models/status.py +100 -0
  115. permify/models/stream_result_of_permission_lookup_entity_stream_response.py +98 -0
  116. permify/models/stream_result_of_watch_response.py +98 -0
  117. permify/models/subject.py +92 -0
  118. permify/models/subject_filter.py +92 -0
  119. permify/models/subject_permission_body.py +110 -0
  120. permify/models/subjects.py +96 -0
  121. permify/models/tenant.py +93 -0
  122. permify/models/tenant_create_request.py +90 -0
  123. permify/models/tenant_create_response.py +92 -0
  124. permify/models/tenant_delete_response.py +92 -0
  125. permify/models/tenant_list_request.py +90 -0
  126. permify/models/tenant_list_response.py +98 -0
  127. permify/models/tuple.py +100 -0
  128. permify/models/tuple_filter.py +100 -0
  129. permify/models/tuple_set.py +88 -0
  130. permify/models/tuple_to_user_set.py +98 -0
  131. permify/models/v1_call.py +98 -0
  132. permify/models/v1_expand.py +118 -0
  133. permify/models/v1_operation.py +94 -0
  134. permify/models/v1alpha1_reference.py +96 -0
  135. permify/models/v1alpha1_type.py +135 -0
  136. permify/models/values.py +101 -0
  137. permify/models/watch_body.py +88 -0
  138. permify/models/watch_response.py +92 -0
  139. permify/models/well_known_type.py +39 -0
  140. permify/models/write_relationships_body.py +102 -0
  141. permify/py.typed +0 -0
  142. permify/rest.py +258 -0
  143. permify-0.0.1.dist-info/LICENCE +201 -0
  144. permify-0.0.1.dist-info/METADATA +18 -0
  145. permify-0.0.1.dist-info/RECORD +147 -0
  146. permify-0.0.1.dist-info/WHEEL +5 -0
  147. permify-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1748 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Permify API
5
+
6
+ Permify is an open source authorization service for creating fine-grained and scalable authorization systems.
7
+
8
+ The version of the OpenAPI document: v0.9.9
9
+ Contact: hello@permify.co
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictStr
21
+ from typing_extensions import Annotated
22
+ from permify.models.check_body import CheckBody
23
+ from permify.models.lookup_entity_body import LookupEntityBody
24
+ from permify.models.lookup_entity_stream_body import LookupEntityStreamBody
25
+ from permify.models.lookup_subject_body import LookupSubjectBody
26
+ from permify.models.permission_check_response import PermissionCheckResponse
27
+ from permify.models.permission_expand_body import PermissionExpandBody
28
+ from permify.models.permission_expand_response import PermissionExpandResponse
29
+ from permify.models.permission_lookup_entity_response import PermissionLookupEntityResponse
30
+ from permify.models.permission_lookup_subject_response import PermissionLookupSubjectResponse
31
+ from permify.models.permission_subject_permission_response import PermissionSubjectPermissionResponse
32
+ from permify.models.stream_result_of_permission_lookup_entity_stream_response import StreamResultOfPermissionLookupEntityStreamResponse
33
+ from permify.models.subject_permission_body import SubjectPermissionBody
34
+
35
+ from permify.api_client import ApiClient, RequestSerialized
36
+ from permify.api_response import ApiResponse
37
+ from permify.rest import RESTResponseType
38
+
39
+
40
+ class PermissionApi:
41
+ """NOTE: This class is auto generated by OpenAPI Generator
42
+ Ref: https://openapi-generator.tech
43
+
44
+ Do not edit the class manually.
45
+ """
46
+
47
+ def __init__(self, api_client=None) -> None:
48
+ if api_client is None:
49
+ api_client = ApiClient.get_default()
50
+ self.api_client = api_client
51
+
52
+
53
+ @validate_call
54
+ def permissions_check(
55
+ self,
56
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
57
+ body: CheckBody,
58
+ _request_timeout: Union[
59
+ None,
60
+ Annotated[StrictFloat, Field(gt=0)],
61
+ Tuple[
62
+ Annotated[StrictFloat, Field(gt=0)],
63
+ Annotated[StrictFloat, Field(gt=0)]
64
+ ]
65
+ ] = None,
66
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
67
+ _content_type: Optional[StrictStr] = None,
68
+ _headers: Optional[Dict[StrictStr, Any]] = None,
69
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
70
+ ) -> PermissionCheckResponse:
71
+ """check api
72
+
73
+
74
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
75
+ :type tenant_id: str
76
+ :param body: (required)
77
+ :type body: CheckBody
78
+ :param _request_timeout: timeout setting for this request. If one
79
+ number provided, it will be total request
80
+ timeout. It can also be a pair (tuple) of
81
+ (connection, read) timeouts.
82
+ :type _request_timeout: int, tuple(int, int), optional
83
+ :param _request_auth: set to override the auth_settings for an a single
84
+ request; this effectively ignores the
85
+ authentication in the spec for a single request.
86
+ :type _request_auth: dict, optional
87
+ :param _content_type: force content-type for the request.
88
+ :type _content_type: str, Optional
89
+ :param _headers: set to override the headers for a single
90
+ request; this effectively ignores the headers
91
+ in the spec for a single request.
92
+ :type _headers: dict, optional
93
+ :param _host_index: set to override the host_index for a single
94
+ request; this effectively ignores the host_index
95
+ in the spec for a single request.
96
+ :type _host_index: int, optional
97
+ :return: Returns the result object.
98
+ """ # noqa: E501
99
+
100
+ _param = self._permissions_check_serialize(
101
+ tenant_id=tenant_id,
102
+ body=body,
103
+ _request_auth=_request_auth,
104
+ _content_type=_content_type,
105
+ _headers=_headers,
106
+ _host_index=_host_index
107
+ )
108
+
109
+ _response_types_map: Dict[str, Optional[str]] = {
110
+ '200': "PermissionCheckResponse",
111
+ }
112
+ response_data = self.api_client.call_api(
113
+ *_param,
114
+ _request_timeout=_request_timeout
115
+ )
116
+ response_data.read()
117
+ return self.api_client.response_deserialize(
118
+ response_data=response_data,
119
+ response_types_map=_response_types_map,
120
+ ).data
121
+
122
+
123
+ @validate_call
124
+ def permissions_check_with_http_info(
125
+ self,
126
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
127
+ body: CheckBody,
128
+ _request_timeout: Union[
129
+ None,
130
+ Annotated[StrictFloat, Field(gt=0)],
131
+ Tuple[
132
+ Annotated[StrictFloat, Field(gt=0)],
133
+ Annotated[StrictFloat, Field(gt=0)]
134
+ ]
135
+ ] = None,
136
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
137
+ _content_type: Optional[StrictStr] = None,
138
+ _headers: Optional[Dict[StrictStr, Any]] = None,
139
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
140
+ ) -> ApiResponse[PermissionCheckResponse]:
141
+ """check api
142
+
143
+
144
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
145
+ :type tenant_id: str
146
+ :param body: (required)
147
+ :type body: CheckBody
148
+ :param _request_timeout: timeout setting for this request. If one
149
+ number provided, it will be total request
150
+ timeout. It can also be a pair (tuple) of
151
+ (connection, read) timeouts.
152
+ :type _request_timeout: int, tuple(int, int), optional
153
+ :param _request_auth: set to override the auth_settings for an a single
154
+ request; this effectively ignores the
155
+ authentication in the spec for a single request.
156
+ :type _request_auth: dict, optional
157
+ :param _content_type: force content-type for the request.
158
+ :type _content_type: str, Optional
159
+ :param _headers: set to override the headers for a single
160
+ request; this effectively ignores the headers
161
+ in the spec for a single request.
162
+ :type _headers: dict, optional
163
+ :param _host_index: set to override the host_index for a single
164
+ request; this effectively ignores the host_index
165
+ in the spec for a single request.
166
+ :type _host_index: int, optional
167
+ :return: Returns the result object.
168
+ """ # noqa: E501
169
+
170
+ _param = self._permissions_check_serialize(
171
+ tenant_id=tenant_id,
172
+ body=body,
173
+ _request_auth=_request_auth,
174
+ _content_type=_content_type,
175
+ _headers=_headers,
176
+ _host_index=_host_index
177
+ )
178
+
179
+ _response_types_map: Dict[str, Optional[str]] = {
180
+ '200': "PermissionCheckResponse",
181
+ }
182
+ response_data = self.api_client.call_api(
183
+ *_param,
184
+ _request_timeout=_request_timeout
185
+ )
186
+ response_data.read()
187
+ return self.api_client.response_deserialize(
188
+ response_data=response_data,
189
+ response_types_map=_response_types_map,
190
+ )
191
+
192
+
193
+ @validate_call
194
+ def permissions_check_without_preload_content(
195
+ self,
196
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
197
+ body: CheckBody,
198
+ _request_timeout: Union[
199
+ None,
200
+ Annotated[StrictFloat, Field(gt=0)],
201
+ Tuple[
202
+ Annotated[StrictFloat, Field(gt=0)],
203
+ Annotated[StrictFloat, Field(gt=0)]
204
+ ]
205
+ ] = None,
206
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
207
+ _content_type: Optional[StrictStr] = None,
208
+ _headers: Optional[Dict[StrictStr, Any]] = None,
209
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
210
+ ) -> RESTResponseType:
211
+ """check api
212
+
213
+
214
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
215
+ :type tenant_id: str
216
+ :param body: (required)
217
+ :type body: CheckBody
218
+ :param _request_timeout: timeout setting for this request. If one
219
+ number provided, it will be total request
220
+ timeout. It can also be a pair (tuple) of
221
+ (connection, read) timeouts.
222
+ :type _request_timeout: int, tuple(int, int), optional
223
+ :param _request_auth: set to override the auth_settings for an a single
224
+ request; this effectively ignores the
225
+ authentication in the spec for a single request.
226
+ :type _request_auth: dict, optional
227
+ :param _content_type: force content-type for the request.
228
+ :type _content_type: str, Optional
229
+ :param _headers: set to override the headers for a single
230
+ request; this effectively ignores the headers
231
+ in the spec for a single request.
232
+ :type _headers: dict, optional
233
+ :param _host_index: set to override the host_index for a single
234
+ request; this effectively ignores the host_index
235
+ in the spec for a single request.
236
+ :type _host_index: int, optional
237
+ :return: Returns the result object.
238
+ """ # noqa: E501
239
+
240
+ _param = self._permissions_check_serialize(
241
+ tenant_id=tenant_id,
242
+ body=body,
243
+ _request_auth=_request_auth,
244
+ _content_type=_content_type,
245
+ _headers=_headers,
246
+ _host_index=_host_index
247
+ )
248
+
249
+ _response_types_map: Dict[str, Optional[str]] = {
250
+ '200': "PermissionCheckResponse",
251
+ }
252
+ response_data = self.api_client.call_api(
253
+ *_param,
254
+ _request_timeout=_request_timeout
255
+ )
256
+ return response_data.response
257
+
258
+
259
+ def _permissions_check_serialize(
260
+ self,
261
+ tenant_id,
262
+ body,
263
+ _request_auth,
264
+ _content_type,
265
+ _headers,
266
+ _host_index,
267
+ ) -> RequestSerialized:
268
+
269
+ _host = None
270
+
271
+ _collection_formats: Dict[str, str] = {
272
+ }
273
+
274
+ _path_params: Dict[str, str] = {}
275
+ _query_params: List[Tuple[str, str]] = []
276
+ _header_params: Dict[str, Optional[str]] = _headers or {}
277
+ _form_params: List[Tuple[str, str]] = []
278
+ _files: Dict[str, Union[str, bytes]] = {}
279
+ _body_params: Optional[bytes] = None
280
+
281
+ # process the path parameters
282
+ if tenant_id is not None:
283
+ _path_params['tenant_id'] = tenant_id
284
+ # process the query parameters
285
+ # process the header parameters
286
+ # process the form parameters
287
+ # process the body parameter
288
+ if body is not None:
289
+ _body_params = body
290
+
291
+
292
+ # set the HTTP header `Accept`
293
+ if 'Accept' not in _header_params:
294
+ _header_params['Accept'] = self.api_client.select_header_accept(
295
+ [
296
+ 'application/json'
297
+ ]
298
+ )
299
+
300
+ # set the HTTP header `Content-Type`
301
+ if _content_type:
302
+ _header_params['Content-Type'] = _content_type
303
+ else:
304
+ _default_content_type = (
305
+ self.api_client.select_header_content_type(
306
+ [
307
+ 'application/json'
308
+ ]
309
+ )
310
+ )
311
+ if _default_content_type is not None:
312
+ _header_params['Content-Type'] = _default_content_type
313
+
314
+ # authentication setting
315
+ _auth_settings: List[str] = [
316
+ ]
317
+
318
+ return self.api_client.param_serialize(
319
+ method='POST',
320
+ resource_path='/v1/tenants/{tenant_id}/permissions/check',
321
+ path_params=_path_params,
322
+ query_params=_query_params,
323
+ header_params=_header_params,
324
+ body=_body_params,
325
+ post_params=_form_params,
326
+ files=_files,
327
+ auth_settings=_auth_settings,
328
+ collection_formats=_collection_formats,
329
+ _host=_host,
330
+ _request_auth=_request_auth
331
+ )
332
+
333
+
334
+
335
+
336
+ @validate_call
337
+ def permissions_expand(
338
+ self,
339
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
340
+ body: PermissionExpandBody,
341
+ _request_timeout: Union[
342
+ None,
343
+ Annotated[StrictFloat, Field(gt=0)],
344
+ Tuple[
345
+ Annotated[StrictFloat, Field(gt=0)],
346
+ Annotated[StrictFloat, Field(gt=0)]
347
+ ]
348
+ ] = None,
349
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
350
+ _content_type: Optional[StrictStr] = None,
351
+ _headers: Optional[Dict[StrictStr, Any]] = None,
352
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
353
+ ) -> PermissionExpandResponse:
354
+ """expand api
355
+
356
+
357
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
358
+ :type tenant_id: str
359
+ :param body: (required)
360
+ :type body: PermissionExpandBody
361
+ :param _request_timeout: timeout setting for this request. If one
362
+ number provided, it will be total request
363
+ timeout. It can also be a pair (tuple) of
364
+ (connection, read) timeouts.
365
+ :type _request_timeout: int, tuple(int, int), optional
366
+ :param _request_auth: set to override the auth_settings for an a single
367
+ request; this effectively ignores the
368
+ authentication in the spec for a single request.
369
+ :type _request_auth: dict, optional
370
+ :param _content_type: force content-type for the request.
371
+ :type _content_type: str, Optional
372
+ :param _headers: set to override the headers for a single
373
+ request; this effectively ignores the headers
374
+ in the spec for a single request.
375
+ :type _headers: dict, optional
376
+ :param _host_index: set to override the host_index for a single
377
+ request; this effectively ignores the host_index
378
+ in the spec for a single request.
379
+ :type _host_index: int, optional
380
+ :return: Returns the result object.
381
+ """ # noqa: E501
382
+
383
+ _param = self._permissions_expand_serialize(
384
+ tenant_id=tenant_id,
385
+ body=body,
386
+ _request_auth=_request_auth,
387
+ _content_type=_content_type,
388
+ _headers=_headers,
389
+ _host_index=_host_index
390
+ )
391
+
392
+ _response_types_map: Dict[str, Optional[str]] = {
393
+ '200': "PermissionExpandResponse",
394
+ }
395
+ response_data = self.api_client.call_api(
396
+ *_param,
397
+ _request_timeout=_request_timeout
398
+ )
399
+ response_data.read()
400
+ return self.api_client.response_deserialize(
401
+ response_data=response_data,
402
+ response_types_map=_response_types_map,
403
+ ).data
404
+
405
+
406
+ @validate_call
407
+ def permissions_expand_with_http_info(
408
+ self,
409
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
410
+ body: PermissionExpandBody,
411
+ _request_timeout: Union[
412
+ None,
413
+ Annotated[StrictFloat, Field(gt=0)],
414
+ Tuple[
415
+ Annotated[StrictFloat, Field(gt=0)],
416
+ Annotated[StrictFloat, Field(gt=0)]
417
+ ]
418
+ ] = None,
419
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
420
+ _content_type: Optional[StrictStr] = None,
421
+ _headers: Optional[Dict[StrictStr, Any]] = None,
422
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
423
+ ) -> ApiResponse[PermissionExpandResponse]:
424
+ """expand api
425
+
426
+
427
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
428
+ :type tenant_id: str
429
+ :param body: (required)
430
+ :type body: PermissionExpandBody
431
+ :param _request_timeout: timeout setting for this request. If one
432
+ number provided, it will be total request
433
+ timeout. It can also be a pair (tuple) of
434
+ (connection, read) timeouts.
435
+ :type _request_timeout: int, tuple(int, int), optional
436
+ :param _request_auth: set to override the auth_settings for an a single
437
+ request; this effectively ignores the
438
+ authentication in the spec for a single request.
439
+ :type _request_auth: dict, optional
440
+ :param _content_type: force content-type for the request.
441
+ :type _content_type: str, Optional
442
+ :param _headers: set to override the headers for a single
443
+ request; this effectively ignores the headers
444
+ in the spec for a single request.
445
+ :type _headers: dict, optional
446
+ :param _host_index: set to override the host_index for a single
447
+ request; this effectively ignores the host_index
448
+ in the spec for a single request.
449
+ :type _host_index: int, optional
450
+ :return: Returns the result object.
451
+ """ # noqa: E501
452
+
453
+ _param = self._permissions_expand_serialize(
454
+ tenant_id=tenant_id,
455
+ body=body,
456
+ _request_auth=_request_auth,
457
+ _content_type=_content_type,
458
+ _headers=_headers,
459
+ _host_index=_host_index
460
+ )
461
+
462
+ _response_types_map: Dict[str, Optional[str]] = {
463
+ '200': "PermissionExpandResponse",
464
+ }
465
+ response_data = self.api_client.call_api(
466
+ *_param,
467
+ _request_timeout=_request_timeout
468
+ )
469
+ response_data.read()
470
+ return self.api_client.response_deserialize(
471
+ response_data=response_data,
472
+ response_types_map=_response_types_map,
473
+ )
474
+
475
+
476
+ @validate_call
477
+ def permissions_expand_without_preload_content(
478
+ self,
479
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
480
+ body: PermissionExpandBody,
481
+ _request_timeout: Union[
482
+ None,
483
+ Annotated[StrictFloat, Field(gt=0)],
484
+ Tuple[
485
+ Annotated[StrictFloat, Field(gt=0)],
486
+ Annotated[StrictFloat, Field(gt=0)]
487
+ ]
488
+ ] = None,
489
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
490
+ _content_type: Optional[StrictStr] = None,
491
+ _headers: Optional[Dict[StrictStr, Any]] = None,
492
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
493
+ ) -> RESTResponseType:
494
+ """expand api
495
+
496
+
497
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
498
+ :type tenant_id: str
499
+ :param body: (required)
500
+ :type body: PermissionExpandBody
501
+ :param _request_timeout: timeout setting for this request. If one
502
+ number provided, it will be total request
503
+ timeout. It can also be a pair (tuple) of
504
+ (connection, read) timeouts.
505
+ :type _request_timeout: int, tuple(int, int), optional
506
+ :param _request_auth: set to override the auth_settings for an a single
507
+ request; this effectively ignores the
508
+ authentication in the spec for a single request.
509
+ :type _request_auth: dict, optional
510
+ :param _content_type: force content-type for the request.
511
+ :type _content_type: str, Optional
512
+ :param _headers: set to override the headers for a single
513
+ request; this effectively ignores the headers
514
+ in the spec for a single request.
515
+ :type _headers: dict, optional
516
+ :param _host_index: set to override the host_index for a single
517
+ request; this effectively ignores the host_index
518
+ in the spec for a single request.
519
+ :type _host_index: int, optional
520
+ :return: Returns the result object.
521
+ """ # noqa: E501
522
+
523
+ _param = self._permissions_expand_serialize(
524
+ tenant_id=tenant_id,
525
+ body=body,
526
+ _request_auth=_request_auth,
527
+ _content_type=_content_type,
528
+ _headers=_headers,
529
+ _host_index=_host_index
530
+ )
531
+
532
+ _response_types_map: Dict[str, Optional[str]] = {
533
+ '200': "PermissionExpandResponse",
534
+ }
535
+ response_data = self.api_client.call_api(
536
+ *_param,
537
+ _request_timeout=_request_timeout
538
+ )
539
+ return response_data.response
540
+
541
+
542
+ def _permissions_expand_serialize(
543
+ self,
544
+ tenant_id,
545
+ body,
546
+ _request_auth,
547
+ _content_type,
548
+ _headers,
549
+ _host_index,
550
+ ) -> RequestSerialized:
551
+
552
+ _host = None
553
+
554
+ _collection_formats: Dict[str, str] = {
555
+ }
556
+
557
+ _path_params: Dict[str, str] = {}
558
+ _query_params: List[Tuple[str, str]] = []
559
+ _header_params: Dict[str, Optional[str]] = _headers or {}
560
+ _form_params: List[Tuple[str, str]] = []
561
+ _files: Dict[str, Union[str, bytes]] = {}
562
+ _body_params: Optional[bytes] = None
563
+
564
+ # process the path parameters
565
+ if tenant_id is not None:
566
+ _path_params['tenant_id'] = tenant_id
567
+ # process the query parameters
568
+ # process the header parameters
569
+ # process the form parameters
570
+ # process the body parameter
571
+ if body is not None:
572
+ _body_params = body
573
+
574
+
575
+ # set the HTTP header `Accept`
576
+ if 'Accept' not in _header_params:
577
+ _header_params['Accept'] = self.api_client.select_header_accept(
578
+ [
579
+ 'application/json'
580
+ ]
581
+ )
582
+
583
+ # set the HTTP header `Content-Type`
584
+ if _content_type:
585
+ _header_params['Content-Type'] = _content_type
586
+ else:
587
+ _default_content_type = (
588
+ self.api_client.select_header_content_type(
589
+ [
590
+ 'application/json'
591
+ ]
592
+ )
593
+ )
594
+ if _default_content_type is not None:
595
+ _header_params['Content-Type'] = _default_content_type
596
+
597
+ # authentication setting
598
+ _auth_settings: List[str] = [
599
+ ]
600
+
601
+ return self.api_client.param_serialize(
602
+ method='POST',
603
+ resource_path='/v1/tenants/{tenant_id}/permissions/expand',
604
+ path_params=_path_params,
605
+ query_params=_query_params,
606
+ header_params=_header_params,
607
+ body=_body_params,
608
+ post_params=_form_params,
609
+ files=_files,
610
+ auth_settings=_auth_settings,
611
+ collection_formats=_collection_formats,
612
+ _host=_host,
613
+ _request_auth=_request_auth
614
+ )
615
+
616
+
617
+
618
+
619
+ @validate_call
620
+ def permissions_lookup_entity(
621
+ self,
622
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
623
+ body: LookupEntityBody,
624
+ _request_timeout: Union[
625
+ None,
626
+ Annotated[StrictFloat, Field(gt=0)],
627
+ Tuple[
628
+ Annotated[StrictFloat, Field(gt=0)],
629
+ Annotated[StrictFloat, Field(gt=0)]
630
+ ]
631
+ ] = None,
632
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
633
+ _content_type: Optional[StrictStr] = None,
634
+ _headers: Optional[Dict[StrictStr, Any]] = None,
635
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
636
+ ) -> PermissionLookupEntityResponse:
637
+ """lookup entity
638
+
639
+
640
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
641
+ :type tenant_id: str
642
+ :param body: (required)
643
+ :type body: LookupEntityBody
644
+ :param _request_timeout: timeout setting for this request. If one
645
+ number provided, it will be total request
646
+ timeout. It can also be a pair (tuple) of
647
+ (connection, read) timeouts.
648
+ :type _request_timeout: int, tuple(int, int), optional
649
+ :param _request_auth: set to override the auth_settings for an a single
650
+ request; this effectively ignores the
651
+ authentication in the spec for a single request.
652
+ :type _request_auth: dict, optional
653
+ :param _content_type: force content-type for the request.
654
+ :type _content_type: str, Optional
655
+ :param _headers: set to override the headers for a single
656
+ request; this effectively ignores the headers
657
+ in the spec for a single request.
658
+ :type _headers: dict, optional
659
+ :param _host_index: set to override the host_index for a single
660
+ request; this effectively ignores the host_index
661
+ in the spec for a single request.
662
+ :type _host_index: int, optional
663
+ :return: Returns the result object.
664
+ """ # noqa: E501
665
+
666
+ _param = self._permissions_lookup_entity_serialize(
667
+ tenant_id=tenant_id,
668
+ body=body,
669
+ _request_auth=_request_auth,
670
+ _content_type=_content_type,
671
+ _headers=_headers,
672
+ _host_index=_host_index
673
+ )
674
+
675
+ _response_types_map: Dict[str, Optional[str]] = {
676
+ '200': "PermissionLookupEntityResponse",
677
+ }
678
+ response_data = self.api_client.call_api(
679
+ *_param,
680
+ _request_timeout=_request_timeout
681
+ )
682
+ response_data.read()
683
+ return self.api_client.response_deserialize(
684
+ response_data=response_data,
685
+ response_types_map=_response_types_map,
686
+ ).data
687
+
688
+
689
+ @validate_call
690
+ def permissions_lookup_entity_with_http_info(
691
+ self,
692
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
693
+ body: LookupEntityBody,
694
+ _request_timeout: Union[
695
+ None,
696
+ Annotated[StrictFloat, Field(gt=0)],
697
+ Tuple[
698
+ Annotated[StrictFloat, Field(gt=0)],
699
+ Annotated[StrictFloat, Field(gt=0)]
700
+ ]
701
+ ] = None,
702
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
703
+ _content_type: Optional[StrictStr] = None,
704
+ _headers: Optional[Dict[StrictStr, Any]] = None,
705
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
706
+ ) -> ApiResponse[PermissionLookupEntityResponse]:
707
+ """lookup entity
708
+
709
+
710
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
711
+ :type tenant_id: str
712
+ :param body: (required)
713
+ :type body: LookupEntityBody
714
+ :param _request_timeout: timeout setting for this request. If one
715
+ number provided, it will be total request
716
+ timeout. It can also be a pair (tuple) of
717
+ (connection, read) timeouts.
718
+ :type _request_timeout: int, tuple(int, int), optional
719
+ :param _request_auth: set to override the auth_settings for an a single
720
+ request; this effectively ignores the
721
+ authentication in the spec for a single request.
722
+ :type _request_auth: dict, optional
723
+ :param _content_type: force content-type for the request.
724
+ :type _content_type: str, Optional
725
+ :param _headers: set to override the headers for a single
726
+ request; this effectively ignores the headers
727
+ in the spec for a single request.
728
+ :type _headers: dict, optional
729
+ :param _host_index: set to override the host_index for a single
730
+ request; this effectively ignores the host_index
731
+ in the spec for a single request.
732
+ :type _host_index: int, optional
733
+ :return: Returns the result object.
734
+ """ # noqa: E501
735
+
736
+ _param = self._permissions_lookup_entity_serialize(
737
+ tenant_id=tenant_id,
738
+ body=body,
739
+ _request_auth=_request_auth,
740
+ _content_type=_content_type,
741
+ _headers=_headers,
742
+ _host_index=_host_index
743
+ )
744
+
745
+ _response_types_map: Dict[str, Optional[str]] = {
746
+ '200': "PermissionLookupEntityResponse",
747
+ }
748
+ response_data = self.api_client.call_api(
749
+ *_param,
750
+ _request_timeout=_request_timeout
751
+ )
752
+ response_data.read()
753
+ return self.api_client.response_deserialize(
754
+ response_data=response_data,
755
+ response_types_map=_response_types_map,
756
+ )
757
+
758
+
759
+ @validate_call
760
+ def permissions_lookup_entity_without_preload_content(
761
+ self,
762
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
763
+ body: LookupEntityBody,
764
+ _request_timeout: Union[
765
+ None,
766
+ Annotated[StrictFloat, Field(gt=0)],
767
+ Tuple[
768
+ Annotated[StrictFloat, Field(gt=0)],
769
+ Annotated[StrictFloat, Field(gt=0)]
770
+ ]
771
+ ] = None,
772
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
773
+ _content_type: Optional[StrictStr] = None,
774
+ _headers: Optional[Dict[StrictStr, Any]] = None,
775
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
776
+ ) -> RESTResponseType:
777
+ """lookup entity
778
+
779
+
780
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
781
+ :type tenant_id: str
782
+ :param body: (required)
783
+ :type body: LookupEntityBody
784
+ :param _request_timeout: timeout setting for this request. If one
785
+ number provided, it will be total request
786
+ timeout. It can also be a pair (tuple) of
787
+ (connection, read) timeouts.
788
+ :type _request_timeout: int, tuple(int, int), optional
789
+ :param _request_auth: set to override the auth_settings for an a single
790
+ request; this effectively ignores the
791
+ authentication in the spec for a single request.
792
+ :type _request_auth: dict, optional
793
+ :param _content_type: force content-type for the request.
794
+ :type _content_type: str, Optional
795
+ :param _headers: set to override the headers for a single
796
+ request; this effectively ignores the headers
797
+ in the spec for a single request.
798
+ :type _headers: dict, optional
799
+ :param _host_index: set to override the host_index for a single
800
+ request; this effectively ignores the host_index
801
+ in the spec for a single request.
802
+ :type _host_index: int, optional
803
+ :return: Returns the result object.
804
+ """ # noqa: E501
805
+
806
+ _param = self._permissions_lookup_entity_serialize(
807
+ tenant_id=tenant_id,
808
+ body=body,
809
+ _request_auth=_request_auth,
810
+ _content_type=_content_type,
811
+ _headers=_headers,
812
+ _host_index=_host_index
813
+ )
814
+
815
+ _response_types_map: Dict[str, Optional[str]] = {
816
+ '200': "PermissionLookupEntityResponse",
817
+ }
818
+ response_data = self.api_client.call_api(
819
+ *_param,
820
+ _request_timeout=_request_timeout
821
+ )
822
+ return response_data.response
823
+
824
+
825
+ def _permissions_lookup_entity_serialize(
826
+ self,
827
+ tenant_id,
828
+ body,
829
+ _request_auth,
830
+ _content_type,
831
+ _headers,
832
+ _host_index,
833
+ ) -> RequestSerialized:
834
+
835
+ _host = None
836
+
837
+ _collection_formats: Dict[str, str] = {
838
+ }
839
+
840
+ _path_params: Dict[str, str] = {}
841
+ _query_params: List[Tuple[str, str]] = []
842
+ _header_params: Dict[str, Optional[str]] = _headers or {}
843
+ _form_params: List[Tuple[str, str]] = []
844
+ _files: Dict[str, Union[str, bytes]] = {}
845
+ _body_params: Optional[bytes] = None
846
+
847
+ # process the path parameters
848
+ if tenant_id is not None:
849
+ _path_params['tenant_id'] = tenant_id
850
+ # process the query parameters
851
+ # process the header parameters
852
+ # process the form parameters
853
+ # process the body parameter
854
+ if body is not None:
855
+ _body_params = body
856
+
857
+
858
+ # set the HTTP header `Accept`
859
+ if 'Accept' not in _header_params:
860
+ _header_params['Accept'] = self.api_client.select_header_accept(
861
+ [
862
+ 'application/json'
863
+ ]
864
+ )
865
+
866
+ # set the HTTP header `Content-Type`
867
+ if _content_type:
868
+ _header_params['Content-Type'] = _content_type
869
+ else:
870
+ _default_content_type = (
871
+ self.api_client.select_header_content_type(
872
+ [
873
+ 'application/json'
874
+ ]
875
+ )
876
+ )
877
+ if _default_content_type is not None:
878
+ _header_params['Content-Type'] = _default_content_type
879
+
880
+ # authentication setting
881
+ _auth_settings: List[str] = [
882
+ ]
883
+
884
+ return self.api_client.param_serialize(
885
+ method='POST',
886
+ resource_path='/v1/tenants/{tenant_id}/permissions/lookup-entity',
887
+ path_params=_path_params,
888
+ query_params=_query_params,
889
+ header_params=_header_params,
890
+ body=_body_params,
891
+ post_params=_form_params,
892
+ files=_files,
893
+ auth_settings=_auth_settings,
894
+ collection_formats=_collection_formats,
895
+ _host=_host,
896
+ _request_auth=_request_auth
897
+ )
898
+
899
+
900
+
901
+
902
+ @validate_call
903
+ def permissions_lookup_entity_stream(
904
+ self,
905
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
906
+ body: LookupEntityStreamBody,
907
+ _request_timeout: Union[
908
+ None,
909
+ Annotated[StrictFloat, Field(gt=0)],
910
+ Tuple[
911
+ Annotated[StrictFloat, Field(gt=0)],
912
+ Annotated[StrictFloat, Field(gt=0)]
913
+ ]
914
+ ] = None,
915
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
916
+ _content_type: Optional[StrictStr] = None,
917
+ _headers: Optional[Dict[StrictStr, Any]] = None,
918
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
919
+ ) -> StreamResultOfPermissionLookupEntityStreamResponse:
920
+ """lookup entity stream
921
+
922
+
923
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
924
+ :type tenant_id: str
925
+ :param body: (required)
926
+ :type body: LookupEntityStreamBody
927
+ :param _request_timeout: timeout setting for this request. If one
928
+ number provided, it will be total request
929
+ timeout. It can also be a pair (tuple) of
930
+ (connection, read) timeouts.
931
+ :type _request_timeout: int, tuple(int, int), optional
932
+ :param _request_auth: set to override the auth_settings for an a single
933
+ request; this effectively ignores the
934
+ authentication in the spec for a single request.
935
+ :type _request_auth: dict, optional
936
+ :param _content_type: force content-type for the request.
937
+ :type _content_type: str, Optional
938
+ :param _headers: set to override the headers for a single
939
+ request; this effectively ignores the headers
940
+ in the spec for a single request.
941
+ :type _headers: dict, optional
942
+ :param _host_index: set to override the host_index for a single
943
+ request; this effectively ignores the host_index
944
+ in the spec for a single request.
945
+ :type _host_index: int, optional
946
+ :return: Returns the result object.
947
+ """ # noqa: E501
948
+
949
+ _param = self._permissions_lookup_entity_stream_serialize(
950
+ tenant_id=tenant_id,
951
+ body=body,
952
+ _request_auth=_request_auth,
953
+ _content_type=_content_type,
954
+ _headers=_headers,
955
+ _host_index=_host_index
956
+ )
957
+
958
+ _response_types_map: Dict[str, Optional[str]] = {
959
+ '200': "StreamResultOfPermissionLookupEntityStreamResponse",
960
+ }
961
+ response_data = self.api_client.call_api(
962
+ *_param,
963
+ _request_timeout=_request_timeout
964
+ )
965
+ response_data.read()
966
+ return self.api_client.response_deserialize(
967
+ response_data=response_data,
968
+ response_types_map=_response_types_map,
969
+ ).data
970
+
971
+
972
+ @validate_call
973
+ def permissions_lookup_entity_stream_with_http_info(
974
+ self,
975
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
976
+ body: LookupEntityStreamBody,
977
+ _request_timeout: Union[
978
+ None,
979
+ Annotated[StrictFloat, Field(gt=0)],
980
+ Tuple[
981
+ Annotated[StrictFloat, Field(gt=0)],
982
+ Annotated[StrictFloat, Field(gt=0)]
983
+ ]
984
+ ] = None,
985
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
986
+ _content_type: Optional[StrictStr] = None,
987
+ _headers: Optional[Dict[StrictStr, Any]] = None,
988
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
989
+ ) -> ApiResponse[StreamResultOfPermissionLookupEntityStreamResponse]:
990
+ """lookup entity stream
991
+
992
+
993
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
994
+ :type tenant_id: str
995
+ :param body: (required)
996
+ :type body: LookupEntityStreamBody
997
+ :param _request_timeout: timeout setting for this request. If one
998
+ number provided, it will be total request
999
+ timeout. It can also be a pair (tuple) of
1000
+ (connection, read) timeouts.
1001
+ :type _request_timeout: int, tuple(int, int), optional
1002
+ :param _request_auth: set to override the auth_settings for an a single
1003
+ request; this effectively ignores the
1004
+ authentication in the spec for a single request.
1005
+ :type _request_auth: dict, optional
1006
+ :param _content_type: force content-type for the request.
1007
+ :type _content_type: str, Optional
1008
+ :param _headers: set to override the headers for a single
1009
+ request; this effectively ignores the headers
1010
+ in the spec for a single request.
1011
+ :type _headers: dict, optional
1012
+ :param _host_index: set to override the host_index for a single
1013
+ request; this effectively ignores the host_index
1014
+ in the spec for a single request.
1015
+ :type _host_index: int, optional
1016
+ :return: Returns the result object.
1017
+ """ # noqa: E501
1018
+
1019
+ _param = self._permissions_lookup_entity_stream_serialize(
1020
+ tenant_id=tenant_id,
1021
+ body=body,
1022
+ _request_auth=_request_auth,
1023
+ _content_type=_content_type,
1024
+ _headers=_headers,
1025
+ _host_index=_host_index
1026
+ )
1027
+
1028
+ _response_types_map: Dict[str, Optional[str]] = {
1029
+ '200': "StreamResultOfPermissionLookupEntityStreamResponse",
1030
+ }
1031
+ response_data = self.api_client.call_api(
1032
+ *_param,
1033
+ _request_timeout=_request_timeout
1034
+ )
1035
+ response_data.read()
1036
+ return self.api_client.response_deserialize(
1037
+ response_data=response_data,
1038
+ response_types_map=_response_types_map,
1039
+ )
1040
+
1041
+
1042
+ @validate_call
1043
+ def permissions_lookup_entity_stream_without_preload_content(
1044
+ self,
1045
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
1046
+ body: LookupEntityStreamBody,
1047
+ _request_timeout: Union[
1048
+ None,
1049
+ Annotated[StrictFloat, Field(gt=0)],
1050
+ Tuple[
1051
+ Annotated[StrictFloat, Field(gt=0)],
1052
+ Annotated[StrictFloat, Field(gt=0)]
1053
+ ]
1054
+ ] = None,
1055
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1056
+ _content_type: Optional[StrictStr] = None,
1057
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1058
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1059
+ ) -> RESTResponseType:
1060
+ """lookup entity stream
1061
+
1062
+
1063
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
1064
+ :type tenant_id: str
1065
+ :param body: (required)
1066
+ :type body: LookupEntityStreamBody
1067
+ :param _request_timeout: timeout setting for this request. If one
1068
+ number provided, it will be total request
1069
+ timeout. It can also be a pair (tuple) of
1070
+ (connection, read) timeouts.
1071
+ :type _request_timeout: int, tuple(int, int), optional
1072
+ :param _request_auth: set to override the auth_settings for an a single
1073
+ request; this effectively ignores the
1074
+ authentication in the spec for a single request.
1075
+ :type _request_auth: dict, optional
1076
+ :param _content_type: force content-type for the request.
1077
+ :type _content_type: str, Optional
1078
+ :param _headers: set to override the headers for a single
1079
+ request; this effectively ignores the headers
1080
+ in the spec for a single request.
1081
+ :type _headers: dict, optional
1082
+ :param _host_index: set to override the host_index for a single
1083
+ request; this effectively ignores the host_index
1084
+ in the spec for a single request.
1085
+ :type _host_index: int, optional
1086
+ :return: Returns the result object.
1087
+ """ # noqa: E501
1088
+
1089
+ _param = self._permissions_lookup_entity_stream_serialize(
1090
+ tenant_id=tenant_id,
1091
+ body=body,
1092
+ _request_auth=_request_auth,
1093
+ _content_type=_content_type,
1094
+ _headers=_headers,
1095
+ _host_index=_host_index
1096
+ )
1097
+
1098
+ _response_types_map: Dict[str, Optional[str]] = {
1099
+ '200': "StreamResultOfPermissionLookupEntityStreamResponse",
1100
+ }
1101
+ response_data = self.api_client.call_api(
1102
+ *_param,
1103
+ _request_timeout=_request_timeout
1104
+ )
1105
+ return response_data.response
1106
+
1107
+
1108
+ def _permissions_lookup_entity_stream_serialize(
1109
+ self,
1110
+ tenant_id,
1111
+ body,
1112
+ _request_auth,
1113
+ _content_type,
1114
+ _headers,
1115
+ _host_index,
1116
+ ) -> RequestSerialized:
1117
+
1118
+ _host = None
1119
+
1120
+ _collection_formats: Dict[str, str] = {
1121
+ }
1122
+
1123
+ _path_params: Dict[str, str] = {}
1124
+ _query_params: List[Tuple[str, str]] = []
1125
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1126
+ _form_params: List[Tuple[str, str]] = []
1127
+ _files: Dict[str, Union[str, bytes]] = {}
1128
+ _body_params: Optional[bytes] = None
1129
+
1130
+ # process the path parameters
1131
+ if tenant_id is not None:
1132
+ _path_params['tenant_id'] = tenant_id
1133
+ # process the query parameters
1134
+ # process the header parameters
1135
+ # process the form parameters
1136
+ # process the body parameter
1137
+ if body is not None:
1138
+ _body_params = body
1139
+
1140
+
1141
+ # set the HTTP header `Accept`
1142
+ if 'Accept' not in _header_params:
1143
+ _header_params['Accept'] = self.api_client.select_header_accept(
1144
+ [
1145
+ 'application/json'
1146
+ ]
1147
+ )
1148
+
1149
+ # set the HTTP header `Content-Type`
1150
+ if _content_type:
1151
+ _header_params['Content-Type'] = _content_type
1152
+ else:
1153
+ _default_content_type = (
1154
+ self.api_client.select_header_content_type(
1155
+ [
1156
+ 'application/json'
1157
+ ]
1158
+ )
1159
+ )
1160
+ if _default_content_type is not None:
1161
+ _header_params['Content-Type'] = _default_content_type
1162
+
1163
+ # authentication setting
1164
+ _auth_settings: List[str] = [
1165
+ ]
1166
+
1167
+ return self.api_client.param_serialize(
1168
+ method='POST',
1169
+ resource_path='/v1/tenants/{tenant_id}/permissions/lookup-entity-stream',
1170
+ path_params=_path_params,
1171
+ query_params=_query_params,
1172
+ header_params=_header_params,
1173
+ body=_body_params,
1174
+ post_params=_form_params,
1175
+ files=_files,
1176
+ auth_settings=_auth_settings,
1177
+ collection_formats=_collection_formats,
1178
+ _host=_host,
1179
+ _request_auth=_request_auth
1180
+ )
1181
+
1182
+
1183
+
1184
+
1185
+ @validate_call
1186
+ def permissions_lookup_subject(
1187
+ self,
1188
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
1189
+ body: LookupSubjectBody,
1190
+ _request_timeout: Union[
1191
+ None,
1192
+ Annotated[StrictFloat, Field(gt=0)],
1193
+ Tuple[
1194
+ Annotated[StrictFloat, Field(gt=0)],
1195
+ Annotated[StrictFloat, Field(gt=0)]
1196
+ ]
1197
+ ] = None,
1198
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1199
+ _content_type: Optional[StrictStr] = None,
1200
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1201
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1202
+ ) -> PermissionLookupSubjectResponse:
1203
+ """lookup-subject
1204
+
1205
+
1206
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
1207
+ :type tenant_id: str
1208
+ :param body: (required)
1209
+ :type body: LookupSubjectBody
1210
+ :param _request_timeout: timeout setting for this request. If one
1211
+ number provided, it will be total request
1212
+ timeout. It can also be a pair (tuple) of
1213
+ (connection, read) timeouts.
1214
+ :type _request_timeout: int, tuple(int, int), optional
1215
+ :param _request_auth: set to override the auth_settings for an a single
1216
+ request; this effectively ignores the
1217
+ authentication in the spec for a single request.
1218
+ :type _request_auth: dict, optional
1219
+ :param _content_type: force content-type for the request.
1220
+ :type _content_type: str, Optional
1221
+ :param _headers: set to override the headers for a single
1222
+ request; this effectively ignores the headers
1223
+ in the spec for a single request.
1224
+ :type _headers: dict, optional
1225
+ :param _host_index: set to override the host_index for a single
1226
+ request; this effectively ignores the host_index
1227
+ in the spec for a single request.
1228
+ :type _host_index: int, optional
1229
+ :return: Returns the result object.
1230
+ """ # noqa: E501
1231
+
1232
+ _param = self._permissions_lookup_subject_serialize(
1233
+ tenant_id=tenant_id,
1234
+ body=body,
1235
+ _request_auth=_request_auth,
1236
+ _content_type=_content_type,
1237
+ _headers=_headers,
1238
+ _host_index=_host_index
1239
+ )
1240
+
1241
+ _response_types_map: Dict[str, Optional[str]] = {
1242
+ '200': "PermissionLookupSubjectResponse",
1243
+ }
1244
+ response_data = self.api_client.call_api(
1245
+ *_param,
1246
+ _request_timeout=_request_timeout
1247
+ )
1248
+ response_data.read()
1249
+ return self.api_client.response_deserialize(
1250
+ response_data=response_data,
1251
+ response_types_map=_response_types_map,
1252
+ ).data
1253
+
1254
+
1255
+ @validate_call
1256
+ def permissions_lookup_subject_with_http_info(
1257
+ self,
1258
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
1259
+ body: LookupSubjectBody,
1260
+ _request_timeout: Union[
1261
+ None,
1262
+ Annotated[StrictFloat, Field(gt=0)],
1263
+ Tuple[
1264
+ Annotated[StrictFloat, Field(gt=0)],
1265
+ Annotated[StrictFloat, Field(gt=0)]
1266
+ ]
1267
+ ] = None,
1268
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1269
+ _content_type: Optional[StrictStr] = None,
1270
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1271
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1272
+ ) -> ApiResponse[PermissionLookupSubjectResponse]:
1273
+ """lookup-subject
1274
+
1275
+
1276
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
1277
+ :type tenant_id: str
1278
+ :param body: (required)
1279
+ :type body: LookupSubjectBody
1280
+ :param _request_timeout: timeout setting for this request. If one
1281
+ number provided, it will be total request
1282
+ timeout. It can also be a pair (tuple) of
1283
+ (connection, read) timeouts.
1284
+ :type _request_timeout: int, tuple(int, int), optional
1285
+ :param _request_auth: set to override the auth_settings for an a single
1286
+ request; this effectively ignores the
1287
+ authentication in the spec for a single request.
1288
+ :type _request_auth: dict, optional
1289
+ :param _content_type: force content-type for the request.
1290
+ :type _content_type: str, Optional
1291
+ :param _headers: set to override the headers for a single
1292
+ request; this effectively ignores the headers
1293
+ in the spec for a single request.
1294
+ :type _headers: dict, optional
1295
+ :param _host_index: set to override the host_index for a single
1296
+ request; this effectively ignores the host_index
1297
+ in the spec for a single request.
1298
+ :type _host_index: int, optional
1299
+ :return: Returns the result object.
1300
+ """ # noqa: E501
1301
+
1302
+ _param = self._permissions_lookup_subject_serialize(
1303
+ tenant_id=tenant_id,
1304
+ body=body,
1305
+ _request_auth=_request_auth,
1306
+ _content_type=_content_type,
1307
+ _headers=_headers,
1308
+ _host_index=_host_index
1309
+ )
1310
+
1311
+ _response_types_map: Dict[str, Optional[str]] = {
1312
+ '200': "PermissionLookupSubjectResponse",
1313
+ }
1314
+ response_data = self.api_client.call_api(
1315
+ *_param,
1316
+ _request_timeout=_request_timeout
1317
+ )
1318
+ response_data.read()
1319
+ return self.api_client.response_deserialize(
1320
+ response_data=response_data,
1321
+ response_types_map=_response_types_map,
1322
+ )
1323
+
1324
+
1325
+ @validate_call
1326
+ def permissions_lookup_subject_without_preload_content(
1327
+ self,
1328
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
1329
+ body: LookupSubjectBody,
1330
+ _request_timeout: Union[
1331
+ None,
1332
+ Annotated[StrictFloat, Field(gt=0)],
1333
+ Tuple[
1334
+ Annotated[StrictFloat, Field(gt=0)],
1335
+ Annotated[StrictFloat, Field(gt=0)]
1336
+ ]
1337
+ ] = None,
1338
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1339
+ _content_type: Optional[StrictStr] = None,
1340
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1341
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1342
+ ) -> RESTResponseType:
1343
+ """lookup-subject
1344
+
1345
+
1346
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
1347
+ :type tenant_id: str
1348
+ :param body: (required)
1349
+ :type body: LookupSubjectBody
1350
+ :param _request_timeout: timeout setting for this request. If one
1351
+ number provided, it will be total request
1352
+ timeout. It can also be a pair (tuple) of
1353
+ (connection, read) timeouts.
1354
+ :type _request_timeout: int, tuple(int, int), optional
1355
+ :param _request_auth: set to override the auth_settings for an a single
1356
+ request; this effectively ignores the
1357
+ authentication in the spec for a single request.
1358
+ :type _request_auth: dict, optional
1359
+ :param _content_type: force content-type for the request.
1360
+ :type _content_type: str, Optional
1361
+ :param _headers: set to override the headers for a single
1362
+ request; this effectively ignores the headers
1363
+ in the spec for a single request.
1364
+ :type _headers: dict, optional
1365
+ :param _host_index: set to override the host_index for a single
1366
+ request; this effectively ignores the host_index
1367
+ in the spec for a single request.
1368
+ :type _host_index: int, optional
1369
+ :return: Returns the result object.
1370
+ """ # noqa: E501
1371
+
1372
+ _param = self._permissions_lookup_subject_serialize(
1373
+ tenant_id=tenant_id,
1374
+ body=body,
1375
+ _request_auth=_request_auth,
1376
+ _content_type=_content_type,
1377
+ _headers=_headers,
1378
+ _host_index=_host_index
1379
+ )
1380
+
1381
+ _response_types_map: Dict[str, Optional[str]] = {
1382
+ '200': "PermissionLookupSubjectResponse",
1383
+ }
1384
+ response_data = self.api_client.call_api(
1385
+ *_param,
1386
+ _request_timeout=_request_timeout
1387
+ )
1388
+ return response_data.response
1389
+
1390
+
1391
+ def _permissions_lookup_subject_serialize(
1392
+ self,
1393
+ tenant_id,
1394
+ body,
1395
+ _request_auth,
1396
+ _content_type,
1397
+ _headers,
1398
+ _host_index,
1399
+ ) -> RequestSerialized:
1400
+
1401
+ _host = None
1402
+
1403
+ _collection_formats: Dict[str, str] = {
1404
+ }
1405
+
1406
+ _path_params: Dict[str, str] = {}
1407
+ _query_params: List[Tuple[str, str]] = []
1408
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1409
+ _form_params: List[Tuple[str, str]] = []
1410
+ _files: Dict[str, Union[str, bytes]] = {}
1411
+ _body_params: Optional[bytes] = None
1412
+
1413
+ # process the path parameters
1414
+ if tenant_id is not None:
1415
+ _path_params['tenant_id'] = tenant_id
1416
+ # process the query parameters
1417
+ # process the header parameters
1418
+ # process the form parameters
1419
+ # process the body parameter
1420
+ if body is not None:
1421
+ _body_params = body
1422
+
1423
+
1424
+ # set the HTTP header `Accept`
1425
+ if 'Accept' not in _header_params:
1426
+ _header_params['Accept'] = self.api_client.select_header_accept(
1427
+ [
1428
+ 'application/json'
1429
+ ]
1430
+ )
1431
+
1432
+ # set the HTTP header `Content-Type`
1433
+ if _content_type:
1434
+ _header_params['Content-Type'] = _content_type
1435
+ else:
1436
+ _default_content_type = (
1437
+ self.api_client.select_header_content_type(
1438
+ [
1439
+ 'application/json'
1440
+ ]
1441
+ )
1442
+ )
1443
+ if _default_content_type is not None:
1444
+ _header_params['Content-Type'] = _default_content_type
1445
+
1446
+ # authentication setting
1447
+ _auth_settings: List[str] = [
1448
+ ]
1449
+
1450
+ return self.api_client.param_serialize(
1451
+ method='POST',
1452
+ resource_path='/v1/tenants/{tenant_id}/permissions/lookup-subject',
1453
+ path_params=_path_params,
1454
+ query_params=_query_params,
1455
+ header_params=_header_params,
1456
+ body=_body_params,
1457
+ post_params=_form_params,
1458
+ files=_files,
1459
+ auth_settings=_auth_settings,
1460
+ collection_formats=_collection_formats,
1461
+ _host=_host,
1462
+ _request_auth=_request_auth
1463
+ )
1464
+
1465
+
1466
+
1467
+
1468
+ @validate_call
1469
+ def permissions_subject_permission(
1470
+ self,
1471
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
1472
+ body: SubjectPermissionBody,
1473
+ _request_timeout: Union[
1474
+ None,
1475
+ Annotated[StrictFloat, Field(gt=0)],
1476
+ Tuple[
1477
+ Annotated[StrictFloat, Field(gt=0)],
1478
+ Annotated[StrictFloat, Field(gt=0)]
1479
+ ]
1480
+ ] = None,
1481
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1482
+ _content_type: Optional[StrictStr] = None,
1483
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1484
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1485
+ ) -> PermissionSubjectPermissionResponse:
1486
+ """subject permission
1487
+
1488
+
1489
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
1490
+ :type tenant_id: str
1491
+ :param body: (required)
1492
+ :type body: SubjectPermissionBody
1493
+ :param _request_timeout: timeout setting for this request. If one
1494
+ number provided, it will be total request
1495
+ timeout. It can also be a pair (tuple) of
1496
+ (connection, read) timeouts.
1497
+ :type _request_timeout: int, tuple(int, int), optional
1498
+ :param _request_auth: set to override the auth_settings for an a single
1499
+ request; this effectively ignores the
1500
+ authentication in the spec for a single request.
1501
+ :type _request_auth: dict, optional
1502
+ :param _content_type: force content-type for the request.
1503
+ :type _content_type: str, Optional
1504
+ :param _headers: set to override the headers for a single
1505
+ request; this effectively ignores the headers
1506
+ in the spec for a single request.
1507
+ :type _headers: dict, optional
1508
+ :param _host_index: set to override the host_index for a single
1509
+ request; this effectively ignores the host_index
1510
+ in the spec for a single request.
1511
+ :type _host_index: int, optional
1512
+ :return: Returns the result object.
1513
+ """ # noqa: E501
1514
+
1515
+ _param = self._permissions_subject_permission_serialize(
1516
+ tenant_id=tenant_id,
1517
+ body=body,
1518
+ _request_auth=_request_auth,
1519
+ _content_type=_content_type,
1520
+ _headers=_headers,
1521
+ _host_index=_host_index
1522
+ )
1523
+
1524
+ _response_types_map: Dict[str, Optional[str]] = {
1525
+ '200': "PermissionSubjectPermissionResponse",
1526
+ }
1527
+ response_data = self.api_client.call_api(
1528
+ *_param,
1529
+ _request_timeout=_request_timeout
1530
+ )
1531
+ response_data.read()
1532
+ return self.api_client.response_deserialize(
1533
+ response_data=response_data,
1534
+ response_types_map=_response_types_map,
1535
+ ).data
1536
+
1537
+
1538
+ @validate_call
1539
+ def permissions_subject_permission_with_http_info(
1540
+ self,
1541
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
1542
+ body: SubjectPermissionBody,
1543
+ _request_timeout: Union[
1544
+ None,
1545
+ Annotated[StrictFloat, Field(gt=0)],
1546
+ Tuple[
1547
+ Annotated[StrictFloat, Field(gt=0)],
1548
+ Annotated[StrictFloat, Field(gt=0)]
1549
+ ]
1550
+ ] = None,
1551
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1552
+ _content_type: Optional[StrictStr] = None,
1553
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1554
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1555
+ ) -> ApiResponse[PermissionSubjectPermissionResponse]:
1556
+ """subject permission
1557
+
1558
+
1559
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
1560
+ :type tenant_id: str
1561
+ :param body: (required)
1562
+ :type body: SubjectPermissionBody
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._permissions_subject_permission_serialize(
1586
+ tenant_id=tenant_id,
1587
+ body=body,
1588
+ _request_auth=_request_auth,
1589
+ _content_type=_content_type,
1590
+ _headers=_headers,
1591
+ _host_index=_host_index
1592
+ )
1593
+
1594
+ _response_types_map: Dict[str, Optional[str]] = {
1595
+ '200': "PermissionSubjectPermissionResponse",
1596
+ }
1597
+ response_data = self.api_client.call_api(
1598
+ *_param,
1599
+ _request_timeout=_request_timeout
1600
+ )
1601
+ 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
+
1608
+ @validate_call
1609
+ def permissions_subject_permission_without_preload_content(
1610
+ self,
1611
+ tenant_id: Annotated[StrictStr, Field(description="Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.")],
1612
+ body: SubjectPermissionBody,
1613
+ _request_timeout: Union[
1614
+ None,
1615
+ Annotated[StrictFloat, Field(gt=0)],
1616
+ Tuple[
1617
+ Annotated[StrictFloat, Field(gt=0)],
1618
+ Annotated[StrictFloat, Field(gt=0)]
1619
+ ]
1620
+ ] = None,
1621
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1622
+ _content_type: Optional[StrictStr] = None,
1623
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1624
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1625
+ ) -> RESTResponseType:
1626
+ """subject permission
1627
+
1628
+
1629
+ :param tenant_id: Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. (required)
1630
+ :type tenant_id: str
1631
+ :param body: (required)
1632
+ :type body: SubjectPermissionBody
1633
+ :param _request_timeout: timeout setting for this request. If one
1634
+ number provided, it will be total request
1635
+ timeout. It can also be a pair (tuple) of
1636
+ (connection, read) timeouts.
1637
+ :type _request_timeout: int, tuple(int, int), optional
1638
+ :param _request_auth: set to override the auth_settings for an a single
1639
+ request; this effectively ignores the
1640
+ authentication in the spec for a single request.
1641
+ :type _request_auth: dict, optional
1642
+ :param _content_type: force content-type for the request.
1643
+ :type _content_type: str, Optional
1644
+ :param _headers: set to override the headers for a single
1645
+ request; this effectively ignores the headers
1646
+ in the spec for a single request.
1647
+ :type _headers: dict, optional
1648
+ :param _host_index: set to override the host_index for a single
1649
+ request; this effectively ignores the host_index
1650
+ in the spec for a single request.
1651
+ :type _host_index: int, optional
1652
+ :return: Returns the result object.
1653
+ """ # noqa: E501
1654
+
1655
+ _param = self._permissions_subject_permission_serialize(
1656
+ tenant_id=tenant_id,
1657
+ body=body,
1658
+ _request_auth=_request_auth,
1659
+ _content_type=_content_type,
1660
+ _headers=_headers,
1661
+ _host_index=_host_index
1662
+ )
1663
+
1664
+ _response_types_map: Dict[str, Optional[str]] = {
1665
+ '200': "PermissionSubjectPermissionResponse",
1666
+ }
1667
+ response_data = self.api_client.call_api(
1668
+ *_param,
1669
+ _request_timeout=_request_timeout
1670
+ )
1671
+ return response_data.response
1672
+
1673
+
1674
+ def _permissions_subject_permission_serialize(
1675
+ self,
1676
+ tenant_id,
1677
+ body,
1678
+ _request_auth,
1679
+ _content_type,
1680
+ _headers,
1681
+ _host_index,
1682
+ ) -> RequestSerialized:
1683
+
1684
+ _host = None
1685
+
1686
+ _collection_formats: Dict[str, str] = {
1687
+ }
1688
+
1689
+ _path_params: Dict[str, str] = {}
1690
+ _query_params: List[Tuple[str, str]] = []
1691
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1692
+ _form_params: List[Tuple[str, str]] = []
1693
+ _files: Dict[str, Union[str, bytes]] = {}
1694
+ _body_params: Optional[bytes] = None
1695
+
1696
+ # process the path parameters
1697
+ if tenant_id is not None:
1698
+ _path_params['tenant_id'] = tenant_id
1699
+ # process the query parameters
1700
+ # process the header parameters
1701
+ # process the form parameters
1702
+ # process the body parameter
1703
+ if body is not None:
1704
+ _body_params = body
1705
+
1706
+
1707
+ # set the HTTP header `Accept`
1708
+ if 'Accept' not in _header_params:
1709
+ _header_params['Accept'] = self.api_client.select_header_accept(
1710
+ [
1711
+ 'application/json'
1712
+ ]
1713
+ )
1714
+
1715
+ # set the HTTP header `Content-Type`
1716
+ if _content_type:
1717
+ _header_params['Content-Type'] = _content_type
1718
+ else:
1719
+ _default_content_type = (
1720
+ self.api_client.select_header_content_type(
1721
+ [
1722
+ 'application/json'
1723
+ ]
1724
+ )
1725
+ )
1726
+ if _default_content_type is not None:
1727
+ _header_params['Content-Type'] = _default_content_type
1728
+
1729
+ # authentication setting
1730
+ _auth_settings: List[str] = [
1731
+ ]
1732
+
1733
+ return self.api_client.param_serialize(
1734
+ method='POST',
1735
+ resource_path='/v1/tenants/{tenant_id}/permissions/subject-permission',
1736
+ path_params=_path_params,
1737
+ query_params=_query_params,
1738
+ header_params=_header_params,
1739
+ body=_body_params,
1740
+ post_params=_form_params,
1741
+ files=_files,
1742
+ auth_settings=_auth_settings,
1743
+ collection_formats=_collection_formats,
1744
+ _host=_host,
1745
+ _request_auth=_request_auth
1746
+ )
1747
+
1748
+