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,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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from audithub_sdk.models.issue_resolution import IssueResolution
24
+ from audithub_sdk.models.source_reference import SourceReference
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class Issue(BaseModel):
29
+ """
30
+ Issue
31
+ """ # noqa: E501
32
+ id: StrictInt = Field(description="Issue unique id.")
33
+ gh_issue_url: Optional[StrictStr]
34
+ gh_security_advisory_url: Optional[StrictStr]
35
+ status: StrictStr = Field(description="State describing the next action item for resolving this issue.")
36
+ revision_id: StrictInt = Field(description="Unique id for issue revisions. This is used to track concurrent modifications")
37
+ resolutions: Optional[List[IssueResolution]] = Field(default=None, description="The list resolution PRs or resolution commits to resolve this issue")
38
+ description: StrictStr = Field(description="The long, markdown formatted text that describes the issue in detail.")
39
+ affected_files: Annotated[List[SourceReference], Field(min_length=1)] = Field(description="A list of locations in files.")
40
+ type: List[StrictInt] = Field(description="Categorization of the issue’s root cause.")
41
+ title: StrictStr = Field(description="Title for this issue.")
42
+ likelihood: StrictInt = Field(description="Probability that the issue will be exploited..")
43
+ impact: StrictInt = Field(description="Magnitude of the effect on the protocol if the issue is exploited.")
44
+ severity: StrictInt = Field(description="The protocol risk associated to an issue, based on its likelihood and impact.")
45
+ __properties: ClassVar[List[str]] = ["id", "gh_issue_url", "gh_security_advisory_url", "status", "revision_id", "resolutions", "description", "affected_files", "type", "title", "likelihood", "impact", "severity"]
46
+
47
+ model_config = ConfigDict(
48
+ populate_by_name=True,
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+
54
+ def to_str(self) -> str:
55
+ """Returns the string representation of the model using alias"""
56
+ return pprint.pformat(self.model_dump(by_alias=True))
57
+
58
+ def to_json(self) -> str:
59
+ """Returns the JSON representation of the model using alias"""
60
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> Optional[Self]:
65
+ """Create an instance of Issue from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self) -> Dict[str, Any]:
69
+ """Return the dictionary representation of the model using alias.
70
+
71
+ This has the following differences from calling pydantic's
72
+ `self.model_dump(by_alias=True)`:
73
+
74
+ * `None` is only added to the output dict for nullable fields that
75
+ were set at model initialization. Other fields with value `None`
76
+ are ignored.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ ])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ # override the default output from pydantic by calling `to_dict()` of each item in resolutions (list)
87
+ _items = []
88
+ if self.resolutions:
89
+ for _item_resolutions in self.resolutions:
90
+ if _item_resolutions:
91
+ _items.append(_item_resolutions.to_dict())
92
+ _dict['resolutions'] = _items
93
+ # override the default output from pydantic by calling `to_dict()` of each item in affected_files (list)
94
+ _items = []
95
+ if self.affected_files:
96
+ for _item_affected_files in self.affected_files:
97
+ if _item_affected_files:
98
+ _items.append(_item_affected_files.to_dict())
99
+ _dict['affected_files'] = _items
100
+ # set to None if gh_issue_url (nullable) is None
101
+ # and model_fields_set contains the field
102
+ if self.gh_issue_url is None and "gh_issue_url" in self.model_fields_set:
103
+ _dict['gh_issue_url'] = None
104
+
105
+ # set to None if gh_security_advisory_url (nullable) is None
106
+ # and model_fields_set contains the field
107
+ if self.gh_security_advisory_url is None and "gh_security_advisory_url" in self.model_fields_set:
108
+ _dict['gh_security_advisory_url'] = None
109
+
110
+ return _dict
111
+
112
+ @classmethod
113
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114
+ """Create an instance of Issue from a dict"""
115
+ if obj is None:
116
+ return None
117
+
118
+ if not isinstance(obj, dict):
119
+ return cls.model_validate(obj)
120
+
121
+ _obj = cls.model_validate({
122
+ "id": obj.get("id"),
123
+ "gh_issue_url": obj.get("gh_issue_url"),
124
+ "gh_security_advisory_url": obj.get("gh_security_advisory_url"),
125
+ "status": obj.get("status"),
126
+ "revision_id": obj.get("revision_id"),
127
+ "resolutions": [IssueResolution.from_dict(_item) for _item in obj["resolutions"]] if obj.get("resolutions") is not None else None,
128
+ "description": obj.get("description"),
129
+ "affected_files": [SourceReference.from_dict(_item) for _item in obj["affected_files"]] if obj.get("affected_files") is not None else None,
130
+ "type": obj.get("type"),
131
+ "title": obj.get("title"),
132
+ "likelihood": obj.get("likelihood"),
133
+ "impact": obj.get("impact"),
134
+ "severity": obj.get("severity")
135
+ })
136
+ return _obj
137
+
138
+
@@ -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, StrictInt
21
+ from typing import Any, ClassVar, Dict, List
22
+ from audithub_sdk.models.extra_function_arguments import ExtraFunctionArguments
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class IssueAction(BaseModel):
27
+ """
28
+ IssueAction
29
+ """ # noqa: E501
30
+ function_id: StrictInt
31
+ extra: ExtraFunctionArguments
32
+ __properties: ClassVar[List[str]] = ["function_id", "extra"]
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 IssueAction 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 extra
74
+ if self.extra:
75
+ _dict['extra'] = self.extra.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 IssueAction 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
+ "function_id": obj.get("function_id"),
89
+ "extra": ExtraFunctionArguments.from_dict(obj["extra"]) if obj.get("extra") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,88 @@
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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class IssueBatchAnnounce(BaseModel):
27
+ """
28
+ IssueBatchAnnounce
29
+ """ # noqa: E501
30
+ issue_ids: Annotated[List[StrictInt], Field(min_length=1)] = Field(description="A list of issue ids, which are in the appropriate state to be shared with developers.")
31
+ __properties: ClassVar[List[str]] = ["issue_ids"]
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 IssueBatchAnnounce 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 IssueBatchAnnounce 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
+ "issue_ids": obj.get("issue_ids")
85
+ })
86
+ return _obj
87
+
88
+
@@ -0,0 +1,167 @@
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
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from audithub_sdk.models.finding_reference import FindingReference
25
+ from audithub_sdk.models.issue_resolution import IssueResolution
26
+ from audithub_sdk.models.source_reference import SourceReference
27
+ from typing import Optional, Set
28
+ from typing_extensions import Self
29
+
30
+ class IssueComplete(BaseModel):
31
+ """
32
+ IssueComplete
33
+ """ # noqa: E501
34
+ id: StrictInt = Field(description="Issue unique id.")
35
+ gh_issue_url: Optional[StrictStr]
36
+ gh_security_advisory_url: Optional[StrictStr]
37
+ created_at: datetime = Field(description="The time at which the issue was created.")
38
+ last_updated_at: datetime = Field(description="The time at which the issue was last updated.")
39
+ created_by: StrictStr = Field(description="The user that created the issue.")
40
+ last_updated_by: StrictStr = Field(description="The user that last updated the issue.")
41
+ externally_shared: StrictBool = Field(description="If the issue has been shared in the project public thread.")
42
+ status: StrictStr = Field(description="State describing the next action item for resolving this issue.")
43
+ revision_id: StrictInt = Field(description="Unique id for issue revisions. This is used to track concurrent modifications")
44
+ resolutions: Optional[List[IssueResolution]] = Field(default=None, description="The list resolution PRs or resolution commits to resolve this issue")
45
+ promoted_findings: List[FindingReference] = Field(description="Tool findings related to this issue.")
46
+ candidate_for_tool: List[StrictInt] = Field(description="If one or more of our tools would be a good candidate for finding this issue.")
47
+ raised_by: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="The user that raised the issue. Allows for a potentially different user than the one that inputs it.")
48
+ poc_author: List[StrictStr] = Field(description="AuditHub user that created the PoC.")
49
+ document_authors: List[StrictStr] = Field(description="The list of auditors that authored the document for this issue.")
50
+ description: StrictStr = Field(description="The long, markdown formatted text that describes the issue in detail.")
51
+ affected_files: Annotated[List[SourceReference], Field(min_length=1)] = Field(description="A list of locations in files.")
52
+ type: List[StrictInt] = Field(description="Categorization of the issue’s root cause.")
53
+ title: StrictStr = Field(description="Title for this issue.")
54
+ likelihood: StrictInt = Field(description="Probability that the issue will be exploited..")
55
+ impact: StrictInt = Field(description="Magnitude of the effect on the protocol if the issue is exploited.")
56
+ severity: StrictInt = Field(description="The protocol risk associated to an issue, based on its likelihood and impact.")
57
+ __properties: ClassVar[List[str]] = ["id", "gh_issue_url", "gh_security_advisory_url", "created_at", "last_updated_at", "created_by", "last_updated_by", "externally_shared", "status", "revision_id", "resolutions", "promoted_findings", "candidate_for_tool", "raised_by", "poc_author", "document_authors", "description", "affected_files", "type", "title", "likelihood", "impact", "severity"]
58
+
59
+ model_config = ConfigDict(
60
+ populate_by_name=True,
61
+ validate_assignment=True,
62
+ protected_namespaces=(),
63
+ )
64
+
65
+
66
+ def to_str(self) -> str:
67
+ """Returns the string representation of the model using alias"""
68
+ return pprint.pformat(self.model_dump(by_alias=True))
69
+
70
+ def to_json(self) -> str:
71
+ """Returns the JSON representation of the model using alias"""
72
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
73
+ return json.dumps(self.to_dict())
74
+
75
+ @classmethod
76
+ def from_json(cls, json_str: str) -> Optional[Self]:
77
+ """Create an instance of IssueComplete from a JSON string"""
78
+ return cls.from_dict(json.loads(json_str))
79
+
80
+ def to_dict(self) -> Dict[str, Any]:
81
+ """Return the dictionary representation of the model using alias.
82
+
83
+ This has the following differences from calling pydantic's
84
+ `self.model_dump(by_alias=True)`:
85
+
86
+ * `None` is only added to the output dict for nullable fields that
87
+ were set at model initialization. Other fields with value `None`
88
+ are ignored.
89
+ """
90
+ excluded_fields: Set[str] = set([
91
+ ])
92
+
93
+ _dict = self.model_dump(
94
+ by_alias=True,
95
+ exclude=excluded_fields,
96
+ exclude_none=True,
97
+ )
98
+ # override the default output from pydantic by calling `to_dict()` of each item in resolutions (list)
99
+ _items = []
100
+ if self.resolutions:
101
+ for _item_resolutions in self.resolutions:
102
+ if _item_resolutions:
103
+ _items.append(_item_resolutions.to_dict())
104
+ _dict['resolutions'] = _items
105
+ # override the default output from pydantic by calling `to_dict()` of each item in promoted_findings (list)
106
+ _items = []
107
+ if self.promoted_findings:
108
+ for _item_promoted_findings in self.promoted_findings:
109
+ if _item_promoted_findings:
110
+ _items.append(_item_promoted_findings.to_dict())
111
+ _dict['promoted_findings'] = _items
112
+ # override the default output from pydantic by calling `to_dict()` of each item in affected_files (list)
113
+ _items = []
114
+ if self.affected_files:
115
+ for _item_affected_files in self.affected_files:
116
+ if _item_affected_files:
117
+ _items.append(_item_affected_files.to_dict())
118
+ _dict['affected_files'] = _items
119
+ # set to None if gh_issue_url (nullable) is None
120
+ # and model_fields_set contains the field
121
+ if self.gh_issue_url is None and "gh_issue_url" in self.model_fields_set:
122
+ _dict['gh_issue_url'] = None
123
+
124
+ # set to None if gh_security_advisory_url (nullable) is None
125
+ # and model_fields_set contains the field
126
+ if self.gh_security_advisory_url is None and "gh_security_advisory_url" in self.model_fields_set:
127
+ _dict['gh_security_advisory_url'] = None
128
+
129
+ return _dict
130
+
131
+ @classmethod
132
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
133
+ """Create an instance of IssueComplete from a dict"""
134
+ if obj is None:
135
+ return None
136
+
137
+ if not isinstance(obj, dict):
138
+ return cls.model_validate(obj)
139
+
140
+ _obj = cls.model_validate({
141
+ "id": obj.get("id"),
142
+ "gh_issue_url": obj.get("gh_issue_url"),
143
+ "gh_security_advisory_url": obj.get("gh_security_advisory_url"),
144
+ "created_at": obj.get("created_at"),
145
+ "last_updated_at": obj.get("last_updated_at"),
146
+ "created_by": obj.get("created_by"),
147
+ "last_updated_by": obj.get("last_updated_by"),
148
+ "externally_shared": obj.get("externally_shared"),
149
+ "status": obj.get("status"),
150
+ "revision_id": obj.get("revision_id"),
151
+ "resolutions": [IssueResolution.from_dict(_item) for _item in obj["resolutions"]] if obj.get("resolutions") is not None else None,
152
+ "promoted_findings": [FindingReference.from_dict(_item) for _item in obj["promoted_findings"]] if obj.get("promoted_findings") is not None else None,
153
+ "candidate_for_tool": obj.get("candidate_for_tool"),
154
+ "raised_by": obj.get("raised_by"),
155
+ "poc_author": obj.get("poc_author"),
156
+ "document_authors": obj.get("document_authors"),
157
+ "description": obj.get("description"),
158
+ "affected_files": [SourceReference.from_dict(_item) for _item in obj["affected_files"]] if obj.get("affected_files") is not None else None,
159
+ "type": obj.get("type"),
160
+ "title": obj.get("title"),
161
+ "likelihood": obj.get("likelihood"),
162
+ "impact": obj.get("impact"),
163
+ "severity": obj.get("severity")
164
+ })
165
+ return _obj
166
+
167
+
@@ -0,0 +1,125 @@
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.issue_impact import IssueImpact
23
+ from audithub_sdk.models.issue_likelihood import IssueLikelihood
24
+ from audithub_sdk.models.issue_severity import IssueSeverity
25
+ from audithub_sdk.models.issue_status import IssueStatus
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class IssueConfigurationOptions(BaseModel):
30
+ """
31
+ IssueConfigurationOptions
32
+ """ # noqa: E501
33
+ likelihood: List[IssueLikelihood]
34
+ impact: List[IssueImpact]
35
+ severity: List[IssueSeverity]
36
+ status: List[IssueStatus]
37
+ __properties: ClassVar[List[str]] = ["likelihood", "impact", "severity", "status"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of IssueConfigurationOptions from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of each item in likelihood (list)
79
+ _items = []
80
+ if self.likelihood:
81
+ for _item_likelihood in self.likelihood:
82
+ if _item_likelihood:
83
+ _items.append(_item_likelihood.to_dict())
84
+ _dict['likelihood'] = _items
85
+ # override the default output from pydantic by calling `to_dict()` of each item in impact (list)
86
+ _items = []
87
+ if self.impact:
88
+ for _item_impact in self.impact:
89
+ if _item_impact:
90
+ _items.append(_item_impact.to_dict())
91
+ _dict['impact'] = _items
92
+ # override the default output from pydantic by calling `to_dict()` of each item in severity (list)
93
+ _items = []
94
+ if self.severity:
95
+ for _item_severity in self.severity:
96
+ if _item_severity:
97
+ _items.append(_item_severity.to_dict())
98
+ _dict['severity'] = _items
99
+ # override the default output from pydantic by calling `to_dict()` of each item in status (list)
100
+ _items = []
101
+ if self.status:
102
+ for _item_status in self.status:
103
+ if _item_status:
104
+ _items.append(_item_status.to_dict())
105
+ _dict['status'] = _items
106
+ return _dict
107
+
108
+ @classmethod
109
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
110
+ """Create an instance of IssueConfigurationOptions from a dict"""
111
+ if obj is None:
112
+ return None
113
+
114
+ if not isinstance(obj, dict):
115
+ return cls.model_validate(obj)
116
+
117
+ _obj = cls.model_validate({
118
+ "likelihood": [IssueLikelihood.from_dict(_item) for _item in obj["likelihood"]] if obj.get("likelihood") is not None else None,
119
+ "impact": [IssueImpact.from_dict(_item) for _item in obj["impact"]] if obj.get("impact") is not None else None,
120
+ "severity": [IssueSeverity.from_dict(_item) for _item in obj["severity"]] if obj.get("severity") is not None else None,
121
+ "status": [IssueStatus.from_dict(_item) for _item in obj["status"]] if obj.get("status") is not None else None
122
+ })
123
+ return _obj
124
+
125
+