audithub-sdk 0.1.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.
Files changed (197) hide show
  1. audithub_sdk/__init__.py +410 -0
  2. audithub_sdk/api/__init__.py +22 -0
  3. audithub_sdk/api/admin_api.py +6117 -0
  4. audithub_sdk/api/configuration_api.py +520 -0
  5. audithub_sdk/api/custom_detectors_org_lib_api.py +1461 -0
  6. audithub_sdk/api/custom_detectors_std_lib_api.py +546 -0
  7. audithub_sdk/api/editor_languages_api.py +1383 -0
  8. audithub_sdk/api/generic_api.py +1275 -0
  9. audithub_sdk/api/hints_org_lib_api.py +2049 -0
  10. audithub_sdk/api/hints_std_lib_api.py +546 -0
  11. audithub_sdk/api/issues_api.py +2742 -0
  12. audithub_sdk/api/organizations_api.py +12148 -0
  13. audithub_sdk/api/projects_api.py +7069 -0
  14. audithub_sdk/api/subscriptions_api.py +1490 -0
  15. audithub_sdk/api/tasks_api.py +4276 -0
  16. audithub_sdk/api/tools_api.py +2298 -0
  17. audithub_sdk/api/users_api.py +2657 -0
  18. audithub_sdk/api/v_specs_org_lib_api.py +1461 -0
  19. audithub_sdk/api/v_specs_std_lib_api.py +546 -0
  20. audithub_sdk/api/versions_api.py +5419 -0
  21. audithub_sdk/api_client.py +808 -0
  22. audithub_sdk/api_response.py +21 -0
  23. audithub_sdk/configuration.py +572 -0
  24. audithub_sdk/exceptions.py +218 -0
  25. audithub_sdk/models/__init__.py +180 -0
  26. audithub_sdk/models/accounting_data.py +138 -0
  27. audithub_sdk/models/active_organization_users.py +120 -0
  28. audithub_sdk/models/admin_resource_patch.py +94 -0
  29. audithub_sdk/models/api_blacklisted_hint.py +96 -0
  30. audithub_sdk/models/api_key.py +89 -0
  31. audithub_sdk/models/api_key_base.py +87 -0
  32. audithub_sdk/models/api_key_with_secret.py +91 -0
  33. audithub_sdk/models/application_function.py +97 -0
  34. audithub_sdk/models/archive_input.py +104 -0
  35. audithub_sdk/models/artifact.py +102 -0
  36. audithub_sdk/models/comment.py +121 -0
  37. audithub_sdk/models/comment_with_mutations.py +121 -0
  38. audithub_sdk/models/container_resources.py +93 -0
  39. audithub_sdk/models/contents_inner.py +136 -0
  40. audithub_sdk/models/custom_detector.py +101 -0
  41. audithub_sdk/models/custom_detector_from_organization_library.py +99 -0
  42. audithub_sdk/models/custom_detector_from_standard_library.py +108 -0
  43. audithub_sdk/models/custom_detector_from_version.py +99 -0
  44. audithub_sdk/models/custom_detector_with_id.py +103 -0
  45. audithub_sdk/models/data.py +134 -0
  46. audithub_sdk/models/defi_vanguard_v2_input.py +93 -0
  47. audithub_sdk/models/defi_vanguard_v2_parameters.py +132 -0
  48. audithub_sdk/models/directory.py +111 -0
  49. audithub_sdk/models/editor_language.py +99 -0
  50. audithub_sdk/models/editor_language_with_id.py +101 -0
  51. audithub_sdk/models/effective_user_access_restriction.py +94 -0
  52. audithub_sdk/models/env_var.py +89 -0
  53. audithub_sdk/models/extra_function_arguments.py +107 -0
  54. audithub_sdk/models/favorite_project_assignment.py +87 -0
  55. audithub_sdk/models/file.py +101 -0
  56. audithub_sdk/models/file_thread_subject.py +103 -0
  57. audithub_sdk/models/finding_action.py +101 -0
  58. audithub_sdk/models/finding_action_base.py +96 -0
  59. audithub_sdk/models/finding_reference.py +91 -0
  60. audithub_sdk/models/finding_thread_subject.py +103 -0
  61. audithub_sdk/models/fio_data.py +113 -0
  62. audithub_sdk/models/fork_network_public.py +89 -0
  63. audithub_sdk/models/fuzzing_blacklist_entry.py +89 -0
  64. audithub_sdk/models/git_input.py +113 -0
  65. audithub_sdk/models/hint.py +101 -0
  66. audithub_sdk/models/hint_ad_hoc.py +113 -0
  67. audithub_sdk/models/hint_from_organization_library.py +99 -0
  68. audithub_sdk/models/hint_from_standard_library.py +108 -0
  69. audithub_sdk/models/hint_from_version.py +99 -0
  70. audithub_sdk/models/hint_with_id.py +103 -0
  71. audithub_sdk/models/http_validation_error.py +95 -0
  72. audithub_sdk/models/id_and_message_response.py +89 -0
  73. audithub_sdk/models/included_user_info.py +87 -0
  74. audithub_sdk/models/input_info.py +134 -0
  75. audithub_sdk/models/invitation.py +128 -0
  76. audithub_sdk/models/invitation_patch.py +94 -0
  77. audithub_sdk/models/invited_user.py +101 -0
  78. audithub_sdk/models/issue.py +138 -0
  79. audithub_sdk/models/issue_action.py +93 -0
  80. audithub_sdk/models/issue_batch_announce.py +88 -0
  81. audithub_sdk/models/issue_complete.py +167 -0
  82. audithub_sdk/models/issue_configuration_options.py +125 -0
  83. audithub_sdk/models/issue_details.py +110 -0
  84. audithub_sdk/models/issue_for_list.py +118 -0
  85. audithub_sdk/models/issue_impact.py +89 -0
  86. audithub_sdk/models/issue_info_base_complete.py +126 -0
  87. audithub_sdk/models/issue_info_editable.py +142 -0
  88. audithub_sdk/models/issue_likelihood.py +89 -0
  89. audithub_sdk/models/issue_patch.py +103 -0
  90. audithub_sdk/models/issue_resolution.py +100 -0
  91. audithub_sdk/models/issue_severity.py +89 -0
  92. audithub_sdk/models/issue_state_transition_function.py +110 -0
  93. audithub_sdk/models/issue_status.py +91 -0
  94. audithub_sdk/models/issue_status_transition.py +104 -0
  95. audithub_sdk/models/issue_thread_subject.py +99 -0
  96. audithub_sdk/models/issue_type.py +91 -0
  97. audithub_sdk/models/issue_type_info.py +87 -0
  98. audithub_sdk/models/machine_info.py +109 -0
  99. audithub_sdk/models/model_tool_input.py +102 -0
  100. audithub_sdk/models/model_tool_phase_parameters.py +169 -0
  101. audithub_sdk/models/new_invitation.py +103 -0
  102. audithub_sdk/models/new_organization.py +101 -0
  103. audithub_sdk/models/new_organization_package.py +132 -0
  104. audithub_sdk/models/new_organization_subscription.py +125 -0
  105. audithub_sdk/models/npm_project_dependency.py +103 -0
  106. audithub_sdk/models/onboarding_request.py +113 -0
  107. audithub_sdk/models/or_ca_input.py +134 -0
  108. audithub_sdk/models/or_ca_parameters.py +149 -0
  109. audithub_sdk/models/orca_value.py +138 -0
  110. audithub_sdk/models/organization.py +108 -0
  111. audithub_sdk/models/organization_access_restriction.py +101 -0
  112. audithub_sdk/models/organization_active_quota.py +104 -0
  113. audithub_sdk/models/organization_admin.py +110 -0
  114. audithub_sdk/models/organization_consumption.py +104 -0
  115. audithub_sdk/models/organization_quota.py +96 -0
  116. audithub_sdk/models/organization_subscription.py +135 -0
  117. audithub_sdk/models/package_data.py +140 -0
  118. audithub_sdk/models/package_subscription.py +103 -0
  119. audithub_sdk/models/patch_user.py +108 -0
  120. audithub_sdk/models/pending_finding_actions.py +99 -0
  121. audithub_sdk/models/picus_input.py +93 -0
  122. audithub_sdk/models/picus_parameters.py +111 -0
  123. audithub_sdk/models/picus_v2_input.py +93 -0
  124. audithub_sdk/models/picus_v2_parameters.py +195 -0
  125. audithub_sdk/models/project.py +200 -0
  126. audithub_sdk/models/project_admin.py +206 -0
  127. audithub_sdk/models/project_data.py +97 -0
  128. audithub_sdk/models/project_dependency.py +103 -0
  129. audithub_sdk/models/project_git_hub_link.py +87 -0
  130. audithub_sdk/models/project_info_input.py +186 -0
  131. audithub_sdk/models/project_info_output.py +186 -0
  132. audithub_sdk/models/project_thread_subject.py +97 -0
  133. audithub_sdk/models/project_update_response.py +93 -0
  134. audithub_sdk/models/psa.py +96 -0
  135. audithub_sdk/models/psa_message.py +94 -0
  136. audithub_sdk/models/public_configuration.py +216 -0
  137. audithub_sdk/models/put_user.py +91 -0
  138. audithub_sdk/models/registered_user.py +94 -0
  139. audithub_sdk/models/resource_patch.py +94 -0
  140. audithub_sdk/models/resources.py +87 -0
  141. audithub_sdk/models/root_model_list_union_custom_detector_from_version_custom_detector_from_standard_library_custom_detector_from_organization_library_inner.py +149 -0
  142. audithub_sdk/models/root_model_list_union_hint_from_version_hint_from_standard_library_hint_from_organization_library_hint_ad_hoc_inner.py +164 -0
  143. audithub_sdk/models/root_model_list_union_v_spec_from_version_v_spec_from_standard_library_v_spec_from_organization_library_v_spec_ad_hoc_inner.py +164 -0
  144. audithub_sdk/models/security_tool.py +89 -0
  145. audithub_sdk/models/self_onboard_request.py +94 -0
  146. audithub_sdk/models/source_reference.py +103 -0
  147. audithub_sdk/models/step_definition.py +91 -0
  148. audithub_sdk/models/step_resources.py +103 -0
  149. audithub_sdk/models/subject.py +168 -0
  150. audithub_sdk/models/success_and_message_response.py +93 -0
  151. audithub_sdk/models/task.py +184 -0
  152. audithub_sdk/models/task_admin.py +144 -0
  153. audithub_sdk/models/task_creation.py +89 -0
  154. audithub_sdk/models/task_fio_data.py +97 -0
  155. audithub_sdk/models/task_patch.py +94 -0
  156. audithub_sdk/models/task_resources.py +103 -0
  157. audithub_sdk/models/task_status.py +94 -0
  158. audithub_sdk/models/task_step.py +145 -0
  159. audithub_sdk/models/temp_version.py +93 -0
  160. audithub_sdk/models/thread.py +146 -0
  161. audithub_sdk/models/thread_comment.py +87 -0
  162. audithub_sdk/models/thread_patch.py +101 -0
  163. audithub_sdk/models/user.py +106 -0
  164. audithub_sdk/models/user_access_restriction.py +108 -0
  165. audithub_sdk/models/user_for_admin.py +108 -0
  166. audithub_sdk/models/user_group.py +89 -0
  167. audithub_sdk/models/user_information.py +89 -0
  168. audithub_sdk/models/user_organization_setting.py +89 -0
  169. audithub_sdk/models/user_patch.py +103 -0
  170. audithub_sdk/models/user_project_setting.py +89 -0
  171. audithub_sdk/models/user_thread_setting.py +89 -0
  172. audithub_sdk/models/user_to_organization_assignment.py +87 -0
  173. audithub_sdk/models/v_spec.py +101 -0
  174. audithub_sdk/models/v_spec_ad_hoc.py +113 -0
  175. audithub_sdk/models/v_spec_from_organization_library.py +99 -0
  176. audithub_sdk/models/v_spec_from_standard_library.py +108 -0
  177. audithub_sdk/models/v_spec_from_version.py +99 -0
  178. audithub_sdk/models/v_spec_with_id.py +103 -0
  179. audithub_sdk/models/validation_error.py +108 -0
  180. audithub_sdk/models/vanguard_detector.py +91 -0
  181. audithub_sdk/models/version.py +134 -0
  182. audithub_sdk/models/version_admin.py +142 -0
  183. audithub_sdk/models/version_data.py +103 -0
  184. audithub_sdk/models/version_patch.py +120 -0
  185. audithub_sdk/models/version_resources.py +103 -0
  186. audithub_sdk/models/zk_vanguard_input.py +93 -0
  187. audithub_sdk/models/zk_vanguard_parameters.py +108 -0
  188. audithub_sdk/models/zk_vanguard_v2_input.py +93 -0
  189. audithub_sdk/models/zk_vanguard_v2_parameters.py +108 -0
  190. audithub_sdk/py.typed +0 -0
  191. audithub_sdk/rest.py +199 -0
  192. audithub_sdk-0.1.0.dist-info/METADATA +129 -0
  193. audithub_sdk-0.1.0.dist-info/RECORD +197 -0
  194. audithub_sdk-0.1.0.dist-info/WHEEL +5 -0
  195. audithub_sdk-0.1.0.dist-info/top_level.txt +2 -0
  196. audithub_sdk_ext/__init__.py +11 -0
  197. audithub_sdk_ext/auth.py +207 -0
