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,99 @@
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, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CustomDetectorFromOrganizationLibrary(BaseModel):
26
+ """
27
+ CustomDetectorFromOrganizationLibrary
28
+ """ # noqa: E501
29
+ type: Optional[StrictStr] = 'orglib'
30
+ id: StrictInt = Field(description="The id of the Custom Detector from the organization's library.")
31
+ __properties: ClassVar[List[str]] = ["type", "id"]
32
+
33
+ @field_validator('type')
34
+ def type_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value is None:
37
+ return value
38
+
39
+ if value not in set(['orglib']):
40
+ raise ValueError("must be one of enum values ('orglib')")
41
+ return value
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of CustomDetectorFromOrganizationLibrary from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of CustomDetectorFromOrganizationLibrary from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "type": obj.get("type") if obj.get("type") is not None else 'orglib',
95
+ "id": obj.get("id")
96
+ })
97
+ return _obj
98
+
99
+
@@ -0,0 +1,108 @@
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, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CustomDetectorFromStandardLibrary(BaseModel):
26
+ """
27
+ CustomDetectorFromStandardLibrary
28
+ """ # noqa: E501
29
+ type: Optional[StrictStr] = 'stdlib'
30
+ library_version: Optional[StrictStr] = None
31
+ category: StrictStr
32
+ name: StrictStr
33
+ __properties: ClassVar[List[str]] = ["type", "library_version", "category", "name"]
34
+
35
+ @field_validator('type')
36
+ def type_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value is None:
39
+ return value
40
+
41
+ if value not in set(['stdlib']):
42
+ raise ValueError("must be one of enum values ('stdlib')")
43
+ return value
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of CustomDetectorFromStandardLibrary from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ # set to None if library_version (nullable) is None
85
+ # and model_fields_set contains the field
86
+ if self.library_version is None and "library_version" in self.model_fields_set:
87
+ _dict['library_version'] = None
88
+
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of CustomDetectorFromStandardLibrary from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate({
101
+ "type": obj.get("type") if obj.get("type") is not None else 'stdlib',
102
+ "library_version": obj.get("library_version"),
103
+ "category": obj.get("category"),
104
+ "name": obj.get("name")
105
+ })
106
+ return _obj
107
+
108
+
@@ -0,0 +1,99 @@
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, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CustomDetectorFromVersion(BaseModel):
26
+ """
27
+ CustomDetectorFromVersion
28
+ """ # noqa: E501
29
+ type: Optional[StrictStr] = 'version'
30
+ relative_path: StrictStr = Field(description="Relative path from the version archive's root")
31
+ __properties: ClassVar[List[str]] = ["type", "relative_path"]
32
+
33
+ @field_validator('type')
34
+ def type_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value is None:
37
+ return value
38
+
39
+ if value not in set(['version']):
40
+ raise ValueError("must be one of enum values ('version')")
41
+ return value
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of CustomDetectorFromVersion from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of CustomDetectorFromVersion from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "type": obj.get("type") if obj.get("type") is not None else 'version',
95
+ "relative_path": obj.get("relative_path")
96
+ })
97
+ return _obj
98
+
99
+
@@ -0,0 +1,103 @@
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, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CustomDetectorWithId(BaseModel):
26
+ """
27
+ CustomDetectorWithId
28
+ """ # noqa: E501
29
+ filename: StrictStr = Field(description="The filename for this Custom Detector.")
30
+ contents: StrictStr = Field(description="The contents of this file")
31
+ encoding: Optional[StrictStr] = Field(default='plain', description="The encoding of the contents. Currently, only 'plain' is supported, which simply places the value of the contents JSON key to the file")
32
+ id: StrictInt = Field(description="The id of this Custom Detector")
33
+ __properties: ClassVar[List[str]] = ["filename", "contents", "encoding", "id"]
34
+
35
+ @field_validator('encoding')
36
+ def encoding_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value is None:
39
+ return value
40
+
41
+ if value not in set(['plain']):
42
+ raise ValueError("must be one of enum values ('plain')")
43
+ return value
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of CustomDetectorWithId from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of CustomDetectorWithId from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "filename": obj.get("filename"),
97
+ "contents": obj.get("contents"),
98
+ "encoding": obj.get("encoding") if obj.get("encoding") is not None else 'plain',
99
+ "id": obj.get("id")
100
+ })
101
+ return _obj
102
+
103
+
@@ -0,0 +1,134 @@
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
+ from inspect import getfullargspec
17
+ import json
18
+ import pprint
19
+ import re # noqa: F401
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
21
+ from typing import Optional
22
+ from audithub_sdk.models.issue import Issue
23
+ from audithub_sdk.models.issue_complete import IssueComplete
24
+ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
25
+ from typing_extensions import Literal, Self
26
+ from pydantic import Field
27
+
28
+ DATA_ANY_OF_SCHEMAS = ["Issue", "IssueComplete"]
29
+
30
+ class Data(BaseModel):
31
+ """
32
+ Data
33
+ """
34
+
35
+ # data type: Issue
36
+ anyof_schema_1_validator: Optional[Issue] = None
37
+ # data type: IssueComplete
38
+ anyof_schema_2_validator: Optional[IssueComplete] = None
39
+ if TYPE_CHECKING:
40
+ actual_instance: Optional[Union[Issue, IssueComplete]] = None
41
+ else:
42
+ actual_instance: Any = None
43
+ any_of_schemas: Set[str] = { "Issue", "IssueComplete" }
44
+
45
+ model_config = {
46
+ "validate_assignment": True,
47
+ "protected_namespaces": (),
48
+ }
49
+
50
+ def __init__(self, *args, **kwargs) -> None:
51
+ if args:
52
+ if len(args) > 1:
53
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
54
+ if kwargs:
55
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
56
+ super().__init__(actual_instance=args[0])
57
+ else:
58
+ super().__init__(**kwargs)
59
+
60
+ @field_validator('actual_instance')
61
+ def actual_instance_must_validate_anyof(cls, v):
62
+ instance = Data.model_construct()
63
+ error_messages = []
64
+ # validate data type: Issue
65
+ if not isinstance(v, Issue):
66
+ error_messages.append(f"Error! Input type `{type(v)}` is not `Issue`")
67
+ else:
68
+ return v
69
+
70
+ # validate data type: IssueComplete
71
+ if not isinstance(v, IssueComplete):
72
+ error_messages.append(f"Error! Input type `{type(v)}` is not `IssueComplete`")
73
+ else:
74
+ return v
75
+
76
+ if error_messages:
77
+ # no match
78
+ raise ValueError("No match found when setting the actual_instance in Data with anyOf schemas: Issue, IssueComplete. Details: " + ", ".join(error_messages))
79
+ else:
80
+ return v
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
84
+ return cls.from_json(json.dumps(obj))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> Self:
88
+ """Returns the object represented by the json string"""
89
+ instance = cls.model_construct()
90
+ error_messages = []
91
+ # anyof_schema_1_validator: Optional[Issue] = None
92
+ try:
93
+ instance.actual_instance = Issue.from_json(json_str)
94
+ return instance
95
+ except (ValidationError, ValueError) as e:
96
+ error_messages.append(str(e))
97
+ # anyof_schema_2_validator: Optional[IssueComplete] = None
98
+ try:
99
+ instance.actual_instance = IssueComplete.from_json(json_str)
100
+ return instance
101
+ except (ValidationError, ValueError) as e:
102
+ error_messages.append(str(e))
103
+
104
+ if error_messages:
105
+ # no match
106
+ raise ValueError("No match found when deserializing the JSON string into Data with anyOf schemas: Issue, IssueComplete. Details: " + ", ".join(error_messages))
107
+ else:
108
+ return instance
109
+
110
+ def to_json(self) -> str:
111
+ """Returns the JSON representation of the actual instance"""
112
+ if self.actual_instance is None:
113
+ return "null"
114
+
115
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
116
+ return self.actual_instance.to_json()
117
+ else:
118
+ return json.dumps(self.actual_instance)
119
+
120
+ def to_dict(self) -> Optional[Union[Dict[str, Any], Issue, IssueComplete]]:
121
+ """Returns the dict representation of the actual instance"""
122
+ if self.actual_instance is None:
123
+ return None
124
+
125
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
126
+ return self.actual_instance.to_dict()
127
+ else:
128
+ return self.actual_instance
129
+
130
+ def to_str(self) -> str:
131
+ """Returns the string representation of the actual instance"""
132
+ return pprint.pformat(self.model_dump())
133
+
134
+
@@ -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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from audithub_sdk.models.defi_vanguard_v2_parameters import DefiVanguardV2Parameters
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DefiVanguardV2Input(BaseModel):
27
+ """
28
+ DefiVanguardV2Input
29
+ """ # noqa: E501
30
+ name: Optional[StrictStr] = Field(default=None, description="An optional name for this task. If not specified, the current time in UTC will be used.")
31
+ parameters: DefiVanguardV2Parameters = Field(description="The parameters to pass to DeFi Vanguard v2")
32
+ __properties: ClassVar[List[str]] = ["name", "parameters"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of DefiVanguardV2Input from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of parameters
74
+ if self.parameters:
75
+ _dict['parameters'] = self.parameters.to_dict()
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of DefiVanguardV2Input from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "name": obj.get("name"),
89
+ "parameters": DefiVanguardV2Parameters.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None
90
+ })
91
+ return _obj
92
+
93
+