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,168 @@
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 json
17
+ import pprint
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
19
+ from typing import Any, List, Optional
20
+ from audithub_sdk.models.file_thread_subject import FileThreadSubject
21
+ from audithub_sdk.models.finding_thread_subject import FindingThreadSubject
22
+ from audithub_sdk.models.issue_thread_subject import IssueThreadSubject
23
+ from audithub_sdk.models.project_thread_subject import ProjectThreadSubject
24
+ from pydantic import StrictStr, Field
25
+ from typing import Union, List, Set, Optional, Dict
26
+ from typing_extensions import Literal, Self
27
+
28
+ SUBJECT_ONE_OF_SCHEMAS = ["FileThreadSubject", "FindingThreadSubject", "IssueThreadSubject", "ProjectThreadSubject"]
29
+
30
+ class Subject(BaseModel):
31
+ """
32
+ Subject
33
+ """
34
+ # data type: FileThreadSubject
35
+ oneof_schema_1_validator: Optional[FileThreadSubject] = None
36
+ # data type: FindingThreadSubject
37
+ oneof_schema_2_validator: Optional[FindingThreadSubject] = None
38
+ # data type: IssueThreadSubject
39
+ oneof_schema_3_validator: Optional[IssueThreadSubject] = None
40
+ # data type: ProjectThreadSubject
41
+ oneof_schema_4_validator: Optional[ProjectThreadSubject] = None
42
+ actual_instance: Optional[Union[FileThreadSubject, FindingThreadSubject, IssueThreadSubject, ProjectThreadSubject]] = None
43
+ one_of_schemas: Set[str] = { "FileThreadSubject", "FindingThreadSubject", "IssueThreadSubject", "ProjectThreadSubject" }
44
+
45
+ model_config = ConfigDict(
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ discriminator_value_class_map: Dict[str, str] = {
52
+ }
53
+
54
+ def __init__(self, *args, **kwargs) -> None:
55
+ if args:
56
+ if len(args) > 1:
57
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
58
+ if kwargs:
59
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
60
+ super().__init__(actual_instance=args[0])
61
+ else:
62
+ super().__init__(**kwargs)
63
+
64
+ @field_validator('actual_instance')
65
+ def actual_instance_must_validate_oneof(cls, v):
66
+ instance = Subject.model_construct()
67
+ error_messages = []
68
+ match = 0
69
+ # validate data type: FileThreadSubject
70
+ if not isinstance(v, FileThreadSubject):
71
+ error_messages.append(f"Error! Input type `{type(v)}` is not `FileThreadSubject`")
72
+ else:
73
+ match += 1
74
+ # validate data type: FindingThreadSubject
75
+ if not isinstance(v, FindingThreadSubject):
76
+ error_messages.append(f"Error! Input type `{type(v)}` is not `FindingThreadSubject`")
77
+ else:
78
+ match += 1
79
+ # validate data type: IssueThreadSubject
80
+ if not isinstance(v, IssueThreadSubject):
81
+ error_messages.append(f"Error! Input type `{type(v)}` is not `IssueThreadSubject`")
82
+ else:
83
+ match += 1
84
+ # validate data type: ProjectThreadSubject
85
+ if not isinstance(v, ProjectThreadSubject):
86
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ProjectThreadSubject`")
87
+ else:
88
+ match += 1
89
+ if match > 1:
90
+ # more than 1 match
91
+ raise ValueError("Multiple matches found when setting `actual_instance` in Subject with oneOf schemas: FileThreadSubject, FindingThreadSubject, IssueThreadSubject, ProjectThreadSubject. Details: " + ", ".join(error_messages))
92
+ elif match == 0:
93
+ # no match
94
+ raise ValueError("No match found when setting `actual_instance` in Subject with oneOf schemas: FileThreadSubject, FindingThreadSubject, IssueThreadSubject, ProjectThreadSubject. Details: " + ", ".join(error_messages))
95
+ else:
96
+ return v
97
+
98
+ @classmethod
99
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
100
+ return cls.from_json(json.dumps(obj))
101
+
102
+ @classmethod
103
+ def from_json(cls, json_str: str) -> Self:
104
+ """Returns the object represented by the json string"""
105
+ instance = cls.model_construct()
106
+ error_messages = []
107
+ match = 0
108
+
109
+ # deserialize data into FileThreadSubject
110
+ try:
111
+ instance.actual_instance = FileThreadSubject.from_json(json_str)
112
+ match += 1
113
+ except (ValidationError, ValueError) as e:
114
+ error_messages.append(str(e))
115
+ # deserialize data into FindingThreadSubject
116
+ try:
117
+ instance.actual_instance = FindingThreadSubject.from_json(json_str)
118
+ match += 1
119
+ except (ValidationError, ValueError) as e:
120
+ error_messages.append(str(e))
121
+ # deserialize data into IssueThreadSubject
122
+ try:
123
+ instance.actual_instance = IssueThreadSubject.from_json(json_str)
124
+ match += 1
125
+ except (ValidationError, ValueError) as e:
126
+ error_messages.append(str(e))
127
+ # deserialize data into ProjectThreadSubject
128
+ try:
129
+ instance.actual_instance = ProjectThreadSubject.from_json(json_str)
130
+ match += 1
131
+ except (ValidationError, ValueError) as e:
132
+ error_messages.append(str(e))
133
+
134
+ if match > 1:
135
+ # more than 1 match
136
+ raise ValueError("Multiple matches found when deserializing the JSON string into Subject with oneOf schemas: FileThreadSubject, FindingThreadSubject, IssueThreadSubject, ProjectThreadSubject. Details: " + ", ".join(error_messages))
137
+ elif match == 0:
138
+ # no match
139
+ raise ValueError("No match found when deserializing the JSON string into Subject with oneOf schemas: FileThreadSubject, FindingThreadSubject, IssueThreadSubject, ProjectThreadSubject. Details: " + ", ".join(error_messages))
140
+ else:
141
+ return instance
142
+
143
+ def to_json(self) -> str:
144
+ """Returns the JSON representation of the actual instance"""
145
+ if self.actual_instance is None:
146
+ return "null"
147
+
148
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
149
+ return self.actual_instance.to_json()
150
+ else:
151
+ return json.dumps(self.actual_instance)
152
+
153
+ def to_dict(self) -> Optional[Union[Dict[str, Any], FileThreadSubject, FindingThreadSubject, IssueThreadSubject, ProjectThreadSubject]]:
154
+ """Returns the dict representation of the actual instance"""
155
+ if self.actual_instance is None:
156
+ return None
157
+
158
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
159
+ return self.actual_instance.to_dict()
160
+ else:
161
+ # primitive type
162
+ return self.actual_instance
163
+
164
+ def to_str(self) -> str:
165
+ """Returns the string representation of the actual instance"""
166
+ return pprint.pformat(self.model_dump())
167
+
168
+
@@ -0,0 +1,93 @@
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, Field, StrictBool, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class SuccessAndMessageResponse(BaseModel):
26
+ """
27
+ SuccessAndMessageResponse
28
+ """ # noqa: E501
29
+ success: StrictBool
30
+ message: StrictStr
31
+ data: Optional[Dict[str, Any]] = None
32
+ notices: Optional[List[StrictStr]] = Field(default=None, description="A list of notices generated by the operation")
33
+ __properties: ClassVar[List[str]] = ["success", "message", "data", "notices"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of SuccessAndMessageResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of SuccessAndMessageResponse from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "success": obj.get("success"),
87
+ "message": obj.get("message"),
88
+ "data": obj.get("data"),
89
+ "notices": obj.get("notices")
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,184 @@
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, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from audithub_sdk.models.artifact import Artifact
24
+ from audithub_sdk.models.task_step import TaskStep
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class Task(BaseModel):
29
+ """
30
+ Task
31
+ """ # noqa: E501
32
+ id: StrictInt
33
+ name: Optional[StrictStr] = None
34
+ tool_name: StrictStr
35
+ tool_version: StrictStr
36
+ tool_parameters: Optional[StrictStr] = None
37
+ tool_extra: Optional[StrictStr] = None
38
+ version_id: StrictInt
39
+ steps: Optional[List[TaskStep]] = None
40
+ status: StrictStr
41
+ info_text: Optional[StrictStr] = None
42
+ created_at: datetime
43
+ started_at: Optional[datetime] = None
44
+ finished_at: Optional[datetime] = None
45
+ artifacts: Optional[List[Artifact]] = None
46
+ findings_counters: Optional[Dict[str, StrictInt]] = None
47
+ __properties: ClassVar[List[str]] = ["id", "name", "tool_name", "tool_version", "tool_parameters", "tool_extra", "version_id", "steps", "status", "info_text", "created_at", "started_at", "finished_at", "artifacts", "findings_counters"]
48
+
49
+ @field_validator('status')
50
+ def status_validate_enum(cls, value):
51
+ """Validates the enum"""
52
+ if value not in set(['Queued', 'Running', 'Finished', 'Failed', 'Error', 'Canceled', 'Pending', 'Succeeded', 'Skipped', 'Omitted']):
53
+ raise ValueError("must be one of enum values ('Queued', 'Running', 'Finished', 'Failed', 'Error', 'Canceled', 'Pending', 'Succeeded', 'Skipped', 'Omitted')")
54
+ return value
55
+
56
+ model_config = ConfigDict(
57
+ populate_by_name=True,
58
+ validate_assignment=True,
59
+ protected_namespaces=(),
60
+ )
61
+
62
+
63
+ def to_str(self) -> str:
64
+ """Returns the string representation of the model using alias"""
65
+ return pprint.pformat(self.model_dump(by_alias=True))
66
+
67
+ def to_json(self) -> str:
68
+ """Returns the JSON representation of the model using alias"""
69
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
70
+ return json.dumps(self.to_dict())
71
+
72
+ @classmethod
73
+ def from_json(cls, json_str: str) -> Optional[Self]:
74
+ """Create an instance of Task from a JSON string"""
75
+ return cls.from_dict(json.loads(json_str))
76
+
77
+ def to_dict(self) -> Dict[str, Any]:
78
+ """Return the dictionary representation of the model using alias.
79
+
80
+ This has the following differences from calling pydantic's
81
+ `self.model_dump(by_alias=True)`:
82
+
83
+ * `None` is only added to the output dict for nullable fields that
84
+ were set at model initialization. Other fields with value `None`
85
+ are ignored.
86
+ """
87
+ excluded_fields: Set[str] = set([
88
+ ])
89
+
90
+ _dict = self.model_dump(
91
+ by_alias=True,
92
+ exclude=excluded_fields,
93
+ exclude_none=True,
94
+ )
95
+ # override the default output from pydantic by calling `to_dict()` of each item in steps (list)
96
+ _items = []
97
+ if self.steps:
98
+ for _item_steps in self.steps:
99
+ if _item_steps:
100
+ _items.append(_item_steps.to_dict())
101
+ _dict['steps'] = _items
102
+ # override the default output from pydantic by calling `to_dict()` of each item in artifacts (list)
103
+ _items = []
104
+ if self.artifacts:
105
+ for _item_artifacts in self.artifacts:
106
+ if _item_artifacts:
107
+ _items.append(_item_artifacts.to_dict())
108
+ _dict['artifacts'] = _items
109
+ # set to None if name (nullable) is None
110
+ # and model_fields_set contains the field
111
+ if self.name is None and "name" in self.model_fields_set:
112
+ _dict['name'] = None
113
+
114
+ # set to None if tool_parameters (nullable) is None
115
+ # and model_fields_set contains the field
116
+ if self.tool_parameters is None and "tool_parameters" in self.model_fields_set:
117
+ _dict['tool_parameters'] = None
118
+
119
+ # set to None if tool_extra (nullable) is None
120
+ # and model_fields_set contains the field
121
+ if self.tool_extra is None and "tool_extra" in self.model_fields_set:
122
+ _dict['tool_extra'] = None
123
+
124
+ # set to None if steps (nullable) is None
125
+ # and model_fields_set contains the field
126
+ if self.steps is None and "steps" in self.model_fields_set:
127
+ _dict['steps'] = None
128
+
129
+ # set to None if info_text (nullable) is None
130
+ # and model_fields_set contains the field
131
+ if self.info_text is None and "info_text" in self.model_fields_set:
132
+ _dict['info_text'] = None
133
+
134
+ # set to None if started_at (nullable) is None
135
+ # and model_fields_set contains the field
136
+ if self.started_at is None and "started_at" in self.model_fields_set:
137
+ _dict['started_at'] = None
138
+
139
+ # set to None if finished_at (nullable) is None
140
+ # and model_fields_set contains the field
141
+ if self.finished_at is None and "finished_at" in self.model_fields_set:
142
+ _dict['finished_at'] = None
143
+
144
+ # set to None if artifacts (nullable) is None
145
+ # and model_fields_set contains the field
146
+ if self.artifacts is None and "artifacts" in self.model_fields_set:
147
+ _dict['artifacts'] = None
148
+
149
+ # set to None if findings_counters (nullable) is None
150
+ # and model_fields_set contains the field
151
+ if self.findings_counters is None and "findings_counters" in self.model_fields_set:
152
+ _dict['findings_counters'] = None
153
+
154
+ return _dict
155
+
156
+ @classmethod
157
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
158
+ """Create an instance of Task from a dict"""
159
+ if obj is None:
160
+ return None
161
+
162
+ if not isinstance(obj, dict):
163
+ return cls.model_validate(obj)
164
+
165
+ _obj = cls.model_validate({
166
+ "id": obj.get("id"),
167
+ "name": obj.get("name"),
168
+ "tool_name": obj.get("tool_name"),
169
+ "tool_version": obj.get("tool_version"),
170
+ "tool_parameters": obj.get("tool_parameters"),
171
+ "tool_extra": obj.get("tool_extra"),
172
+ "version_id": obj.get("version_id"),
173
+ "steps": [TaskStep.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None,
174
+ "status": obj.get("status"),
175
+ "info_text": obj.get("info_text"),
176
+ "created_at": obj.get("created_at"),
177
+ "started_at": obj.get("started_at"),
178
+ "finished_at": obj.get("finished_at"),
179
+ "artifacts": [Artifact.from_dict(_item) for _item in obj["artifacts"]] if obj.get("artifacts") is not None else None,
180
+ "findings_counters": obj.get("findings_counters")
181
+ })
182
+ return _obj
183
+
184
+
@@ -0,0 +1,144 @@
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, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class TaskAdmin(BaseModel):
27
+ """
28
+ TaskAdmin
29
+ """ # noqa: E501
30
+ id: StrictInt
31
+ name: Optional[StrictStr] = None
32
+ tool_name: StrictStr
33
+ tool_version: StrictStr
34
+ status: StrictStr
35
+ info_text: Optional[StrictStr] = None
36
+ version_id: StrictInt
37
+ created_at: datetime
38
+ started_at: Optional[datetime] = None
39
+ finished_at: Optional[datetime] = None
40
+ created_by: StrictStr
41
+ deleted: StrictBool = Field(description="If true, then the task has been soft-deleted.")
42
+ findings_counters: Optional[Dict[str, StrictInt]] = None
43
+ __properties: ClassVar[List[str]] = ["id", "name", "tool_name", "tool_version", "status", "info_text", "version_id", "created_at", "started_at", "finished_at", "created_by", "deleted", "findings_counters"]
44
+
45
+ @field_validator('status')
46
+ def status_validate_enum(cls, value):
47
+ """Validates the enum"""
48
+ if value not in set(['Queued', 'Running', 'Finished', 'Failed', 'Error', 'Canceled', 'Pending', 'Succeeded', 'Skipped', 'Omitted']):
49
+ raise ValueError("must be one of enum values ('Queued', 'Running', 'Finished', 'Failed', 'Error', 'Canceled', 'Pending', 'Succeeded', 'Skipped', 'Omitted')")
50
+ return value
51
+
52
+ model_config = ConfigDict(
53
+ populate_by_name=True,
54
+ validate_assignment=True,
55
+ protected_namespaces=(),
56
+ )
57
+
58
+
59
+ def to_str(self) -> str:
60
+ """Returns the string representation of the model using alias"""
61
+ return pprint.pformat(self.model_dump(by_alias=True))
62
+
63
+ def to_json(self) -> str:
64
+ """Returns the JSON representation of the model using alias"""
65
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
66
+ return json.dumps(self.to_dict())
67
+
68
+ @classmethod
69
+ def from_json(cls, json_str: str) -> Optional[Self]:
70
+ """Create an instance of TaskAdmin from a JSON string"""
71
+ return cls.from_dict(json.loads(json_str))
72
+
73
+ def to_dict(self) -> Dict[str, Any]:
74
+ """Return the dictionary representation of the model using alias.
75
+
76
+ This has the following differences from calling pydantic's
77
+ `self.model_dump(by_alias=True)`:
78
+
79
+ * `None` is only added to the output dict for nullable fields that
80
+ were set at model initialization. Other fields with value `None`
81
+ are ignored.
82
+ """
83
+ excluded_fields: Set[str] = set([
84
+ ])
85
+
86
+ _dict = self.model_dump(
87
+ by_alias=True,
88
+ exclude=excluded_fields,
89
+ exclude_none=True,
90
+ )
91
+ # set to None if name (nullable) is None
92
+ # and model_fields_set contains the field
93
+ if self.name is None and "name" in self.model_fields_set:
94
+ _dict['name'] = None
95
+
96
+ # set to None if info_text (nullable) is None
97
+ # and model_fields_set contains the field
98
+ if self.info_text is None and "info_text" in self.model_fields_set:
99
+ _dict['info_text'] = None
100
+
101
+ # set to None if started_at (nullable) is None
102
+ # and model_fields_set contains the field
103
+ if self.started_at is None and "started_at" in self.model_fields_set:
104
+ _dict['started_at'] = None
105
+
106
+ # set to None if finished_at (nullable) is None
107
+ # and model_fields_set contains the field
108
+ if self.finished_at is None and "finished_at" in self.model_fields_set:
109
+ _dict['finished_at'] = None
110
+
111
+ # set to None if findings_counters (nullable) is None
112
+ # and model_fields_set contains the field
113
+ if self.findings_counters is None and "findings_counters" in self.model_fields_set:
114
+ _dict['findings_counters'] = None
115
+
116
+ return _dict
117
+
118
+ @classmethod
119
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
120
+ """Create an instance of TaskAdmin from a dict"""
121
+ if obj is None:
122
+ return None
123
+
124
+ if not isinstance(obj, dict):
125
+ return cls.model_validate(obj)
126
+
127
+ _obj = cls.model_validate({
128
+ "id": obj.get("id"),
129
+ "name": obj.get("name"),
130
+ "tool_name": obj.get("tool_name"),
131
+ "tool_version": obj.get("tool_version"),
132
+ "status": obj.get("status"),
133
+ "info_text": obj.get("info_text"),
134
+ "version_id": obj.get("version_id"),
135
+ "created_at": obj.get("created_at"),
136
+ "started_at": obj.get("started_at"),
137
+ "finished_at": obj.get("finished_at"),
138
+ "created_by": obj.get("created_by"),
139
+ "deleted": obj.get("deleted"),
140
+ "findings_counters": obj.get("findings_counters")
141
+ })
142
+ return _obj
143
+
144
+
@@ -0,0 +1,89 @@
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, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class TaskCreation(BaseModel):
26
+ """
27
+ TaskCreation
28
+ """ # noqa: E501
29
+ task_id: StrictInt
30
+ message: StrictStr
31
+ __properties: ClassVar[List[str]] = ["task_id", "message"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of TaskCreation from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of TaskCreation from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "task_id": obj.get("task_id"),
85
+ "message": obj.get("message")
86
+ })
87
+ return _obj
88
+
89
+