@@ -0,0 +1,1490 @@
1
+ """
2
+ FastAPI
3
+
4
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import StrictInt
19
+ from typing import Any
20
+ from audithub_sdk.models.id_and_message_response import IdAndMessageResponse
21
+ from audithub_sdk.models.new_organization_subscription import NewOrganizationSubscription
22
+ from audithub_sdk.models.organization_subscription import OrganizationSubscription
23
+ from audithub_sdk.models.resource_patch import ResourcePatch
24
+ from audithub_sdk.models.success_and_message_response import SuccessAndMessageResponse
25
+
26
+ from audithub_sdk.api_client import ApiClient, RequestSerialized
27
+ from audithub_sdk.api_response import ApiResponse
28
+ from audithub_sdk.rest import RESTResponseType
29
+
30
+
31
+ class SubscriptionsApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+
44
+ @validate_call
45
+ async def get_current_organization_subscriptions_organizations_organization_id_subscriptions_get(
46
+ self,
47
+ organization_id: StrictInt,
48
+ _request_timeout: Union[
49
+ None,
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Tuple[
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Annotated[StrictFloat, Field(gt=0)]
54
+ ]
55
+ ] = None,
56
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
57
+ _content_type: Optional[StrictStr] = None,
58
+ _headers: Optional[Dict[StrictStr, Any]] = None,
59
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
60
+ ) -> object:
61
+ """Get Current Organization Subscriptions
62
+
63
+ Get currently active organization subscriptions
64
+
65
+ :param organization_id: (required)
66
+ :type organization_id: int
67
+ :param _request_timeout: timeout setting for this request. If one
68
+ number provided, it will be total request
69
+ timeout. It can also be a pair (tuple) of
70
+ (connection, read) timeouts.
71
+ :type _request_timeout: int, tuple(int, int), optional
72
+ :param _request_auth: set to override the auth_settings for an a single
73
+ request; this effectively ignores the
74
+ authentication in the spec for a single request.
75
+ :type _request_auth: dict, optional
76
+ :param _content_type: force content-type for the request.
77
+ :type _content_type: str, Optional
78
+ :param _headers: set to override the headers for a single
79
+ request; this effectively ignores the headers
80
+ in the spec for a single request.
81
+ :type _headers: dict, optional
82
+ :param _host_index: set to override the host_index for a single
83
+ request; this effectively ignores the host_index
84
+ in the spec for a single request.
85
+ :type _host_index: int, optional
86
+ :return: Returns the result object.
87
+ """ # noqa: E501
88
+
89
+ _param = self._get_current_organization_subscriptions_organizations_organization_id_subscriptions_get_serialize(
90
+ organization_id=organization_id,
91
+ _request_auth=_request_auth,
92
+ _content_type=_content_type,
93
+ _headers=_headers,
94
+ _host_index=_host_index
95
+ )
96
+
97
+ _response_types_map: Dict[str, Optional[str]] = {
98
+ '200': "object",
99
+ '422': "HTTPValidationError",
100
+ }
101
+ response_data = await self.api_client.call_api(
102
+ *_param,
103
+ _request_timeout=_request_timeout
104
+ )
105
+ await response_data.read()
106
+ return self.api_client.response_deserialize(
107
+ response_data=response_data,
108
+ response_types_map=_response_types_map,
109
+ ).data
110
+
111
+
112
+ @validate_call
113
+ async def get_current_organization_subscriptions_organizations_organization_id_subscriptions_get_with_http_info(
114
+ self,
115
+ organization_id: StrictInt,
116
+ _request_timeout: Union[
117
+ None,
118
+ Annotated[StrictFloat, Field(gt=0)],
119
+ Tuple[
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Annotated[StrictFloat, Field(gt=0)]
122
+ ]
123
+ ] = None,
124
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
125
+ _content_type: Optional[StrictStr] = None,
126
+ _headers: Optional[Dict[StrictStr, Any]] = None,
127
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
128
+ ) -> ApiResponse[object]:
129
+ """Get Current Organization Subscriptions
130
+
131
+ Get currently active organization subscriptions
132
+
133
+ :param organization_id: (required)
134
+ :type organization_id: int
135
+ :param _request_timeout: timeout setting for this request. If one
136
+ number provided, it will be total request
137
+ timeout. It can also be a pair (tuple) of
138
+ (connection, read) timeouts.
139
+ :type _request_timeout: int, tuple(int, int), optional
140
+ :param _request_auth: set to override the auth_settings for an a single
141
+ request; this effectively ignores the
142
+ authentication in the spec for a single request.
143
+ :type _request_auth: dict, optional
144
+ :param _content_type: force content-type for the request.
145
+ :type _content_type: str, Optional
146
+ :param _headers: set to override the headers for a single
147
+ request; this effectively ignores the headers
148
+ in the spec for a single request.
149
+ :type _headers: dict, optional
150
+ :param _host_index: set to override the host_index for a single
151
+ request; this effectively ignores the host_index
152
+ in the spec for a single request.
153
+ :type _host_index: int, optional
154
+ :return: Returns the result object.
155
+ """ # noqa: E501
156
+
157
+ _param = self._get_current_organization_subscriptions_organizations_organization_id_subscriptions_get_serialize(
158
+ organization_id=organization_id,
159
+ _request_auth=_request_auth,
160
+ _content_type=_content_type,
161
+ _headers=_headers,
162
+ _host_index=_host_index
163
+ )
164
+
165
+ _response_types_map: Dict[str, Optional[str]] = {
166
+ '200': "object",
167
+ '422': "HTTPValidationError",
168
+ }
169
+ response_data = await self.api_client.call_api(
170
+ *_param,
171
+ _request_timeout=_request_timeout
172
+ )
173
+ await response_data.read()
174
+ return self.api_client.response_deserialize(
175
+ response_data=response_data,
176
+ response_types_map=_response_types_map,
177
+ )
178
+
179
+
180
+ @validate_call
181
+ async def get_current_organization_subscriptions_organizations_organization_id_subscriptions_get_without_preload_content(
182
+ self,
183
+ organization_id: StrictInt,
184
+ _request_timeout: Union[
185
+ None,
186
+ Annotated[StrictFloat, Field(gt=0)],
187
+ Tuple[
188
+ Annotated[StrictFloat, Field(gt=0)],
189
+ Annotated[StrictFloat, Field(gt=0)]
190
+ ]
191
+ ] = None,
192
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
193
+ _content_type: Optional[StrictStr] = None,
194
+ _headers: Optional[Dict[StrictStr, Any]] = None,
195
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
196
+ ) -> RESTResponseType:
197
+ """Get Current Organization Subscriptions
198
+
199
+ Get currently active organization subscriptions
200
+
201
+ :param organization_id: (required)
202
+ :type organization_id: int
203
+ :param _request_timeout: timeout setting for this request. If one
204
+ number provided, it will be total request
205
+ timeout. It can also be a pair (tuple) of
206
+ (connection, read) timeouts.
207
+ :type _request_timeout: int, tuple(int, int), optional
208
+ :param _request_auth: set to override the auth_settings for an a single
209
+ request; this effectively ignores the
210
+ authentication in the spec for a single request.
211
+ :type _request_auth: dict, optional
212
+ :param _content_type: force content-type for the request.
213
+ :type _content_type: str, Optional
214
+ :param _headers: set to override the headers for a single
215
+ request; this effectively ignores the headers
216
+ in the spec for a single request.
217
+ :type _headers: dict, optional
218
+ :param _host_index: set to override the host_index for a single
219
+ request; this effectively ignores the host_index
220
+ in the spec for a single request.
221
+ :type _host_index: int, optional
222
+ :return: Returns the result object.
223
+ """ # noqa: E501
224
+
225
+ _param = self._get_current_organization_subscriptions_organizations_organization_id_subscriptions_get_serialize(
226
+ organization_id=organization_id,
227
+ _request_auth=_request_auth,
228
+ _content_type=_content_type,
229
+ _headers=_headers,
230
+ _host_index=_host_index
231
+ )
232
+
233
+ _response_types_map: Dict[str, Optional[str]] = {
234
+ '200': "object",
235
+ '422': "HTTPValidationError",
236
+ }
237
+ response_data = await self.api_client.call_api(
238
+ *_param,
239
+ _request_timeout=_request_timeout
240
+ )
241
+ return response_data.response
242
+
243
+
244
+ def _get_current_organization_subscriptions_organizations_organization_id_subscriptions_get_serialize(
245
+ self,
246
+ organization_id,
247
+ _request_auth,
248
+ _content_type,
249
+ _headers,
250
+ _host_index,
251
+ ) -> RequestSerialized:
252
+
253
+ _host = None
254
+
255
+ _collection_formats: Dict[str, str] = {
256
+ }
257
+
258
+ _path_params: Dict[str, str] = {}
259
+ _query_params: List[Tuple[str, str]] = []
260
+ _header_params: Dict[str, Optional[str]] = _headers or {}
261
+ _form_params: List[Tuple[str, str]] = []
262
+ _files: Dict[
263
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
264
+ ] = {}
265
+ _body_params: Optional[bytes] = None
266
+
267
+ # process the path parameters
268
+ if organization_id is not None:
269
+ _path_params['organization_id'] = organization_id
270
+ # process the query parameters
271
+ # process the header parameters
272
+ # process the form parameters
273
+ # process the body parameter
274
+
275
+
276
+ # set the HTTP header `Accept`
277
+ if 'Accept' not in _header_params:
278
+ _header_params['Accept'] = self.api_client.select_header_accept(
279
+ [
280
+ 'application/json'
281
+ ]
282
+ )
283
+
284
+
285
+ # authentication setting
286
+ _auth_settings: List[str] = [
287
+ 'OpenIdConnect'
288
+ ]
289
+
290
+ return self.api_client.param_serialize(
291
+ method='GET',
292
+ resource_path='/organizations/{organization_id}/subscriptions',
293
+ path_params=_path_params,
294
+ query_params=_query_params,
295
+ header_params=_header_params,
296
+ body=_body_params,
297
+ post_params=_form_params,
298
+ files=_files,
299
+ auth_settings=_auth_settings,
300
+ collection_formats=_collection_formats,
301
+ _host=_host,
302
+ _request_auth=_request_auth
303
+ )
304
+
305
+
306
+
307
+
308
+ @validate_call
309
+ async def get_organization_subscription_organizations_organization_id_subscriptions_subscription_id_get(
310
+ self,
311
+ organization_id: StrictInt,
312
+ subscription_id: StrictInt,
313
+ _request_timeout: Union[
314
+ None,
315
+ Annotated[StrictFloat, Field(gt=0)],
316
+ Tuple[
317
+ Annotated[StrictFloat, Field(gt=0)],
318
+ Annotated[StrictFloat, Field(gt=0)]
319
+ ]
320
+ ] = None,
321
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
322
+ _content_type: Optional[StrictStr] = None,
323
+ _headers: Optional[Dict[StrictStr, Any]] = None,
324
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
325
+ ) -> OrganizationSubscription:
326
+ """Get Organization Subscription
327
+
328
+ Get organization subscription
329
+
330
+ :param organization_id: (required)
331
+ :type organization_id: int
332
+ :param subscription_id: (required)
333
+ :type subscription_id: int
334
+ :param _request_timeout: timeout setting for this request. If one
335
+ number provided, it will be total request
336
+ timeout. It can also be a pair (tuple) of
337
+ (connection, read) timeouts.
338
+ :type _request_timeout: int, tuple(int, int), optional
339
+ :param _request_auth: set to override the auth_settings for an a single
340
+ request; this effectively ignores the
341
+ authentication in the spec for a single request.
342
+ :type _request_auth: dict, optional
343
+ :param _content_type: force content-type for the request.
344
+ :type _content_type: str, Optional
345
+ :param _headers: set to override the headers for a single
346
+ request; this effectively ignores the headers
347
+ in the spec for a single request.
348
+ :type _headers: dict, optional
349
+ :param _host_index: set to override the host_index for a single
350
+ request; this effectively ignores the host_index
351
+ in the spec for a single request.
352
+ :type _host_index: int, optional
353
+ :return: Returns the result object.
354
+ """ # noqa: E501
355
+
356
+ _param = self._get_organization_subscription_organizations_organization_id_subscriptions_subscription_id_get_serialize(
357
+ organization_id=organization_id,
358
+ subscription_id=subscription_id,
359
+ _request_auth=_request_auth,
360
+ _content_type=_content_type,
361
+ _headers=_headers,
362
+ _host_index=_host_index
363
+ )
364
+
365
+ _response_types_map: Dict[str, Optional[str]] = {
366
+ '200': "OrganizationSubscription",
367
+ '422': "HTTPValidationError",
368
+ }
369
+ response_data = await self.api_client.call_api(
370
+ *_param,
371
+ _request_timeout=_request_timeout
372
+ )
373
+ await response_data.read()
374
+ return self.api_client.response_deserialize(
375
+ response_data=response_data,
376
+ response_types_map=_response_types_map,
377
+ ).data
378
+
379
+
380
+ @validate_call
381
+ async def get_organization_subscription_organizations_organization_id_subscriptions_subscription_id_get_with_http_info(
382
+ self,
383
+ organization_id: StrictInt,
384
+ subscription_id: StrictInt,
385
+ _request_timeout: Union[
386
+ None,
387
+ Annotated[StrictFloat, Field(gt=0)],
388
+ Tuple[
389
+ Annotated[StrictFloat, Field(gt=0)],
390
+ Annotated[StrictFloat, Field(gt=0)]
391
+ ]
392
+ ] = None,
393
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
394
+ _content_type: Optional[StrictStr] = None,
395
+ _headers: Optional[Dict[StrictStr, Any]] = None,
396
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
397
+ ) -> ApiResponse[OrganizationSubscription]:
398
+ """Get Organization Subscription
399
+
400
+ Get organization subscription
401
+
402
+ :param organization_id: (required)
403
+ :type organization_id: int
404
+ :param subscription_id: (required)
405
+ :type subscription_id: int
406
+ :param _request_timeout: timeout setting for this request. If one
407
+ number provided, it will be total request
408
+ timeout. It can also be a pair (tuple) of
409
+ (connection, read) timeouts.
410
+ :type _request_timeout: int, tuple(int, int), optional
411
+ :param _request_auth: set to override the auth_settings for an a single
412
+ request; this effectively ignores the
413
+ authentication in the spec for a single request.
414
+ :type _request_auth: dict, optional
415
+ :param _content_type: force content-type for the request.
416
+ :type _content_type: str, Optional
417
+ :param _headers: set to override the headers for a single
418
+ request; this effectively ignores the headers
419
+ in the spec for a single request.
420
+ :type _headers: dict, optional
421
+ :param _host_index: set to override the host_index for a single
422
+ request; this effectively ignores the host_index
423
+ in the spec for a single request.
424
+ :type _host_index: int, optional
425
+ :return: Returns the result object.
426
+ """ # noqa: E501
427
+
428
+ _param = self._get_organization_subscription_organizations_organization_id_subscriptions_subscription_id_get_serialize(
429
+ organization_id=organization_id,
430
+ subscription_id=subscription_id,
431
+ _request_auth=_request_auth,
432
+ _content_type=_content_type,
433
+ _headers=_headers,
434
+ _host_index=_host_index
435
+ )
436
+
437
+ _response_types_map: Dict[str, Optional[str]] = {
438
+ '200': "OrganizationSubscription",
439
+ '422': "HTTPValidationError",
440
+ }
441
+ response_data = await self.api_client.call_api(
442
+ *_param,
443
+ _request_timeout=_request_timeout
444
+ )
445
+ await response_data.read()
446
+ return self.api_client.response_deserialize(
447
+ response_data=response_data,
448
+ response_types_map=_response_types_map,
449
+ )
450
+
451
+
452
+ @validate_call
453
+ async def get_organization_subscription_organizations_organization_id_subscriptions_subscription_id_get_without_preload_content(
454
+ self,
455
+ organization_id: StrictInt,
456
+ subscription_id: StrictInt,
457
+ _request_timeout: Union[
458
+ None,
459
+ Annotated[StrictFloat, Field(gt=0)],
460
+ Tuple[
461
+ Annotated[StrictFloat, Field(gt=0)],
462
+ Annotated[StrictFloat, Field(gt=0)]
463
+ ]
464
+ ] = None,
465
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
466
+ _content_type: Optional[StrictStr] = None,
467
+ _headers: Optional[Dict[StrictStr, Any]] = None,
468
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
469
+ ) -> RESTResponseType:
470
+ """Get Organization Subscription
471
+
472
+ Get organization subscription
473
+
474
+ :param organization_id: (required)
475
+ :type organization_id: int
476
+ :param subscription_id: (required)
477
+ :type subscription_id: int
478
+ :param _request_timeout: timeout setting for this request. If one
479
+ number provided, it will be total request
480
+ timeout. It can also be a pair (tuple) of
481
+ (connection, read) timeouts.
482
+ :type _request_timeout: int, tuple(int, int), optional
483
+ :param _request_auth: set to override the auth_settings for an a single
484
+ request; this effectively ignores the
485
+ authentication in the spec for a single request.
486
+ :type _request_auth: dict, optional
487
+ :param _content_type: force content-type for the request.
488
+ :type _content_type: str, Optional
489
+ :param _headers: set to override the headers for a single
490
+ request; this effectively ignores the headers
491
+ in the spec for a single request.
492
+ :type _headers: dict, optional
493
+ :param _host_index: set to override the host_index for a single
494
+ request; this effectively ignores the host_index
495
+ in the spec for a single request.
496
+ :type _host_index: int, optional
497
+ :return: Returns the result object.
498
+ """ # noqa: E501
499
+
500
+ _param = self._get_organization_subscription_organizations_organization_id_subscriptions_subscription_id_get_serialize(
501
+ organization_id=organization_id,
502
+ subscription_id=subscription_id,
503
+ _request_auth=_request_auth,
504
+ _content_type=_content_type,
505
+ _headers=_headers,
506
+ _host_index=_host_index
507
+ )
508
+
509
+ _response_types_map: Dict[str, Optional[str]] = {
510
+ '200': "OrganizationSubscription",
511
+ '422': "HTTPValidationError",
512
+ }
513
+ response_data = await self.api_client.call_api(
514
+ *_param,
515
+ _request_timeout=_request_timeout
516
+ )
517
+ return response_data.response
518
+
519
+
520
+ def _get_organization_subscription_organizations_organization_id_subscriptions_subscription_id_get_serialize(
521
+ self,
522
+ organization_id,
523
+ subscription_id,
524
+ _request_auth,
525
+ _content_type,
526
+ _headers,
527
+ _host_index,
528
+ ) -> RequestSerialized:
529
+
530
+ _host = None
531
+
532
+ _collection_formats: Dict[str, str] = {
533
+ }
534
+
535
+ _path_params: Dict[str, str] = {}
536
+ _query_params: List[Tuple[str, str]] = []
537
+ _header_params: Dict[str, Optional[str]] = _headers or {}
538
+ _form_params: List[Tuple[str, str]] = []
539
+ _files: Dict[
540
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
541
+ ] = {}
542
+ _body_params: Optional[bytes] = None
543
+
544
+ # process the path parameters
545
+ if organization_id is not None:
546
+ _path_params['organization_id'] = organization_id
547
+ if subscription_id is not None:
548
+ _path_params['subscription_id'] = subscription_id
549
+ # process the query parameters
550
+ # process the header parameters
551
+ # process the form parameters
552
+ # process the body parameter
553
+
554
+
555
+ # set the HTTP header `Accept`
556
+ if 'Accept' not in _header_params:
557
+ _header_params['Accept'] = self.api_client.select_header_accept(
558
+ [
559
+ 'application/json'
560
+ ]
561
+ )
562
+
563
+
564
+ # authentication setting
565
+ _auth_settings: List[str] = [
566
+ 'OpenIdConnect'
567
+ ]
568
+
569
+ return self.api_client.param_serialize(
570
+ method='GET',
571
+ resource_path='/organizations/{organization_id}/subscriptions/{subscription_id}',
572
+ path_params=_path_params,
573
+ query_params=_query_params,
574
+ header_params=_header_params,
575
+ body=_body_params,
576
+ post_params=_form_params,
577
+ files=_files,
578
+ auth_settings=_auth_settings,
579
+ collection_formats=_collection_formats,
580
+ _host=_host,
581
+ _request_auth=_request_auth
582
+ )
583
+
584
+
585
+
586
+
587
+ @validate_call
588
+ async def patch_subscription_organizations_organization_id_subscriptions_subscription_id_patch(
589
+ self,
590
+ organization_id: StrictInt,
591
+ subscription_id: StrictInt,
592
+ resource_patch: ResourcePatch,
593
+ _request_timeout: Union[
594
+ None,
595
+ Annotated[StrictFloat, Field(gt=0)],
596
+ Tuple[
597
+ Annotated[StrictFloat, Field(gt=0)],
598
+ Annotated[StrictFloat, Field(gt=0)]
599
+ ]
600
+ ] = None,
601
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
602
+ _content_type: Optional[StrictStr] = None,
603
+ _headers: Optional[Dict[StrictStr, Any]] = None,
604
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
605
+ ) -> SuccessAndMessageResponse:
606
+ """Patch Subscription
607
+
608
+ Patch subscription
609
+
610
+ :param organization_id: (required)
611
+ :type organization_id: int
612
+ :param subscription_id: (required)
613
+ :type subscription_id: int
614
+ :param resource_patch: (required)
615
+ :type resource_patch: ResourcePatch
616
+ :param _request_timeout: timeout setting for this request. If one
617
+ number provided, it will be total request
618
+ timeout. It can also be a pair (tuple) of
619
+ (connection, read) timeouts.
620
+ :type _request_timeout: int, tuple(int, int), optional
621
+ :param _request_auth: set to override the auth_settings for an a single
622
+ request; this effectively ignores the
623
+ authentication in the spec for a single request.
624
+ :type _request_auth: dict, optional
625
+ :param _content_type: force content-type for the request.
626
+ :type _content_type: str, Optional
627
+ :param _headers: set to override the headers for a single
628
+ request; this effectively ignores the headers
629
+ in the spec for a single request.
630
+ :type _headers: dict, optional
631
+ :param _host_index: set to override the host_index for a single
632
+ request; this effectively ignores the host_index
633
+ in the spec for a single request.
634
+ :type _host_index: int, optional
635
+ :return: Returns the result object.
636
+ """ # noqa: E501
637
+
638
+ _param = self._patch_subscription_organizations_organization_id_subscriptions_subscription_id_patch_serialize(
639
+ organization_id=organization_id,
640
+ subscription_id=subscription_id,
641
+ resource_patch=resource_patch,
642
+ _request_auth=_request_auth,
643
+ _content_type=_content_type,
644
+ _headers=_headers,
645
+ _host_index=_host_index
646
+ )
647
+
648
+ _response_types_map: Dict[str, Optional[str]] = {
649
+ '200': "SuccessAndMessageResponse",
650
+ '422': "HTTPValidationError",
651
+ }
652
+ response_data = await self.api_client.call_api(
653
+ *_param,
654
+ _request_timeout=_request_timeout
655
+ )
656
+ await response_data.read()
657
+ return self.api_client.response_deserialize(
658
+ response_data=response_data,
659
+ response_types_map=_response_types_map,
660
+ ).data
661
+
662
+
663
+ @validate_call
664
+ async def patch_subscription_organizations_organization_id_subscriptions_subscription_id_patch_with_http_info(
665
+ self,
666
+ organization_id: StrictInt,
667
+ subscription_id: StrictInt,
668
+ resource_patch: ResourcePatch,
669
+ _request_timeout: Union[
670
+ None,
671
+ Annotated[StrictFloat, Field(gt=0)],
672
+ Tuple[
673
+ Annotated[StrictFloat, Field(gt=0)],
674
+ Annotated[StrictFloat, Field(gt=0)]
675
+ ]
676
+ ] = None,
677
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
678
+ _content_type: Optional[StrictStr] = None,
679
+ _headers: Optional[Dict[StrictStr, Any]] = None,
680
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
681
+ ) -> ApiResponse[SuccessAndMessageResponse]:
682
+ """Patch Subscription
683
+
684
+ Patch subscription
685
+
686
+ :param organization_id: (required)
687
+ :type organization_id: int
688
+ :param subscription_id: (required)
689
+ :type subscription_id: int
690
+ :param resource_patch: (required)
691
+ :type resource_patch: ResourcePatch
692
+ :param _request_timeout: timeout setting for this request. If one
693
+ number provided, it will be total request
694
+ timeout. It can also be a pair (tuple) of
695
+ (connection, read) timeouts.
696
+ :type _request_timeout: int, tuple(int, int), optional
697
+ :param _request_auth: set to override the auth_settings for an a single
698
+ request; this effectively ignores the
699
+ authentication in the spec for a single request.
700
+ :type _request_auth: dict, optional
701
+ :param _content_type: force content-type for the request.
702
+ :type _content_type: str, Optional
703
+ :param _headers: set to override the headers for a single
704
+ request; this effectively ignores the headers
705
+ in the spec for a single request.
706
+ :type _headers: dict, optional
707
+ :param _host_index: set to override the host_index for a single
708
+ request; this effectively ignores the host_index
709
+ in the spec for a single request.
710
+ :type _host_index: int, optional
711
+ :return: Returns the result object.
712
+ """ # noqa: E501
713
+
714
+ _param = self._patch_subscription_organizations_organization_id_subscriptions_subscription_id_patch_serialize(
715
+ organization_id=organization_id,
716
+ subscription_id=subscription_id,
717
+ resource_patch=resource_patch,
718
+ _request_auth=_request_auth,
719
+ _content_type=_content_type,
720
+ _headers=_headers,
721
+ _host_index=_host_index
722
+ )
723
+
724
+ _response_types_map: Dict[str, Optional[str]] = {
725
+ '200': "SuccessAndMessageResponse",
726
+ '422': "HTTPValidationError",
727
+ }
728
+ response_data = await self.api_client.call_api(
729
+ *_param,
730
+ _request_timeout=_request_timeout
731
+ )
732
+ await response_data.read()
733
+ return self.api_client.response_deserialize(
734
+ response_data=response_data,
735
+ response_types_map=_response_types_map,
736
+ )
737
+
738
+
739
+ @validate_call
740
+ async def patch_subscription_organizations_organization_id_subscriptions_subscription_id_patch_without_preload_content(
741
+ self,
742
+ organization_id: StrictInt,
743
+ subscription_id: StrictInt,
744
+ resource_patch: ResourcePatch,
745
+ _request_timeout: Union[
746
+ None,
747
+ Annotated[StrictFloat, Field(gt=0)],
748
+ Tuple[
749
+ Annotated[StrictFloat, Field(gt=0)],
750
+ Annotated[StrictFloat, Field(gt=0)]
751
+ ]
752
+ ] = None,
753
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
754
+ _content_type: Optional[StrictStr] = None,
755
+ _headers: Optional[Dict[StrictStr, Any]] = None,
756
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
757
+ ) -> RESTResponseType:
758
+ """Patch Subscription
759
+
760
+ Patch subscription
761
+
762
+ :param organization_id: (required)
763
+ :type organization_id: int
764
+ :param subscription_id: (required)
765
+ :type subscription_id: int
766
+ :param resource_patch: (required)
767
+ :type resource_patch: ResourcePatch
768
+ :param _request_timeout: timeout setting for this request. If one
769
+ number provided, it will be total request
770
+ timeout. It can also be a pair (tuple) of
771
+ (connection, read) timeouts.
772
+ :type _request_timeout: int, tuple(int, int), optional
773
+ :param _request_auth: set to override the auth_settings for an a single
774
+ request; this effectively ignores the
775
+ authentication in the spec for a single request.
776
+ :type _request_auth: dict, optional
777
+ :param _content_type: force content-type for the request.
778
+ :type _content_type: str, Optional
779
+ :param _headers: set to override the headers for a single
780
+ request; this effectively ignores the headers
781
+ in the spec for a single request.
782
+ :type _headers: dict, optional
783
+ :param _host_index: set to override the host_index for a single
784
+ request; this effectively ignores the host_index
785
+ in the spec for a single request.
786
+ :type _host_index: int, optional
787
+ :return: Returns the result object.
788
+ """ # noqa: E501
789
+
790
+ _param = self._patch_subscription_organizations_organization_id_subscriptions_subscription_id_patch_serialize(
791
+ organization_id=organization_id,
792
+ subscription_id=subscription_id,
793
+ resource_patch=resource_patch,
794
+ _request_auth=_request_auth,
795
+ _content_type=_content_type,
796
+ _headers=_headers,
797
+ _host_index=_host_index
798
+ )
799
+
800
+ _response_types_map: Dict[str, Optional[str]] = {
801
+ '200': "SuccessAndMessageResponse",
802
+ '422': "HTTPValidationError",
803
+ }
804
+ response_data = await self.api_client.call_api(
805
+ *_param,
806
+ _request_timeout=_request_timeout
807
+ )
808
+ return response_data.response
809
+
810
+
811
+ def _patch_subscription_organizations_organization_id_subscriptions_subscription_id_patch_serialize(
812
+ self,
813
+ organization_id,
814
+ subscription_id,
815
+ resource_patch,
816
+ _request_auth,
817
+ _content_type,
818
+ _headers,
819
+ _host_index,
820
+ ) -> RequestSerialized:
821
+
822
+ _host = None
823
+
824
+ _collection_formats: Dict[str, str] = {
825
+ }
826
+
827
+ _path_params: Dict[str, str] = {}
828
+ _query_params: List[Tuple[str, str]] = []
829
+ _header_params: Dict[str, Optional[str]] = _headers or {}
830
+ _form_params: List[Tuple[str, str]] = []
831
+ _files: Dict[
832
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
833
+ ] = {}
834
+ _body_params: Optional[bytes] = None
835
+
836
+ # process the path parameters
837
+ if organization_id is not None:
838
+ _path_params['organization_id'] = organization_id
839
+ if subscription_id is not None:
840
+ _path_params['subscription_id'] = subscription_id
841
+ # process the query parameters
842
+ # process the header parameters
843
+ # process the form parameters
844
+ # process the body parameter
845
+ if resource_patch is not None:
846
+ _body_params = resource_patch
847
+
848
+
849
+ # set the HTTP header `Accept`
850
+ if 'Accept' not in _header_params:
851
+ _header_params['Accept'] = self.api_client.select_header_accept(
852
+ [
853
+ 'application/json'
854
+ ]
855
+ )
856
+
857
+ # set the HTTP header `Content-Type`
858
+ if _content_type:
859
+ _header_params['Content-Type'] = _content_type
860
+ else:
861
+ _default_content_type = (
862
+ self.api_client.select_header_content_type(
863
+ [
864
+ 'application/json'
865
+ ]
866
+ )
867
+ )
868
+ if _default_content_type is not None:
869
+ _header_params['Content-Type'] = _default_content_type
870
+
871
+ # authentication setting
872
+ _auth_settings: List[str] = [
873
+ 'OpenIdConnect'
874
+ ]
875
+
876
+ return self.api_client.param_serialize(
877
+ method='PATCH',
878
+ resource_path='/organizations/{organization_id}/subscriptions/{subscription_id}',
879
+ path_params=_path_params,
880
+ query_params=_query_params,
881
+ header_params=_header_params,
882
+ body=_body_params,
883
+ post_params=_form_params,
884
+ files=_files,
885
+ auth_settings=_auth_settings,
886
+ collection_formats=_collection_formats,
887
+ _host=_host,
888
+ _request_auth=_request_auth
889
+ )
890
+
891
+
892
+
893
+
894
+ @validate_call
895
+ async def post_organization_subscription_organizations_organization_id_subscriptions_post(
896
+ self,
897
+ organization_id: StrictInt,
898
+ new_organization_subscription: NewOrganizationSubscription,
899
+ _request_timeout: Union[
900
+ None,
901
+ Annotated[StrictFloat, Field(gt=0)],
902
+ Tuple[
903
+ Annotated[StrictFloat, Field(gt=0)],
904
+ Annotated[StrictFloat, Field(gt=0)]
905
+ ]
906
+ ] = None,
907
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
908
+ _content_type: Optional[StrictStr] = None,
909
+ _headers: Optional[Dict[StrictStr, Any]] = None,
910
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
911
+ ) -> IdAndMessageResponse:
912
+ """Post Organization Subscription
913
+
914
+ Create new organization subscription
915
+
916
+ :param organization_id: (required)
917
+ :type organization_id: int
918
+ :param new_organization_subscription: (required)
919
+ :type new_organization_subscription: NewOrganizationSubscription
920
+ :param _request_timeout: timeout setting for this request. If one
921
+ number provided, it will be total request
922
+ timeout. It can also be a pair (tuple) of
923
+ (connection, read) timeouts.
924
+ :type _request_timeout: int, tuple(int, int), optional
925
+ :param _request_auth: set to override the auth_settings for an a single
926
+ request; this effectively ignores the
927
+ authentication in the spec for a single request.
928
+ :type _request_auth: dict, optional
929
+ :param _content_type: force content-type for the request.
930
+ :type _content_type: str, Optional
931
+ :param _headers: set to override the headers for a single
932
+ request; this effectively ignores the headers
933
+ in the spec for a single request.
934
+ :type _headers: dict, optional
935
+ :param _host_index: set to override the host_index for a single
936
+ request; this effectively ignores the host_index
937
+ in the spec for a single request.
938
+ :type _host_index: int, optional
939
+ :return: Returns the result object.
940
+ """ # noqa: E501
941
+
942
+ _param = self._post_organization_subscription_organizations_organization_id_subscriptions_post_serialize(
943
+ organization_id=organization_id,
944
+ new_organization_subscription=new_organization_subscription,
945
+ _request_auth=_request_auth,
946
+ _content_type=_content_type,
947
+ _headers=_headers,
948
+ _host_index=_host_index
949
+ )
950
+
951
+ _response_types_map: Dict[str, Optional[str]] = {
952
+ '200': "IdAndMessageResponse",
953
+ '422': "HTTPValidationError",
954
+ }
955
+ response_data = await self.api_client.call_api(
956
+ *_param,
957
+ _request_timeout=_request_timeout
958
+ )
959
+ await response_data.read()
960
+ return self.api_client.response_deserialize(
961
+ response_data=response_data,
962
+ response_types_map=_response_types_map,
963
+ ).data
964
+
965
+
966
+ @validate_call
967
+ async def post_organization_subscription_organizations_organization_id_subscriptions_post_with_http_info(
968
+ self,
969
+ organization_id: StrictInt,
970
+ new_organization_subscription: NewOrganizationSubscription,
971
+ _request_timeout: Union[
972
+ None,
973
+ Annotated[StrictFloat, Field(gt=0)],
974
+ Tuple[
975
+ Annotated[StrictFloat, Field(gt=0)],
976
+ Annotated[StrictFloat, Field(gt=0)]
977
+ ]
978
+ ] = None,
979
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
980
+ _content_type: Optional[StrictStr] = None,
981
+ _headers: Optional[Dict[StrictStr, Any]] = None,
982
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
983
+ ) -> ApiResponse[IdAndMessageResponse]:
984
+ """Post Organization Subscription
985
+
986
+ Create new organization subscription
987
+
988
+ :param organization_id: (required)
989
+ :type organization_id: int
990
+ :param new_organization_subscription: (required)
991
+ :type new_organization_subscription: NewOrganizationSubscription
992
+ :param _request_timeout: timeout setting for this request. If one
993
+ number provided, it will be total request
994
+ timeout. It can also be a pair (tuple) of
995
+ (connection, read) timeouts.
996
+ :type _request_timeout: int, tuple(int, int), optional
997
+ :param _request_auth: set to override the auth_settings for an a single
998
+ request; this effectively ignores the
999
+ authentication in the spec for a single request.
1000
+ :type _request_auth: dict, optional
1001
+ :param _content_type: force content-type for the request.
1002
+ :type _content_type: str, Optional
1003
+ :param _headers: set to override the headers for a single
1004
+ request; this effectively ignores the headers
1005
+ in the spec for a single request.
1006
+ :type _headers: dict, optional
1007
+ :param _host_index: set to override the host_index for a single
1008
+ request; this effectively ignores the host_index
1009
+ in the spec for a single request.
1010
+ :type _host_index: int, optional
1011
+ :return: Returns the result object.
1012
+ """ # noqa: E501
1013
+
1014
+ _param = self._post_organization_subscription_organizations_organization_id_subscriptions_post_serialize(
1015
+ organization_id=organization_id,
1016
+ new_organization_subscription=new_organization_subscription,
1017
+ _request_auth=_request_auth,
1018
+ _content_type=_content_type,
1019
+ _headers=_headers,
1020
+ _host_index=_host_index
1021
+ )
1022
+
1023
+ _response_types_map: Dict[str, Optional[str]] = {
1024
+ '200': "IdAndMessageResponse",
1025
+ '422': "HTTPValidationError",
1026
+ }
1027
+ response_data = await self.api_client.call_api(
1028
+ *_param,
1029
+ _request_timeout=_request_timeout
1030
+ )
1031
+ await response_data.read()
1032
+ return self.api_client.response_deserialize(
1033
+ response_data=response_data,
1034
+ response_types_map=_response_types_map,
1035
+ )
1036
+
1037
+
1038
+ @validate_call
1039
+ async def post_organization_subscription_organizations_organization_id_subscriptions_post_without_preload_content(
1040
+ self,
1041
+ organization_id: StrictInt,
1042
+ new_organization_subscription: NewOrganizationSubscription,
1043
+ _request_timeout: Union[
1044
+ None,
1045
+ Annotated[StrictFloat, Field(gt=0)],
1046
+ Tuple[
1047
+ Annotated[StrictFloat, Field(gt=0)],
1048
+ Annotated[StrictFloat, Field(gt=0)]
1049
+ ]
1050
+ ] = None,
1051
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1052
+ _content_type: Optional[StrictStr] = None,
1053
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1054
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1055
+ ) -> RESTResponseType:
1056
+ """Post Organization Subscription
1057
+
1058
+ Create new organization subscription
1059
+
1060
+ :param organization_id: (required)
1061
+ :type organization_id: int
1062
+ :param new_organization_subscription: (required)
1063
+ :type new_organization_subscription: NewOrganizationSubscription
1064
+ :param _request_timeout: timeout setting for this request. If one
1065
+ number provided, it will be total request
1066
+ timeout. It can also be a pair (tuple) of
1067
+ (connection, read) timeouts.
1068
+ :type _request_timeout: int, tuple(int, int), optional
1069
+ :param _request_auth: set to override the auth_settings for an a single
1070
+ request; this effectively ignores the
1071
+ authentication in the spec for a single request.
1072
+ :type _request_auth: dict, optional
1073
+ :param _content_type: force content-type for the request.
1074
+ :type _content_type: str, Optional
1075
+ :param _headers: set to override the headers for a single
1076
+ request; this effectively ignores the headers
1077
+ in the spec for a single request.
1078
+ :type _headers: dict, optional
1079
+ :param _host_index: set to override the host_index for a single
1080
+ request; this effectively ignores the host_index
1081
+ in the spec for a single request.
1082
+ :type _host_index: int, optional
1083
+ :return: Returns the result object.
1084
+ """ # noqa: E501
1085
+
1086
+ _param = self._post_organization_subscription_organizations_organization_id_subscriptions_post_serialize(
1087
+ organization_id=organization_id,
1088
+ new_organization_subscription=new_organization_subscription,
1089
+ _request_auth=_request_auth,
1090
+ _content_type=_content_type,
1091
+ _headers=_headers,
1092
+ _host_index=_host_index
1093
+ )
1094
+
1095
+ _response_types_map: Dict[str, Optional[str]] = {
1096
+ '200': "IdAndMessageResponse",
1097
+ '422': "HTTPValidationError",
1098
+ }
1099
+ response_data = await self.api_client.call_api(
1100
+ *_param,
1101
+ _request_timeout=_request_timeout
1102
+ )
1103
+ return response_data.response
1104
+
1105
+
1106
+ def _post_organization_subscription_organizations_organization_id_subscriptions_post_serialize(
1107
+ self,
1108
+ organization_id,
1109
+ new_organization_subscription,
1110
+ _request_auth,
1111
+ _content_type,
1112
+ _headers,
1113
+ _host_index,
1114
+ ) -> RequestSerialized:
1115
+
1116
+ _host = None
1117
+
1118
+ _collection_formats: Dict[str, str] = {
1119
+ }
1120
+
1121
+ _path_params: Dict[str, str] = {}
1122
+ _query_params: List[Tuple[str, str]] = []
1123
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1124
+ _form_params: List[Tuple[str, str]] = []
1125
+ _files: Dict[
1126
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1127
+ ] = {}
1128
+ _body_params: Optional[bytes] = None
1129
+
1130
+ # process the path parameters
1131
+ if organization_id is not None:
1132
+ _path_params['organization_id'] = organization_id
1133
+ # process the query parameters
1134
+ # process the header parameters
1135
+ # process the form parameters
1136
+ # process the body parameter
1137
+ if new_organization_subscription is not None:
1138
+ _body_params = new_organization_subscription
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
+ 'OpenIdConnect'
1166
+ ]
1167
+
1168
+ return self.api_client.param_serialize(
1169
+ method='POST',
1170
+ resource_path='/organizations/{organization_id}/subscriptions',
1171
+ path_params=_path_params,
1172
+ query_params=_query_params,
1173
+ header_params=_header_params,
1174
+ body=_body_params,
1175
+ post_params=_form_params,
1176
+ files=_files,
1177
+ auth_settings=_auth_settings,
1178
+ collection_formats=_collection_formats,
1179
+ _host=_host,
1180
+ _request_auth=_request_auth
1181
+ )
1182
+
1183
+
1184
+
1185
+
1186
+ @validate_call
1187
+ async def put_organization_subscription_organizations_organization_id_subscriptions_subscription_id_put(
1188
+ self,
1189
+ organization_id: StrictInt,
1190
+ subscription_id: StrictInt,
1191
+ new_organization_subscription: NewOrganizationSubscription,
1192
+ _request_timeout: Union[
1193
+ None,
1194
+ Annotated[StrictFloat, Field(gt=0)],
1195
+ Tuple[
1196
+ Annotated[StrictFloat, Field(gt=0)],
1197
+ Annotated[StrictFloat, Field(gt=0)]
1198
+ ]
1199
+ ] = None,
1200
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1201
+ _content_type: Optional[StrictStr] = None,
1202
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1203
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1204
+ ) -> SuccessAndMessageResponse:
1205
+ """Put Organization Subscription
1206
+
1207
+ Update active organization subscription
1208
+
1209
+ :param organization_id: (required)
1210
+ :type organization_id: int
1211
+ :param subscription_id: (required)
1212
+ :type subscription_id: int
1213
+ :param new_organization_subscription: (required)
1214
+ :type new_organization_subscription: NewOrganizationSubscription
1215
+ :param _request_timeout: timeout setting for this request. If one
1216
+ number provided, it will be total request
1217
+ timeout. It can also be a pair (tuple) of
1218
+ (connection, read) timeouts.
1219
+ :type _request_timeout: int, tuple(int, int), optional
1220
+ :param _request_auth: set to override the auth_settings for an a single
1221
+ request; this effectively ignores the
1222
+ authentication in the spec for a single request.
1223
+ :type _request_auth: dict, optional
1224
+ :param _content_type: force content-type for the request.
1225
+ :type _content_type: str, Optional
1226
+ :param _headers: set to override the headers for a single
1227
+ request; this effectively ignores the headers
1228
+ in the spec for a single request.
1229
+ :type _headers: dict, optional
1230
+ :param _host_index: set to override the host_index for a single
1231
+ request; this effectively ignores the host_index
1232
+ in the spec for a single request.
1233
+ :type _host_index: int, optional
1234
+ :return: Returns the result object.
1235
+ """ # noqa: E501
1236
+
1237
+ _param = self._put_organization_subscription_organizations_organization_id_subscriptions_subscription_id_put_serialize(
1238
+ organization_id=organization_id,
1239
+ subscription_id=subscription_id,
1240
+ new_organization_subscription=new_organization_subscription,
1241
+ _request_auth=_request_auth,
1242
+ _content_type=_content_type,
1243
+ _headers=_headers,
1244
+ _host_index=_host_index
1245
+ )
1246
+
1247
+ _response_types_map: Dict[str, Optional[str]] = {
1248
+ '200': "SuccessAndMessageResponse",
1249
+ '422': "HTTPValidationError",
1250
+ }
1251
+ response_data = await self.api_client.call_api(
1252
+ *_param,
1253
+ _request_timeout=_request_timeout
1254
+ )
1255
+ await response_data.read()
1256
+ return self.api_client.response_deserialize(
1257
+ response_data=response_data,
1258
+ response_types_map=_response_types_map,
1259
+ ).data
1260
+
1261
+
1262
+ @validate_call
1263
+ async def put_organization_subscription_organizations_organization_id_subscriptions_subscription_id_put_with_http_info(
1264
+ self,
1265
+ organization_id: StrictInt,
1266
+ subscription_id: StrictInt,
1267
+ new_organization_subscription: NewOrganizationSubscription,
1268
+ _request_timeout: Union[
1269
+ None,
1270
+ Annotated[StrictFloat, Field(gt=0)],
1271
+ Tuple[
1272
+ Annotated[StrictFloat, Field(gt=0)],
1273
+ Annotated[StrictFloat, Field(gt=0)]
1274
+ ]
1275
+ ] = None,
1276
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1277
+ _content_type: Optional[StrictStr] = None,
1278
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1279
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1280
+ ) -> ApiResponse[SuccessAndMessageResponse]:
1281
+ """Put Organization Subscription
1282
+
1283
+ Update active organization subscription
1284
+
1285
+ :param organization_id: (required)
1286
+ :type organization_id: int
1287
+ :param subscription_id: (required)
1288
+ :type subscription_id: int
1289
+ :param new_organization_subscription: (required)
1290
+ :type new_organization_subscription: NewOrganizationSubscription
1291
+ :param _request_timeout: timeout setting for this request. If one
1292
+ number provided, it will be total request
1293
+ timeout. It can also be a pair (tuple) of
1294
+ (connection, read) timeouts.
1295
+ :type _request_timeout: int, tuple(int, int), optional
1296
+ :param _request_auth: set to override the auth_settings for an a single
1297
+ request; this effectively ignores the
1298
+ authentication in the spec for a single request.
1299
+ :type _request_auth: dict, optional
1300
+ :param _content_type: force content-type for the request.
1301
+ :type _content_type: str, Optional
1302
+ :param _headers: set to override the headers for a single
1303
+ request; this effectively ignores the headers
1304
+ in the spec for a single request.
1305
+ :type _headers: dict, optional
1306
+ :param _host_index: set to override the host_index for a single
1307
+ request; this effectively ignores the host_index
1308
+ in the spec for a single request.
1309
+ :type _host_index: int, optional
1310
+ :return: Returns the result object.
1311
+ """ # noqa: E501
1312
+
1313
+ _param = self._put_organization_subscription_organizations_organization_id_subscriptions_subscription_id_put_serialize(
1314
+ organization_id=organization_id,
1315
+ subscription_id=subscription_id,
1316
+ new_organization_subscription=new_organization_subscription,
1317
+ _request_auth=_request_auth,
1318
+ _content_type=_content_type,
1319
+ _headers=_headers,
1320
+ _host_index=_host_index
1321
+ )
1322
+
1323
+ _response_types_map: Dict[str, Optional[str]] = {
1324
+ '200': "SuccessAndMessageResponse",
1325
+ '422': "HTTPValidationError",
1326
+ }
1327
+ response_data = await self.api_client.call_api(
1328
+ *_param,
1329
+ _request_timeout=_request_timeout
1330
+ )
1331
+ await response_data.read()
1332
+ return self.api_client.response_deserialize(
1333
+ response_data=response_data,
1334
+ response_types_map=_response_types_map,
1335
+ )
1336
+
1337
+
1338
+ @validate_call
1339
+ async def put_organization_subscription_organizations_organization_id_subscriptions_subscription_id_put_without_preload_content(
1340
+ self,
1341
+ organization_id: StrictInt,
1342
+ subscription_id: StrictInt,
1343
+ new_organization_subscription: NewOrganizationSubscription,
1344
+ _request_timeout: Union[
1345
+ None,
1346
+ Annotated[StrictFloat, Field(gt=0)],
1347
+ Tuple[
1348
+ Annotated[StrictFloat, Field(gt=0)],
1349
+ Annotated[StrictFloat, Field(gt=0)]
1350
+ ]
1351
+ ] = None,
1352
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1353
+ _content_type: Optional[StrictStr] = None,
1354
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1355
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1356
+ ) -> RESTResponseType:
1357
+ """Put Organization Subscription
1358
+
1359
+ Update active organization subscription
1360
+
1361
+ :param organization_id: (required)
1362
+ :type organization_id: int
1363
+ :param subscription_id: (required)
1364
+ :type subscription_id: int
1365
+ :param new_organization_subscription: (required)
1366
+ :type new_organization_subscription: NewOrganizationSubscription
1367
+ :param _request_timeout: timeout setting for this request. If one
1368
+ number provided, it will be total request
1369
+ timeout. It can also be a pair (tuple) of
1370
+ (connection, read) timeouts.
1371
+ :type _request_timeout: int, tuple(int, int), optional
1372
+ :param _request_auth: set to override the auth_settings for an a single
1373
+ request; this effectively ignores the
1374
+ authentication in the spec for a single request.
1375
+ :type _request_auth: dict, optional
1376
+ :param _content_type: force content-type for the request.
1377
+ :type _content_type: str, Optional
1378
+ :param _headers: set to override the headers for a single
1379
+ request; this effectively ignores the headers
1380
+ in the spec for a single request.
1381
+ :type _headers: dict, optional
1382
+ :param _host_index: set to override the host_index for a single
1383
+ request; this effectively ignores the host_index
1384
+ in the spec for a single request.
1385
+ :type _host_index: int, optional
1386
+ :return: Returns the result object.
1387
+ """ # noqa: E501
1388
+
1389
+ _param = self._put_organization_subscription_organizations_organization_id_subscriptions_subscription_id_put_serialize(
1390
+ organization_id=organization_id,
1391
+ subscription_id=subscription_id,
1392
+ new_organization_subscription=new_organization_subscription,
1393
+ _request_auth=_request_auth,
1394
+ _content_type=_content_type,
1395
+ _headers=_headers,
1396
+ _host_index=_host_index
1397
+ )
1398
+
1399
+ _response_types_map: Dict[str, Optional[str]] = {
1400
+ '200': "SuccessAndMessageResponse",
1401
+ '422': "HTTPValidationError",
1402
+ }
1403
+ response_data = await self.api_client.call_api(
1404
+ *_param,
1405
+ _request_timeout=_request_timeout
1406
+ )
1407
+ return response_data.response
1408
+
1409
+
1410
+ def _put_organization_subscription_organizations_organization_id_subscriptions_subscription_id_put_serialize(
1411
+ self,
1412
+ organization_id,
1413
+ subscription_id,
1414
+ new_organization_subscription,
1415
+ _request_auth,
1416
+ _content_type,
1417
+ _headers,
1418
+ _host_index,
1419
+ ) -> RequestSerialized:
1420
+
1421
+ _host = None
1422
+
1423
+ _collection_formats: Dict[str, str] = {
1424
+ }
1425
+
1426
+ _path_params: Dict[str, str] = {}
1427
+ _query_params: List[Tuple[str, str]] = []
1428
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1429
+ _form_params: List[Tuple[str, str]] = []
1430
+ _files: Dict[
1431
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1432
+ ] = {}
1433
+ _body_params: Optional[bytes] = None
1434
+
1435
+ # process the path parameters
1436
+ if organization_id is not None:
1437
+ _path_params['organization_id'] = organization_id
1438
+ if subscription_id is not None:
1439
+ _path_params['subscription_id'] = subscription_id
1440
+ # process the query parameters
1441
+ # process the header parameters
1442
+ # process the form parameters
1443
+ # process the body parameter
1444
+ if new_organization_subscription is not None:
1445
+ _body_params = new_organization_subscription
1446
+
1447
+
1448
+ # set the HTTP header `Accept`
1449
+ if 'Accept' not in _header_params:
1450
+ _header_params['Accept'] = self.api_client.select_header_accept(
1451
+ [
1452
+ 'application/json'
1453
+ ]
1454
+ )
1455
+
1456
+ # set the HTTP header `Content-Type`
1457
+ if _content_type:
1458
+ _header_params['Content-Type'] = _content_type
1459
+ else:
1460
+ _default_content_type = (
1461
+ self.api_client.select_header_content_type(
1462
+ [
1463
+ 'application/json'
1464
+ ]
1465
+ )
1466
+ )
1467
+ if _default_content_type is not None:
1468
+ _header_params['Content-Type'] = _default_content_type
1469
+
1470
+ # authentication setting
1471
+ _auth_settings: List[str] = [
1472
+ 'OpenIdConnect'
1473
+ ]
1474
+
1475
+ return self.api_client.param_serialize(
1476
+ method='PUT',
1477
+ resource_path='/organizations/{organization_id}/subscriptions/{subscription_id}',
1478
+ path_params=_path_params,
1479
+ query_params=_query_params,
1480
+ header_params=_header_params,
1481
+ body=_body_params,
1482
+ post_params=_form_params,
1483
+ files=_files,
1484
+ auth_settings=_auth_settings,
1485
+ collection_formats=_collection_formats,
1486
+ _host=_host,
1487
+ _request_auth=_request_auth
1488
+ )
1489
+
1490
+