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.
- audithub_sdk/__init__.py +410 -0
- audithub_sdk/api/__init__.py +22 -0
- audithub_sdk/api/admin_api.py +6117 -0
- audithub_sdk/api/configuration_api.py +520 -0
- audithub_sdk/api/custom_detectors_org_lib_api.py +1461 -0
- audithub_sdk/api/custom_detectors_std_lib_api.py +546 -0
- audithub_sdk/api/editor_languages_api.py +1383 -0
- audithub_sdk/api/generic_api.py +1275 -0
- audithub_sdk/api/hints_org_lib_api.py +2049 -0
- audithub_sdk/api/hints_std_lib_api.py +546 -0
- audithub_sdk/api/issues_api.py +2742 -0
- audithub_sdk/api/organizations_api.py +12148 -0
- audithub_sdk/api/projects_api.py +7069 -0
- audithub_sdk/api/subscriptions_api.py +1490 -0
- audithub_sdk/api/tasks_api.py +4276 -0
- audithub_sdk/api/tools_api.py +2298 -0
- audithub_sdk/api/users_api.py +2657 -0
- audithub_sdk/api/v_specs_org_lib_api.py +1461 -0
- audithub_sdk/api/v_specs_std_lib_api.py +546 -0
- audithub_sdk/api/versions_api.py +5419 -0
- audithub_sdk/api_client.py +808 -0
- audithub_sdk/api_response.py +21 -0
- audithub_sdk/configuration.py +572 -0
- audithub_sdk/exceptions.py +218 -0
- audithub_sdk/models/__init__.py +180 -0
- audithub_sdk/models/accounting_data.py +138 -0
- audithub_sdk/models/active_organization_users.py +120 -0
- audithub_sdk/models/admin_resource_patch.py +94 -0
- audithub_sdk/models/api_blacklisted_hint.py +96 -0
- audithub_sdk/models/api_key.py +89 -0
- audithub_sdk/models/api_key_base.py +87 -0
- audithub_sdk/models/api_key_with_secret.py +91 -0
- audithub_sdk/models/application_function.py +97 -0
- audithub_sdk/models/archive_input.py +104 -0
- audithub_sdk/models/artifact.py +102 -0
- audithub_sdk/models/comment.py +121 -0
- audithub_sdk/models/comment_with_mutations.py +121 -0
- audithub_sdk/models/container_resources.py +93 -0
- audithub_sdk/models/contents_inner.py +136 -0
- audithub_sdk/models/custom_detector.py +101 -0
- audithub_sdk/models/custom_detector_from_organization_library.py +99 -0
- audithub_sdk/models/custom_detector_from_standard_library.py +108 -0
- audithub_sdk/models/custom_detector_from_version.py +99 -0
- audithub_sdk/models/custom_detector_with_id.py +103 -0
- audithub_sdk/models/data.py +134 -0
- audithub_sdk/models/defi_vanguard_v2_input.py +93 -0
- audithub_sdk/models/defi_vanguard_v2_parameters.py +132 -0
- audithub_sdk/models/directory.py +111 -0
- audithub_sdk/models/editor_language.py +99 -0
- audithub_sdk/models/editor_language_with_id.py +101 -0
- audithub_sdk/models/effective_user_access_restriction.py +94 -0
- audithub_sdk/models/env_var.py +89 -0
- audithub_sdk/models/extra_function_arguments.py +107 -0
- audithub_sdk/models/favorite_project_assignment.py +87 -0
- audithub_sdk/models/file.py +101 -0
- audithub_sdk/models/file_thread_subject.py +103 -0
- audithub_sdk/models/finding_action.py +101 -0
- audithub_sdk/models/finding_action_base.py +96 -0
- audithub_sdk/models/finding_reference.py +91 -0
- audithub_sdk/models/finding_thread_subject.py +103 -0
- audithub_sdk/models/fio_data.py +113 -0
- audithub_sdk/models/fork_network_public.py +89 -0
- audithub_sdk/models/fuzzing_blacklist_entry.py +89 -0
- audithub_sdk/models/git_input.py +113 -0
- audithub_sdk/models/hint.py +101 -0
- audithub_sdk/models/hint_ad_hoc.py +113 -0
- audithub_sdk/models/hint_from_organization_library.py +99 -0
- audithub_sdk/models/hint_from_standard_library.py +108 -0
- audithub_sdk/models/hint_from_version.py +99 -0
- audithub_sdk/models/hint_with_id.py +103 -0
- audithub_sdk/models/http_validation_error.py +95 -0
- audithub_sdk/models/id_and_message_response.py +89 -0
- audithub_sdk/models/included_user_info.py +87 -0
- audithub_sdk/models/input_info.py +134 -0
- audithub_sdk/models/invitation.py +128 -0
- audithub_sdk/models/invitation_patch.py +94 -0
- audithub_sdk/models/invited_user.py +101 -0
- audithub_sdk/models/issue.py +138 -0
- audithub_sdk/models/issue_action.py +93 -0
- audithub_sdk/models/issue_batch_announce.py +88 -0
- audithub_sdk/models/issue_complete.py +167 -0
- audithub_sdk/models/issue_configuration_options.py +125 -0
- audithub_sdk/models/issue_details.py +110 -0
- audithub_sdk/models/issue_for_list.py +118 -0
- audithub_sdk/models/issue_impact.py +89 -0
- audithub_sdk/models/issue_info_base_complete.py +126 -0
- audithub_sdk/models/issue_info_editable.py +142 -0
- audithub_sdk/models/issue_likelihood.py +89 -0
- audithub_sdk/models/issue_patch.py +103 -0
- audithub_sdk/models/issue_resolution.py +100 -0
- audithub_sdk/models/issue_severity.py +89 -0
- audithub_sdk/models/issue_state_transition_function.py +110 -0
- audithub_sdk/models/issue_status.py +91 -0
- audithub_sdk/models/issue_status_transition.py +104 -0
- audithub_sdk/models/issue_thread_subject.py +99 -0
- audithub_sdk/models/issue_type.py +91 -0
- audithub_sdk/models/issue_type_info.py +87 -0
- audithub_sdk/models/machine_info.py +109 -0
- audithub_sdk/models/model_tool_input.py +102 -0
- audithub_sdk/models/model_tool_phase_parameters.py +169 -0
- audithub_sdk/models/new_invitation.py +103 -0
- audithub_sdk/models/new_organization.py +101 -0
- audithub_sdk/models/new_organization_package.py +132 -0
- audithub_sdk/models/new_organization_subscription.py +125 -0
- audithub_sdk/models/npm_project_dependency.py +103 -0
- audithub_sdk/models/onboarding_request.py +113 -0
- audithub_sdk/models/or_ca_input.py +134 -0
- audithub_sdk/models/or_ca_parameters.py +149 -0
- audithub_sdk/models/orca_value.py +138 -0
- audithub_sdk/models/organization.py +108 -0
- audithub_sdk/models/organization_access_restriction.py +101 -0
- audithub_sdk/models/organization_active_quota.py +104 -0
- audithub_sdk/models/organization_admin.py +110 -0
- audithub_sdk/models/organization_consumption.py +104 -0
- audithub_sdk/models/organization_quota.py +96 -0
- audithub_sdk/models/organization_subscription.py +135 -0
- audithub_sdk/models/package_data.py +140 -0
- audithub_sdk/models/package_subscription.py +103 -0
- audithub_sdk/models/patch_user.py +108 -0
- audithub_sdk/models/pending_finding_actions.py +99 -0
- audithub_sdk/models/picus_input.py +93 -0
- audithub_sdk/models/picus_parameters.py +111 -0
- audithub_sdk/models/picus_v2_input.py +93 -0
- audithub_sdk/models/picus_v2_parameters.py +195 -0
- audithub_sdk/models/project.py +200 -0
- audithub_sdk/models/project_admin.py +206 -0
- audithub_sdk/models/project_data.py +97 -0
- audithub_sdk/models/project_dependency.py +103 -0
- audithub_sdk/models/project_git_hub_link.py +87 -0
- audithub_sdk/models/project_info_input.py +186 -0
- audithub_sdk/models/project_info_output.py +186 -0
- audithub_sdk/models/project_thread_subject.py +97 -0
- audithub_sdk/models/project_update_response.py +93 -0
- audithub_sdk/models/psa.py +96 -0
- audithub_sdk/models/psa_message.py +94 -0
- audithub_sdk/models/public_configuration.py +216 -0
- audithub_sdk/models/put_user.py +91 -0
- audithub_sdk/models/registered_user.py +94 -0
- audithub_sdk/models/resource_patch.py +94 -0
- audithub_sdk/models/resources.py +87 -0
- 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
- 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
- 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
- audithub_sdk/models/security_tool.py +89 -0
- audithub_sdk/models/self_onboard_request.py +94 -0
- audithub_sdk/models/source_reference.py +103 -0
- audithub_sdk/models/step_definition.py +91 -0
- audithub_sdk/models/step_resources.py +103 -0
- audithub_sdk/models/subject.py +168 -0
- audithub_sdk/models/success_and_message_response.py +93 -0
- audithub_sdk/models/task.py +184 -0
- audithub_sdk/models/task_admin.py +144 -0
- audithub_sdk/models/task_creation.py +89 -0
- audithub_sdk/models/task_fio_data.py +97 -0
- audithub_sdk/models/task_patch.py +94 -0
- audithub_sdk/models/task_resources.py +103 -0
- audithub_sdk/models/task_status.py +94 -0
- audithub_sdk/models/task_step.py +145 -0
- audithub_sdk/models/temp_version.py +93 -0
- audithub_sdk/models/thread.py +146 -0
- audithub_sdk/models/thread_comment.py +87 -0
- audithub_sdk/models/thread_patch.py +101 -0
- audithub_sdk/models/user.py +106 -0
- audithub_sdk/models/user_access_restriction.py +108 -0
- audithub_sdk/models/user_for_admin.py +108 -0
- audithub_sdk/models/user_group.py +89 -0
- audithub_sdk/models/user_information.py +89 -0
- audithub_sdk/models/user_organization_setting.py +89 -0
- audithub_sdk/models/user_patch.py +103 -0
- audithub_sdk/models/user_project_setting.py +89 -0
- audithub_sdk/models/user_thread_setting.py +89 -0
- audithub_sdk/models/user_to_organization_assignment.py +87 -0
- audithub_sdk/models/v_spec.py +101 -0
- audithub_sdk/models/v_spec_ad_hoc.py +113 -0
- audithub_sdk/models/v_spec_from_organization_library.py +99 -0
- audithub_sdk/models/v_spec_from_standard_library.py +108 -0
- audithub_sdk/models/v_spec_from_version.py +99 -0
- audithub_sdk/models/v_spec_with_id.py +103 -0
- audithub_sdk/models/validation_error.py +108 -0
- audithub_sdk/models/vanguard_detector.py +91 -0
- audithub_sdk/models/version.py +134 -0
- audithub_sdk/models/version_admin.py +142 -0
- audithub_sdk/models/version_data.py +103 -0
- audithub_sdk/models/version_patch.py +120 -0
- audithub_sdk/models/version_resources.py +103 -0
- audithub_sdk/models/zk_vanguard_input.py +93 -0
- audithub_sdk/models/zk_vanguard_parameters.py +108 -0
- audithub_sdk/models/zk_vanguard_v2_input.py +93 -0
- audithub_sdk/models/zk_vanguard_v2_parameters.py +108 -0
- audithub_sdk/py.typed +0 -0
- audithub_sdk/rest.py +199 -0
- audithub_sdk-0.1.0.dist-info/METADATA +129 -0
- audithub_sdk-0.1.0.dist-info/RECORD +197 -0
- audithub_sdk-0.1.0.dist-info/WHEEL +5 -0
- audithub_sdk-0.1.0.dist-info/top_level.txt +2 -0
- audithub_sdk_ext/__init__.py +11 -0
- audithub_sdk_ext/auth.py +207 -0
|
@@ -0,0 +1,218 @@
|
|
|
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
|
+
from typing import Any, Optional
|
|
14
|
+
from typing_extensions import Self
|
|
15
|
+
|
|
16
|
+
class OpenApiException(Exception):
|
|
17
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
21
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
22
|
+
key_type=None) -> None:
|
|
23
|
+
""" Raises an exception for TypeErrors
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
msg (str): the exception message
|
|
27
|
+
|
|
28
|
+
Keyword Args:
|
|
29
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
30
|
+
current_item
|
|
31
|
+
None if unset
|
|
32
|
+
valid_classes (tuple): the primitive classes that current item
|
|
33
|
+
should be an instance of
|
|
34
|
+
None if unset
|
|
35
|
+
key_type (bool): False if our value is a value in a dict
|
|
36
|
+
True if it is a key in a dict
|
|
37
|
+
False if our item is an item in a list
|
|
38
|
+
None if unset
|
|
39
|
+
"""
|
|
40
|
+
self.path_to_item = path_to_item
|
|
41
|
+
self.valid_classes = valid_classes
|
|
42
|
+
self.key_type = key_type
|
|
43
|
+
full_msg = msg
|
|
44
|
+
if path_to_item:
|
|
45
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
46
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
50
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
51
|
+
"""
|
|
52
|
+
Args:
|
|
53
|
+
msg (str): the exception message
|
|
54
|
+
|
|
55
|
+
Keyword Args:
|
|
56
|
+
path_to_item (list) the path to the exception in the
|
|
57
|
+
received_data dict. None if unset
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
self.path_to_item = path_to_item
|
|
61
|
+
full_msg = msg
|
|
62
|
+
if path_to_item:
|
|
63
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
64
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
68
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
69
|
+
"""
|
|
70
|
+
Raised when an attribute reference or assignment fails.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
msg (str): the exception message
|
|
74
|
+
|
|
75
|
+
Keyword Args:
|
|
76
|
+
path_to_item (None/list) the path to the exception in the
|
|
77
|
+
received_data dict
|
|
78
|
+
"""
|
|
79
|
+
self.path_to_item = path_to_item
|
|
80
|
+
full_msg = msg
|
|
81
|
+
if path_to_item:
|
|
82
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
83
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
87
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
88
|
+
"""
|
|
89
|
+
Args:
|
|
90
|
+
msg (str): the exception message
|
|
91
|
+
|
|
92
|
+
Keyword Args:
|
|
93
|
+
path_to_item (None/list) the path to the exception in the
|
|
94
|
+
received_data dict
|
|
95
|
+
"""
|
|
96
|
+
self.path_to_item = path_to_item
|
|
97
|
+
full_msg = msg
|
|
98
|
+
if path_to_item:
|
|
99
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
100
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class ApiException(OpenApiException):
|
|
104
|
+
|
|
105
|
+
def __init__(
|
|
106
|
+
self,
|
|
107
|
+
status=None,
|
|
108
|
+
reason=None,
|
|
109
|
+
http_resp=None,
|
|
110
|
+
*,
|
|
111
|
+
body: Optional[str] = None,
|
|
112
|
+
data: Optional[Any] = None,
|
|
113
|
+
) -> None:
|
|
114
|
+
self.status = status
|
|
115
|
+
self.reason = reason
|
|
116
|
+
self.body = body
|
|
117
|
+
self.data = data
|
|
118
|
+
self.headers = None
|
|
119
|
+
|
|
120
|
+
if http_resp:
|
|
121
|
+
if self.status is None:
|
|
122
|
+
self.status = http_resp.status
|
|
123
|
+
if self.reason is None:
|
|
124
|
+
self.reason = http_resp.reason
|
|
125
|
+
if self.body is None:
|
|
126
|
+
try:
|
|
127
|
+
self.body = http_resp.data.decode('utf-8')
|
|
128
|
+
except Exception:
|
|
129
|
+
pass
|
|
130
|
+
self.headers = http_resp.headers
|
|
131
|
+
|
|
132
|
+
@classmethod
|
|
133
|
+
def from_response(
|
|
134
|
+
cls,
|
|
135
|
+
*,
|
|
136
|
+
http_resp,
|
|
137
|
+
body: Optional[str],
|
|
138
|
+
data: Optional[Any],
|
|
139
|
+
) -> Self:
|
|
140
|
+
if http_resp.status == 400:
|
|
141
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
142
|
+
|
|
143
|
+
if http_resp.status == 401:
|
|
144
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
145
|
+
|
|
146
|
+
if http_resp.status == 403:
|
|
147
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
148
|
+
|
|
149
|
+
if http_resp.status == 404:
|
|
150
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
151
|
+
|
|
152
|
+
# Added new conditions for 409 and 422
|
|
153
|
+
if http_resp.status == 409:
|
|
154
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
155
|
+
|
|
156
|
+
if http_resp.status == 422:
|
|
157
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
158
|
+
|
|
159
|
+
if 500 <= http_resp.status <= 599:
|
|
160
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
161
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
162
|
+
|
|
163
|
+
def __str__(self):
|
|
164
|
+
"""Custom error messages for exception"""
|
|
165
|
+
error_message = "({0})\n"\
|
|
166
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
|
167
|
+
if self.headers:
|
|
168
|
+
error_message += "HTTP response headers: {0}\n".format(
|
|
169
|
+
self.headers)
|
|
170
|
+
|
|
171
|
+
if self.body:
|
|
172
|
+
error_message += "HTTP response body: {0}\n".format(self.body)
|
|
173
|
+
|
|
174
|
+
if self.data:
|
|
175
|
+
error_message += "HTTP response data: {0}\n".format(self.data)
|
|
176
|
+
|
|
177
|
+
return error_message
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class BadRequestException(ApiException):
|
|
181
|
+
pass
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class NotFoundException(ApiException):
|
|
185
|
+
pass
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class UnauthorizedException(ApiException):
|
|
189
|
+
pass
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class ForbiddenException(ApiException):
|
|
193
|
+
pass
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class ServiceException(ApiException):
|
|
197
|
+
pass
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class ConflictException(ApiException):
|
|
201
|
+
"""Exception for HTTP 409 Conflict."""
|
|
202
|
+
pass
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class UnprocessableEntityException(ApiException):
|
|
206
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
207
|
+
pass
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def render_path(path_to_item):
|
|
211
|
+
"""Returns a string representation of a path"""
|
|
212
|
+
result = ""
|
|
213
|
+
for pth in path_to_item:
|
|
214
|
+
if isinstance(pth, int):
|
|
215
|
+
result += "[{0}]".format(pth)
|
|
216
|
+
else:
|
|
217
|
+
result += "['{0}']".format(pth)
|
|
218
|
+
return result
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
FastAPI
|
|
6
|
+
|
|
7
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: 0.1.0
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
# import models into model package
|
|
16
|
+
from audithub_sdk.models.api_blacklisted_hint import APIBlacklistedHint
|
|
17
|
+
from audithub_sdk.models.accounting_data import AccountingData
|
|
18
|
+
from audithub_sdk.models.active_organization_users import ActiveOrganizationUsers
|
|
19
|
+
from audithub_sdk.models.admin_resource_patch import AdminResourcePatch
|
|
20
|
+
from audithub_sdk.models.api_key import ApiKey
|
|
21
|
+
from audithub_sdk.models.api_key_base import ApiKeyBase
|
|
22
|
+
from audithub_sdk.models.api_key_with_secret import ApiKeyWithSecret
|
|
23
|
+
from audithub_sdk.models.application_function import ApplicationFunction
|
|
24
|
+
from audithub_sdk.models.archive_input import ArchiveInput
|
|
25
|
+
from audithub_sdk.models.artifact import Artifact
|
|
26
|
+
from audithub_sdk.models.comment import Comment
|
|
27
|
+
from audithub_sdk.models.comment_with_mutations import CommentWithMutations
|
|
28
|
+
from audithub_sdk.models.container_resources import ContainerResources
|
|
29
|
+
from audithub_sdk.models.contents_inner import ContentsInner
|
|
30
|
+
from audithub_sdk.models.custom_detector import CustomDetector
|
|
31
|
+
from audithub_sdk.models.custom_detector_from_organization_library import CustomDetectorFromOrganizationLibrary
|
|
32
|
+
from audithub_sdk.models.custom_detector_from_standard_library import CustomDetectorFromStandardLibrary
|
|
33
|
+
from audithub_sdk.models.custom_detector_from_version import CustomDetectorFromVersion
|
|
34
|
+
from audithub_sdk.models.custom_detector_with_id import CustomDetectorWithId
|
|
35
|
+
from audithub_sdk.models.data import Data
|
|
36
|
+
from audithub_sdk.models.defi_vanguard_v2_input import DefiVanguardV2Input
|
|
37
|
+
from audithub_sdk.models.defi_vanguard_v2_parameters import DefiVanguardV2Parameters
|
|
38
|
+
from audithub_sdk.models.directory import Directory
|
|
39
|
+
from audithub_sdk.models.editor_language import EditorLanguage
|
|
40
|
+
from audithub_sdk.models.editor_language_with_id import EditorLanguageWithId
|
|
41
|
+
from audithub_sdk.models.effective_user_access_restriction import EffectiveUserAccessRestriction
|
|
42
|
+
from audithub_sdk.models.env_var import EnvVar
|
|
43
|
+
from audithub_sdk.models.extra_function_arguments import ExtraFunctionArguments
|
|
44
|
+
from audithub_sdk.models.fio_data import FIOData
|
|
45
|
+
from audithub_sdk.models.favorite_project_assignment import FavoriteProjectAssignment
|
|
46
|
+
from audithub_sdk.models.file import File
|
|
47
|
+
from audithub_sdk.models.file_thread_subject import FileThreadSubject
|
|
48
|
+
from audithub_sdk.models.finding_action import FindingAction
|
|
49
|
+
from audithub_sdk.models.finding_action_base import FindingActionBase
|
|
50
|
+
from audithub_sdk.models.finding_reference import FindingReference
|
|
51
|
+
from audithub_sdk.models.finding_thread_subject import FindingThreadSubject
|
|
52
|
+
from audithub_sdk.models.fork_network_public import ForkNetworkPublic
|
|
53
|
+
from audithub_sdk.models.fuzzing_blacklist_entry import FuzzingBlacklistEntry
|
|
54
|
+
from audithub_sdk.models.git_input import GitInput
|
|
55
|
+
from audithub_sdk.models.http_validation_error import HTTPValidationError
|
|
56
|
+
from audithub_sdk.models.hint import Hint
|
|
57
|
+
from audithub_sdk.models.hint_ad_hoc import HintAdHoc
|
|
58
|
+
from audithub_sdk.models.hint_from_organization_library import HintFromOrganizationLibrary
|
|
59
|
+
from audithub_sdk.models.hint_from_standard_library import HintFromStandardLibrary
|
|
60
|
+
from audithub_sdk.models.hint_from_version import HintFromVersion
|
|
61
|
+
from audithub_sdk.models.hint_with_id import HintWithId
|
|
62
|
+
from audithub_sdk.models.id_and_message_response import IdAndMessageResponse
|
|
63
|
+
from audithub_sdk.models.included_user_info import IncludedUserInfo
|
|
64
|
+
from audithub_sdk.models.input_info import InputInfo
|
|
65
|
+
from audithub_sdk.models.invitation import Invitation
|
|
66
|
+
from audithub_sdk.models.invitation_patch import InvitationPatch
|
|
67
|
+
from audithub_sdk.models.invited_user import InvitedUser
|
|
68
|
+
from audithub_sdk.models.issue import Issue
|
|
69
|
+
from audithub_sdk.models.issue_action import IssueAction
|
|
70
|
+
from audithub_sdk.models.issue_batch_announce import IssueBatchAnnounce
|
|
71
|
+
from audithub_sdk.models.issue_complete import IssueComplete
|
|
72
|
+
from audithub_sdk.models.issue_configuration_options import IssueConfigurationOptions
|
|
73
|
+
from audithub_sdk.models.issue_details import IssueDetails
|
|
74
|
+
from audithub_sdk.models.issue_for_list import IssueForList
|
|
75
|
+
from audithub_sdk.models.issue_impact import IssueImpact
|
|
76
|
+
from audithub_sdk.models.issue_info_base_complete import IssueInfoBaseComplete
|
|
77
|
+
from audithub_sdk.models.issue_info_editable import IssueInfoEditable
|
|
78
|
+
from audithub_sdk.models.issue_likelihood import IssueLikelihood
|
|
79
|
+
from audithub_sdk.models.issue_patch import IssuePatch
|
|
80
|
+
from audithub_sdk.models.issue_resolution import IssueResolution
|
|
81
|
+
from audithub_sdk.models.issue_severity import IssueSeverity
|
|
82
|
+
from audithub_sdk.models.issue_state_transition_function import IssueStateTransitionFunction
|
|
83
|
+
from audithub_sdk.models.issue_status import IssueStatus
|
|
84
|
+
from audithub_sdk.models.issue_status_transition import IssueStatusTransition
|
|
85
|
+
from audithub_sdk.models.issue_thread_subject import IssueThreadSubject
|
|
86
|
+
from audithub_sdk.models.issue_type import IssueType
|
|
87
|
+
from audithub_sdk.models.issue_type_info import IssueTypeInfo
|
|
88
|
+
from audithub_sdk.models.machine_info import MachineInfo
|
|
89
|
+
from audithub_sdk.models.model_tool_input import ModelToolInput
|
|
90
|
+
from audithub_sdk.models.model_tool_phase_parameters import ModelToolPhaseParameters
|
|
91
|
+
from audithub_sdk.models.npm_project_dependency import NPMProjectDependency
|
|
92
|
+
from audithub_sdk.models.new_invitation import NewInvitation
|
|
93
|
+
from audithub_sdk.models.new_organization import NewOrganization
|
|
94
|
+
from audithub_sdk.models.new_organization_package import NewOrganizationPackage
|
|
95
|
+
from audithub_sdk.models.new_organization_subscription import NewOrganizationSubscription
|
|
96
|
+
from audithub_sdk.models.onboarding_request import OnboardingRequest
|
|
97
|
+
from audithub_sdk.models.or_ca_input import OrCaInput
|
|
98
|
+
from audithub_sdk.models.or_ca_parameters import OrCaParameters
|
|
99
|
+
from audithub_sdk.models.orca_value import OrcaValue
|
|
100
|
+
from audithub_sdk.models.organization import Organization
|
|
101
|
+
from audithub_sdk.models.organization_access_restriction import OrganizationAccessRestriction
|
|
102
|
+
from audithub_sdk.models.organization_active_quota import OrganizationActiveQuota
|
|
103
|
+
from audithub_sdk.models.organization_admin import OrganizationAdmin
|
|
104
|
+
from audithub_sdk.models.organization_consumption import OrganizationConsumption
|
|
105
|
+
from audithub_sdk.models.organization_quota import OrganizationQuota
|
|
106
|
+
from audithub_sdk.models.organization_subscription import OrganizationSubscription
|
|
107
|
+
from audithub_sdk.models.psa import PSA
|
|
108
|
+
from audithub_sdk.models.psa_message import PSAMessage
|
|
109
|
+
from audithub_sdk.models.package_data import PackageData
|
|
110
|
+
from audithub_sdk.models.package_subscription import PackageSubscription
|
|
111
|
+
from audithub_sdk.models.patch_user import PatchUser
|
|
112
|
+
from audithub_sdk.models.pending_finding_actions import PendingFindingActions
|
|
113
|
+
from audithub_sdk.models.picus_input import PicusInput
|
|
114
|
+
from audithub_sdk.models.picus_parameters import PicusParameters
|
|
115
|
+
from audithub_sdk.models.picus_v2_input import PicusV2Input
|
|
116
|
+
from audithub_sdk.models.picus_v2_parameters import PicusV2Parameters
|
|
117
|
+
from audithub_sdk.models.project import Project
|
|
118
|
+
from audithub_sdk.models.project_admin import ProjectAdmin
|
|
119
|
+
from audithub_sdk.models.project_data import ProjectData
|
|
120
|
+
from audithub_sdk.models.project_dependency import ProjectDependency
|
|
121
|
+
from audithub_sdk.models.project_git_hub_link import ProjectGitHubLink
|
|
122
|
+
from audithub_sdk.models.project_info_input import ProjectInfoInput
|
|
123
|
+
from audithub_sdk.models.project_info_output import ProjectInfoOutput
|
|
124
|
+
from audithub_sdk.models.project_thread_subject import ProjectThreadSubject
|
|
125
|
+
from audithub_sdk.models.project_update_response import ProjectUpdateResponse
|
|
126
|
+
from audithub_sdk.models.public_configuration import PublicConfiguration
|
|
127
|
+
from audithub_sdk.models.put_user import PutUser
|
|
128
|
+
from audithub_sdk.models.registered_user import RegisteredUser
|
|
129
|
+
from audithub_sdk.models.resource_patch import ResourcePatch
|
|
130
|
+
from audithub_sdk.models.resources import Resources
|
|
131
|
+
from audithub_sdk.models.root_model_list_union_custom_detector_from_version_custom_detector_from_standard_library_custom_detector_from_organization_library_inner import RootModelListUnionCustomDetectorFromVersionCustomDetectorFromStandardLibraryCustomDetectorFromOrganizationLibraryInner
|
|
132
|
+
from audithub_sdk.models.root_model_list_union_hint_from_version_hint_from_standard_library_hint_from_organization_library_hint_ad_hoc_inner import RootModelListUnionHintFromVersionHintFromStandardLibraryHintFromOrganizationLibraryHintAdHocInner
|
|
133
|
+
from 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 import RootModelListUnionVSpecFromVersionVSpecFromStandardLibraryVSpecFromOrganizationLibraryVSpecAdHocInner
|
|
134
|
+
from audithub_sdk.models.security_tool import SecurityTool
|
|
135
|
+
from audithub_sdk.models.self_onboard_request import SelfOnboardRequest
|
|
136
|
+
from audithub_sdk.models.source_reference import SourceReference
|
|
137
|
+
from audithub_sdk.models.step_definition import StepDefinition
|
|
138
|
+
from audithub_sdk.models.step_resources import StepResources
|
|
139
|
+
from audithub_sdk.models.subject import Subject
|
|
140
|
+
from audithub_sdk.models.success_and_message_response import SuccessAndMessageResponse
|
|
141
|
+
from audithub_sdk.models.task import Task
|
|
142
|
+
from audithub_sdk.models.task_admin import TaskAdmin
|
|
143
|
+
from audithub_sdk.models.task_creation import TaskCreation
|
|
144
|
+
from audithub_sdk.models.task_fio_data import TaskFIOData
|
|
145
|
+
from audithub_sdk.models.task_patch import TaskPatch
|
|
146
|
+
from audithub_sdk.models.task_resources import TaskResources
|
|
147
|
+
from audithub_sdk.models.task_status import TaskStatus
|
|
148
|
+
from audithub_sdk.models.task_step import TaskStep
|
|
149
|
+
from audithub_sdk.models.temp_version import TempVersion
|
|
150
|
+
from audithub_sdk.models.thread import Thread
|
|
151
|
+
from audithub_sdk.models.thread_comment import ThreadComment
|
|
152
|
+
from audithub_sdk.models.thread_patch import ThreadPatch
|
|
153
|
+
from audithub_sdk.models.user import User
|
|
154
|
+
from audithub_sdk.models.user_access_restriction import UserAccessRestriction
|
|
155
|
+
from audithub_sdk.models.user_for_admin import UserForAdmin
|
|
156
|
+
from audithub_sdk.models.user_group import UserGroup
|
|
157
|
+
from audithub_sdk.models.user_information import UserInformation
|
|
158
|
+
from audithub_sdk.models.user_organization_setting import UserOrganizationSetting
|
|
159
|
+
from audithub_sdk.models.user_patch import UserPatch
|
|
160
|
+
from audithub_sdk.models.user_project_setting import UserProjectSetting
|
|
161
|
+
from audithub_sdk.models.user_thread_setting import UserThreadSetting
|
|
162
|
+
from audithub_sdk.models.user_to_organization_assignment import UserToOrganizationAssignment
|
|
163
|
+
from audithub_sdk.models.v_spec import VSpec
|
|
164
|
+
from audithub_sdk.models.v_spec_ad_hoc import VSpecAdHoc
|
|
165
|
+
from audithub_sdk.models.v_spec_from_organization_library import VSpecFromOrganizationLibrary
|
|
166
|
+
from audithub_sdk.models.v_spec_from_standard_library import VSpecFromStandardLibrary
|
|
167
|
+
from audithub_sdk.models.v_spec_from_version import VSpecFromVersion
|
|
168
|
+
from audithub_sdk.models.v_spec_with_id import VSpecWithId
|
|
169
|
+
from audithub_sdk.models.validation_error import ValidationError
|
|
170
|
+
from audithub_sdk.models.vanguard_detector import VanguardDetector
|
|
171
|
+
from audithub_sdk.models.version import Version
|
|
172
|
+
from audithub_sdk.models.version_admin import VersionAdmin
|
|
173
|
+
from audithub_sdk.models.version_data import VersionData
|
|
174
|
+
from audithub_sdk.models.version_patch import VersionPatch
|
|
175
|
+
from audithub_sdk.models.version_resources import VersionResources
|
|
176
|
+
from audithub_sdk.models.zk_vanguard_input import ZKVanguardInput
|
|
177
|
+
from audithub_sdk.models.zk_vanguard_parameters import ZKVanguardParameters
|
|
178
|
+
from audithub_sdk.models.zk_vanguard_v2_input import ZKVanguardV2Input
|
|
179
|
+
from audithub_sdk.models.zk_vanguard_v2_parameters import ZKVanguardV2Parameters
|
|
180
|
+
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FastAPI
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from audithub_sdk.models.machine_info import MachineInfo
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class AccountingData(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
AccountingData
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
step_code: Optional[StrictStr] = None
|
|
33
|
+
container_name: Optional[StrictStr] = None
|
|
34
|
+
system: StrictBool
|
|
35
|
+
created_at: datetime
|
|
36
|
+
entry_timestamp: datetime
|
|
37
|
+
entry_text: Optional[StrictStr]
|
|
38
|
+
entry_type: StrictStr
|
|
39
|
+
entry_unit: StrictStr
|
|
40
|
+
entry_value: Annotated[str, Field(strict=True)]
|
|
41
|
+
machine_info: Optional[MachineInfo] = None
|
|
42
|
+
__properties: ClassVar[List[str]] = ["step_code", "container_name", "system", "created_at", "entry_timestamp", "entry_text", "entry_type", "entry_unit", "entry_value", "machine_info"]
|
|
43
|
+
|
|
44
|
+
@field_validator('entry_value')
|
|
45
|
+
def entry_value_validate_regular_expression(cls, value):
|
|
46
|
+
"""Validates the regular expression"""
|
|
47
|
+
if not re.match(r"^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$", value):
|
|
48
|
+
raise ValueError(r"must validate the regular expression /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/")
|
|
49
|
+
return value
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
populate_by_name=True,
|
|
53
|
+
validate_assignment=True,
|
|
54
|
+
protected_namespaces=(),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def to_str(self) -> str:
|
|
59
|
+
"""Returns the string representation of the model using alias"""
|
|
60
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
61
|
+
|
|
62
|
+
def to_json(self) -> str:
|
|
63
|
+
"""Returns the JSON representation of the model using alias"""
|
|
64
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
65
|
+
return json.dumps(self.to_dict())
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
69
|
+
"""Create an instance of AccountingData from a JSON string"""
|
|
70
|
+
return cls.from_dict(json.loads(json_str))
|
|
71
|
+
|
|
72
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
73
|
+
"""Return the dictionary representation of the model using alias.
|
|
74
|
+
|
|
75
|
+
This has the following differences from calling pydantic's
|
|
76
|
+
`self.model_dump(by_alias=True)`:
|
|
77
|
+
|
|
78
|
+
* `None` is only added to the output dict for nullable fields that
|
|
79
|
+
were set at model initialization. Other fields with value `None`
|
|
80
|
+
are ignored.
|
|
81
|
+
"""
|
|
82
|
+
excluded_fields: Set[str] = set([
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
_dict = self.model_dump(
|
|
86
|
+
by_alias=True,
|
|
87
|
+
exclude=excluded_fields,
|
|
88
|
+
exclude_none=True,
|
|
89
|
+
)
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of machine_info
|
|
91
|
+
if self.machine_info:
|
|
92
|
+
_dict['machine_info'] = self.machine_info.to_dict()
|
|
93
|
+
# set to None if step_code (nullable) is None
|
|
94
|
+
# and model_fields_set contains the field
|
|
95
|
+
if self.step_code is None and "step_code" in self.model_fields_set:
|
|
96
|
+
_dict['step_code'] = None
|
|
97
|
+
|
|
98
|
+
# set to None if container_name (nullable) is None
|
|
99
|
+
# and model_fields_set contains the field
|
|
100
|
+
if self.container_name is None and "container_name" in self.model_fields_set:
|
|
101
|
+
_dict['container_name'] = None
|
|
102
|
+
|
|
103
|
+
# set to None if entry_text (nullable) is None
|
|
104
|
+
# and model_fields_set contains the field
|
|
105
|
+
if self.entry_text is None and "entry_text" in self.model_fields_set:
|
|
106
|
+
_dict['entry_text'] = None
|
|
107
|
+
|
|
108
|
+
# set to None if machine_info (nullable) is None
|
|
109
|
+
# and model_fields_set contains the field
|
|
110
|
+
if self.machine_info is None and "machine_info" in self.model_fields_set:
|
|
111
|
+
_dict['machine_info'] = None
|
|
112
|
+
|
|
113
|
+
return _dict
|
|
114
|
+
|
|
115
|
+
@classmethod
|
|
116
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
117
|
+
"""Create an instance of AccountingData from a dict"""
|
|
118
|
+
if obj is None:
|
|
119
|
+
return None
|
|
120
|
+
|
|
121
|
+
if not isinstance(obj, dict):
|
|
122
|
+
return cls.model_validate(obj)
|
|
123
|
+
|
|
124
|
+
_obj = cls.model_validate({
|
|
125
|
+
"step_code": obj.get("step_code"),
|
|
126
|
+
"container_name": obj.get("container_name"),
|
|
127
|
+
"system": obj.get("system"),
|
|
128
|
+
"created_at": obj.get("created_at"),
|
|
129
|
+
"entry_timestamp": obj.get("entry_timestamp"),
|
|
130
|
+
"entry_text": obj.get("entry_text"),
|
|
131
|
+
"entry_type": obj.get("entry_type"),
|
|
132
|
+
"entry_unit": obj.get("entry_unit"),
|
|
133
|
+
"entry_value": obj.get("entry_value"),
|
|
134
|
+
"machine_info": MachineInfo.from_dict(obj["machine_info"]) if obj.get("machine_info") is not None else None
|
|
135
|
+
})
|
|
136
|
+
return _obj
|
|
137
|
+
|
|
138
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FastAPI
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from audithub_sdk.models.included_user_info import IncludedUserInfo
|
|
23
|
+
from audithub_sdk.models.invited_user import InvitedUser
|
|
24
|
+
from audithub_sdk.models.registered_user import RegisteredUser
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class ActiveOrganizationUsers(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ActiveOrganizationUsers
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
registered: List[RegisteredUser]
|
|
33
|
+
invited: List[InvitedUser]
|
|
34
|
+
users: Dict[str, IncludedUserInfo]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["registered", "invited", "users"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of ActiveOrganizationUsers from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of each item in registered (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.registered:
|
|
79
|
+
for _item_registered in self.registered:
|
|
80
|
+
if _item_registered:
|
|
81
|
+
_items.append(_item_registered.to_dict())
|
|
82
|
+
_dict['registered'] = _items
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of each item in invited (list)
|
|
84
|
+
_items = []
|
|
85
|
+
if self.invited:
|
|
86
|
+
for _item_invited in self.invited:
|
|
87
|
+
if _item_invited:
|
|
88
|
+
_items.append(_item_invited.to_dict())
|
|
89
|
+
_dict['invited'] = _items
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of each value in users (dict)
|
|
91
|
+
_field_dict = {}
|
|
92
|
+
if self.users:
|
|
93
|
+
for _key_users in self.users:
|
|
94
|
+
if self.users[_key_users]:
|
|
95
|
+
_field_dict[_key_users] = self.users[_key_users].to_dict()
|
|
96
|
+
_dict['users'] = _field_dict
|
|
97
|
+
return _dict
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
101
|
+
"""Create an instance of ActiveOrganizationUsers from a dict"""
|
|
102
|
+
if obj is None:
|
|
103
|
+
return None
|
|
104
|
+
|
|
105
|
+
if not isinstance(obj, dict):
|
|
106
|
+
return cls.model_validate(obj)
|
|
107
|
+
|
|
108
|
+
_obj = cls.model_validate({
|
|
109
|
+
"registered": [RegisteredUser.from_dict(_item) for _item in obj["registered"]] if obj.get("registered") is not None else None,
|
|
110
|
+
"invited": [InvitedUser.from_dict(_item) for _item in obj["invited"]] if obj.get("invited") is not None else None,
|
|
111
|
+
"users": dict(
|
|
112
|
+
(_k, IncludedUserInfo.from_dict(_v))
|
|
113
|
+
for _k, _v in obj["users"].items()
|
|
114
|
+
)
|
|
115
|
+
if obj.get("users") is not None
|
|
116
|
+
else None
|
|
117
|
+
})
|
|
118
|
+
return _obj
|
|
119
|
+
|
|
120
|
+
|