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,195 @@
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, StrictBool, 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 PicusV2Parameters(BaseModel):
26
+ """
27
+ PicusV2Parameters
28
+ """ # noqa: E501
29
+ source: StrictStr
30
+ solver: Optional[StrictStr] = None
31
+ smt_file: Optional[StrictStr] = None
32
+ no_solver: Optional[StrictBool] = None
33
+ no_optimization: Optional[StrictBool] = None
34
+ no_range_analysis: Optional[StrictBool] = None
35
+ no_linear: Optional[StrictBool] = None
36
+ no_table: Optional[StrictBool] = None
37
+ no_basis: Optional[StrictBool] = None
38
+ no_poly: Optional[StrictBool] = None
39
+ solver_timeout: Optional[StrictInt] = None
40
+ time_limit: Optional[StrictInt] = None
41
+ assume_deterministic: Optional[List[StrictStr]] = None
42
+ enable_debug: Optional[StrictBool] = None
43
+ apply_rewrites: Optional[StrictBool] = None
44
+ __properties: ClassVar[List[str]] = ["source", "solver", "smt_file", "no_solver", "no_optimization", "no_range_analysis", "no_linear", "no_table", "no_basis", "no_poly", "solver_timeout", "time_limit", "assume_deterministic", "enable_debug", "apply_rewrites"]
45
+
46
+ @field_validator('solver')
47
+ def solver_validate_enum(cls, value):
48
+ """Validates the enum"""
49
+ if value is None:
50
+ return value
51
+
52
+ if value not in set(['cvc5', 'cvc5-ff-int', 'z3', 'multi-solver', 'z3bv', 'bitwuzla']):
53
+ raise ValueError("must be one of enum values ('cvc5', 'cvc5-ff-int', 'z3', 'multi-solver', 'z3bv', 'bitwuzla')")
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 PicusV2Parameters 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
+ # set to None if solver (nullable) is None
96
+ # and model_fields_set contains the field
97
+ if self.solver is None and "solver" in self.model_fields_set:
98
+ _dict['solver'] = None
99
+
100
+ # set to None if smt_file (nullable) is None
101
+ # and model_fields_set contains the field
102
+ if self.smt_file is None and "smt_file" in self.model_fields_set:
103
+ _dict['smt_file'] = None
104
+
105
+ # set to None if no_solver (nullable) is None
106
+ # and model_fields_set contains the field
107
+ if self.no_solver is None and "no_solver" in self.model_fields_set:
108
+ _dict['no_solver'] = None
109
+
110
+ # set to None if no_optimization (nullable) is None
111
+ # and model_fields_set contains the field
112
+ if self.no_optimization is None and "no_optimization" in self.model_fields_set:
113
+ _dict['no_optimization'] = None
114
+
115
+ # set to None if no_range_analysis (nullable) is None
116
+ # and model_fields_set contains the field
117
+ if self.no_range_analysis is None and "no_range_analysis" in self.model_fields_set:
118
+ _dict['no_range_analysis'] = None
119
+
120
+ # set to None if no_linear (nullable) is None
121
+ # and model_fields_set contains the field
122
+ if self.no_linear is None and "no_linear" in self.model_fields_set:
123
+ _dict['no_linear'] = None
124
+
125
+ # set to None if no_table (nullable) is None
126
+ # and model_fields_set contains the field
127
+ if self.no_table is None and "no_table" in self.model_fields_set:
128
+ _dict['no_table'] = None
129
+
130
+ # set to None if no_basis (nullable) is None
131
+ # and model_fields_set contains the field
132
+ if self.no_basis is None and "no_basis" in self.model_fields_set:
133
+ _dict['no_basis'] = None
134
+
135
+ # set to None if no_poly (nullable) is None
136
+ # and model_fields_set contains the field
137
+ if self.no_poly is None and "no_poly" in self.model_fields_set:
138
+ _dict['no_poly'] = None
139
+
140
+ # set to None if solver_timeout (nullable) is None
141
+ # and model_fields_set contains the field
142
+ if self.solver_timeout is None and "solver_timeout" in self.model_fields_set:
143
+ _dict['solver_timeout'] = None
144
+
145
+ # set to None if time_limit (nullable) is None
146
+ # and model_fields_set contains the field
147
+ if self.time_limit is None and "time_limit" in self.model_fields_set:
148
+ _dict['time_limit'] = None
149
+
150
+ # set to None if assume_deterministic (nullable) is None
151
+ # and model_fields_set contains the field
152
+ if self.assume_deterministic is None and "assume_deterministic" in self.model_fields_set:
153
+ _dict['assume_deterministic'] = None
154
+
155
+ # set to None if enable_debug (nullable) is None
156
+ # and model_fields_set contains the field
157
+ if self.enable_debug is None and "enable_debug" in self.model_fields_set:
158
+ _dict['enable_debug'] = None
159
+
160
+ # set to None if apply_rewrites (nullable) is None
161
+ # and model_fields_set contains the field
162
+ if self.apply_rewrites is None and "apply_rewrites" in self.model_fields_set:
163
+ _dict['apply_rewrites'] = None
164
+
165
+ return _dict
166
+
167
+ @classmethod
168
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
169
+ """Create an instance of PicusV2Parameters from a dict"""
170
+ if obj is None:
171
+ return None
172
+
173
+ if not isinstance(obj, dict):
174
+ return cls.model_validate(obj)
175
+
176
+ _obj = cls.model_validate({
177
+ "source": obj.get("source"),
178
+ "solver": obj.get("solver"),
179
+ "smt_file": obj.get("smt_file"),
180
+ "no_solver": obj.get("no_solver"),
181
+ "no_optimization": obj.get("no_optimization"),
182
+ "no_range_analysis": obj.get("no_range_analysis"),
183
+ "no_linear": obj.get("no_linear"),
184
+ "no_table": obj.get("no_table"),
185
+ "no_basis": obj.get("no_basis"),
186
+ "no_poly": obj.get("no_poly"),
187
+ "solver_timeout": obj.get("solver_timeout"),
188
+ "time_limit": obj.get("time_limit"),
189
+ "assume_deterministic": obj.get("assume_deterministic"),
190
+ "enable_debug": obj.get("enable_debug"),
191
+ "apply_rewrites": obj.get("apply_rewrites")
192
+ })
193
+ return _obj
194
+
195
+
@@ -0,0 +1,200 @@
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 audithub_sdk.models.env_var import EnvVar
24
+ from audithub_sdk.models.input_info import InputInfo
25
+ from audithub_sdk.models.project_dependency import ProjectDependency
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class Project(BaseModel):
30
+ """
31
+ Project
32
+ """ # noqa: E501
33
+ name: StrictStr
34
+ project_root: StrictStr = Field(description="Relative path inside archive")
35
+ env_vars: Optional[List[EnvVar]] = None
36
+ dependencies: Optional[ProjectDependency] = None
37
+ build_system: Optional[StrictStr] = None
38
+ contents: Optional[List[StrictStr]] = None
39
+ src_path: StrictStr = Field(description="The path where we can find the sources to process. This is relative path inside archive, and it must be bellow project_root.")
40
+ include_path: Optional[StrictStr] = None
41
+ specs_path: Optional[StrictStr] = None
42
+ hints_path: Optional[StrictStr] = None
43
+ deployment_script_path: Optional[StrictStr] = None
44
+ input_info: InputInfo
45
+ id: StrictInt
46
+ created_at: datetime
47
+ gh_repo: Optional[StrictStr]
48
+ is_deployed: StrictBool = Field(description="When true, there is at least on project version that is deployed.")
49
+ __properties: ClassVar[List[str]] = ["name", "project_root", "env_vars", "dependencies", "build_system", "contents", "src_path", "include_path", "specs_path", "hints_path", "deployment_script_path", "input_info", "id", "created_at", "gh_repo", "is_deployed"]
50
+
51
+ @field_validator('build_system')
52
+ def build_system_validate_enum(cls, value):
53
+ """Validates the enum"""
54
+ if value is None:
55
+ return value
56
+
57
+ if value not in set(['hardhat', 'hardhat-ignition', 'foundry']):
58
+ raise ValueError("must be one of enum values ('hardhat', 'hardhat-ignition', 'foundry')")
59
+ return value
60
+
61
+ @field_validator('contents')
62
+ def contents_validate_enum(cls, value):
63
+ """Validates the enum"""
64
+ if value is None:
65
+ return value
66
+
67
+ for i in value:
68
+ if i not in set(['circom', 'solidity', 'picus', 'llzk']):
69
+ raise ValueError("each list item must be one of ('circom', 'solidity', 'picus', 'llzk')")
70
+ return value
71
+
72
+ model_config = ConfigDict(
73
+ populate_by_name=True,
74
+ validate_assignment=True,
75
+ protected_namespaces=(),
76
+ )
77
+
78
+
79
+ def to_str(self) -> str:
80
+ """Returns the string representation of the model using alias"""
81
+ return pprint.pformat(self.model_dump(by_alias=True))
82
+
83
+ def to_json(self) -> str:
84
+ """Returns the JSON representation of the model using alias"""
85
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
86
+ return json.dumps(self.to_dict())
87
+
88
+ @classmethod
89
+ def from_json(cls, json_str: str) -> Optional[Self]:
90
+ """Create an instance of Project from a JSON string"""
91
+ return cls.from_dict(json.loads(json_str))
92
+
93
+ def to_dict(self) -> Dict[str, Any]:
94
+ """Return the dictionary representation of the model using alias.
95
+
96
+ This has the following differences from calling pydantic's
97
+ `self.model_dump(by_alias=True)`:
98
+
99
+ * `None` is only added to the output dict for nullable fields that
100
+ were set at model initialization. Other fields with value `None`
101
+ are ignored.
102
+ """
103
+ excluded_fields: Set[str] = set([
104
+ ])
105
+
106
+ _dict = self.model_dump(
107
+ by_alias=True,
108
+ exclude=excluded_fields,
109
+ exclude_none=True,
110
+ )
111
+ # override the default output from pydantic by calling `to_dict()` of each item in env_vars (list)
112
+ _items = []
113
+ if self.env_vars:
114
+ for _item_env_vars in self.env_vars:
115
+ if _item_env_vars:
116
+ _items.append(_item_env_vars.to_dict())
117
+ _dict['env_vars'] = _items
118
+ # override the default output from pydantic by calling `to_dict()` of dependencies
119
+ if self.dependencies:
120
+ _dict['dependencies'] = self.dependencies.to_dict()
121
+ # override the default output from pydantic by calling `to_dict()` of input_info
122
+ if self.input_info:
123
+ _dict['input_info'] = self.input_info.to_dict()
124
+ # set to None if env_vars (nullable) is None
125
+ # and model_fields_set contains the field
126
+ if self.env_vars is None and "env_vars" in self.model_fields_set:
127
+ _dict['env_vars'] = None
128
+
129
+ # set to None if dependencies (nullable) is None
130
+ # and model_fields_set contains the field
131
+ if self.dependencies is None and "dependencies" in self.model_fields_set:
132
+ _dict['dependencies'] = None
133
+
134
+ # set to None if build_system (nullable) is None
135
+ # and model_fields_set contains the field
136
+ if self.build_system is None and "build_system" in self.model_fields_set:
137
+ _dict['build_system'] = None
138
+
139
+ # set to None if contents (nullable) is None
140
+ # and model_fields_set contains the field
141
+ if self.contents is None and "contents" in self.model_fields_set:
142
+ _dict['contents'] = None
143
+
144
+ # set to None if include_path (nullable) is None
145
+ # and model_fields_set contains the field
146
+ if self.include_path is None and "include_path" in self.model_fields_set:
147
+ _dict['include_path'] = None
148
+
149
+ # set to None if specs_path (nullable) is None
150
+ # and model_fields_set contains the field
151
+ if self.specs_path is None and "specs_path" in self.model_fields_set:
152
+ _dict['specs_path'] = None
153
+
154
+ # set to None if hints_path (nullable) is None
155
+ # and model_fields_set contains the field
156
+ if self.hints_path is None and "hints_path" in self.model_fields_set:
157
+ _dict['hints_path'] = None
158
+
159
+ # set to None if deployment_script_path (nullable) is None
160
+ # and model_fields_set contains the field
161
+ if self.deployment_script_path is None and "deployment_script_path" in self.model_fields_set:
162
+ _dict['deployment_script_path'] = None
163
+
164
+ # set to None if gh_repo (nullable) is None
165
+ # and model_fields_set contains the field
166
+ if self.gh_repo is None and "gh_repo" in self.model_fields_set:
167
+ _dict['gh_repo'] = None
168
+
169
+ return _dict
170
+
171
+ @classmethod
172
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
173
+ """Create an instance of Project from a dict"""
174
+ if obj is None:
175
+ return None
176
+
177
+ if not isinstance(obj, dict):
178
+ return cls.model_validate(obj)
179
+
180
+ _obj = cls.model_validate({
181
+ "name": obj.get("name"),
182
+ "project_root": obj.get("project_root"),
183
+ "env_vars": [EnvVar.from_dict(_item) for _item in obj["env_vars"]] if obj.get("env_vars") is not None else None,
184
+ "dependencies": ProjectDependency.from_dict(obj["dependencies"]) if obj.get("dependencies") is not None else None,
185
+ "build_system": obj.get("build_system"),
186
+ "contents": obj.get("contents"),
187
+ "src_path": obj.get("src_path"),
188
+ "include_path": obj.get("include_path"),
189
+ "specs_path": obj.get("specs_path"),
190
+ "hints_path": obj.get("hints_path"),
191
+ "deployment_script_path": obj.get("deployment_script_path"),
192
+ "input_info": InputInfo.from_dict(obj["input_info"]) if obj.get("input_info") is not None else None,
193
+ "id": obj.get("id"),
194
+ "created_at": obj.get("created_at"),
195
+ "gh_repo": obj.get("gh_repo"),
196
+ "is_deployed": obj.get("is_deployed")
197
+ })
198
+ return _obj
199
+
200
+
@@ -0,0 +1,206 @@
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 audithub_sdk.models.env_var import EnvVar
24
+ from audithub_sdk.models.input_info import InputInfo
25
+ from audithub_sdk.models.project_dependency import ProjectDependency
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class ProjectAdmin(BaseModel):
30
+ """
31
+ ProjectAdmin
32
+ """ # noqa: E501
33
+ name: StrictStr
34
+ project_root: StrictStr = Field(description="Relative path inside archive")
35
+ env_vars: Optional[List[EnvVar]] = None
36
+ dependencies: Optional[ProjectDependency] = None
37
+ build_system: Optional[StrictStr] = None
38
+ contents: Optional[List[StrictStr]] = None
39
+ src_path: StrictStr = Field(description="The path where we can find the sources to process. This is relative path inside archive, and it must be bellow project_root.")
40
+ include_path: Optional[StrictStr] = None
41
+ specs_path: Optional[StrictStr] = None
42
+ hints_path: Optional[StrictStr] = None
43
+ deployment_script_path: Optional[StrictStr] = None
44
+ input_info: InputInfo
45
+ id: StrictInt
46
+ created_at: datetime
47
+ gh_repo: Optional[StrictStr]
48
+ is_deployed: StrictBool = Field(description="When true, there is at least on project version that is deployed.")
49
+ deleted: StrictBool = Field(description="If true, then the project has been soft-deleted.")
50
+ created_by: StrictStr
51
+ organization_id: StrictInt
52
+ __properties: ClassVar[List[str]] = ["name", "project_root", "env_vars", "dependencies", "build_system", "contents", "src_path", "include_path", "specs_path", "hints_path", "deployment_script_path", "input_info", "id", "created_at", "gh_repo", "is_deployed", "deleted", "created_by", "organization_id"]
53
+
54
+ @field_validator('build_system')
55
+ def build_system_validate_enum(cls, value):
56
+ """Validates the enum"""
57
+ if value is None:
58
+ return value
59
+
60
+ if value not in set(['hardhat', 'hardhat-ignition', 'foundry']):
61
+ raise ValueError("must be one of enum values ('hardhat', 'hardhat-ignition', 'foundry')")
62
+ return value
63
+
64
+ @field_validator('contents')
65
+ def contents_validate_enum(cls, value):
66
+ """Validates the enum"""
67
+ if value is None:
68
+ return value
69
+
70
+ for i in value:
71
+ if i not in set(['circom', 'solidity', 'picus', 'llzk']):
72
+ raise ValueError("each list item must be one of ('circom', 'solidity', 'picus', 'llzk')")
73
+ return value
74
+
75
+ model_config = ConfigDict(
76
+ populate_by_name=True,
77
+ validate_assignment=True,
78
+ protected_namespaces=(),
79
+ )
80
+
81
+
82
+ def to_str(self) -> str:
83
+ """Returns the string representation of the model using alias"""
84
+ return pprint.pformat(self.model_dump(by_alias=True))
85
+
86
+ def to_json(self) -> str:
87
+ """Returns the JSON representation of the model using alias"""
88
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
89
+ return json.dumps(self.to_dict())
90
+
91
+ @classmethod
92
+ def from_json(cls, json_str: str) -> Optional[Self]:
93
+ """Create an instance of ProjectAdmin from a JSON string"""
94
+ return cls.from_dict(json.loads(json_str))
95
+
96
+ def to_dict(self) -> Dict[str, Any]:
97
+ """Return the dictionary representation of the model using alias.
98
+
99
+ This has the following differences from calling pydantic's
100
+ `self.model_dump(by_alias=True)`:
101
+
102
+ * `None` is only added to the output dict for nullable fields that
103
+ were set at model initialization. Other fields with value `None`
104
+ are ignored.
105
+ """
106
+ excluded_fields: Set[str] = set([
107
+ ])
108
+
109
+ _dict = self.model_dump(
110
+ by_alias=True,
111
+ exclude=excluded_fields,
112
+ exclude_none=True,
113
+ )
114
+ # override the default output from pydantic by calling `to_dict()` of each item in env_vars (list)
115
+ _items = []
116
+ if self.env_vars:
117
+ for _item_env_vars in self.env_vars:
118
+ if _item_env_vars:
119
+ _items.append(_item_env_vars.to_dict())
120
+ _dict['env_vars'] = _items
121
+ # override the default output from pydantic by calling `to_dict()` of dependencies
122
+ if self.dependencies:
123
+ _dict['dependencies'] = self.dependencies.to_dict()
124
+ # override the default output from pydantic by calling `to_dict()` of input_info
125
+ if self.input_info:
126
+ _dict['input_info'] = self.input_info.to_dict()
127
+ # set to None if env_vars (nullable) is None
128
+ # and model_fields_set contains the field
129
+ if self.env_vars is None and "env_vars" in self.model_fields_set:
130
+ _dict['env_vars'] = None
131
+
132
+ # set to None if dependencies (nullable) is None
133
+ # and model_fields_set contains the field
134
+ if self.dependencies is None and "dependencies" in self.model_fields_set:
135
+ _dict['dependencies'] = None
136
+
137
+ # set to None if build_system (nullable) is None
138
+ # and model_fields_set contains the field
139
+ if self.build_system is None and "build_system" in self.model_fields_set:
140
+ _dict['build_system'] = None
141
+
142
+ # set to None if contents (nullable) is None
143
+ # and model_fields_set contains the field
144
+ if self.contents is None and "contents" in self.model_fields_set:
145
+ _dict['contents'] = None
146
+
147
+ # set to None if include_path (nullable) is None
148
+ # and model_fields_set contains the field
149
+ if self.include_path is None and "include_path" in self.model_fields_set:
150
+ _dict['include_path'] = None
151
+
152
+ # set to None if specs_path (nullable) is None
153
+ # and model_fields_set contains the field
154
+ if self.specs_path is None and "specs_path" in self.model_fields_set:
155
+ _dict['specs_path'] = None
156
+
157
+ # set to None if hints_path (nullable) is None
158
+ # and model_fields_set contains the field
159
+ if self.hints_path is None and "hints_path" in self.model_fields_set:
160
+ _dict['hints_path'] = None
161
+
162
+ # set to None if deployment_script_path (nullable) is None
163
+ # and model_fields_set contains the field
164
+ if self.deployment_script_path is None and "deployment_script_path" in self.model_fields_set:
165
+ _dict['deployment_script_path'] = None
166
+
167
+ # set to None if gh_repo (nullable) is None
168
+ # and model_fields_set contains the field
169
+ if self.gh_repo is None and "gh_repo" in self.model_fields_set:
170
+ _dict['gh_repo'] = None
171
+
172
+ return _dict
173
+
174
+ @classmethod
175
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
176
+ """Create an instance of ProjectAdmin from a dict"""
177
+ if obj is None:
178
+ return None
179
+
180
+ if not isinstance(obj, dict):
181
+ return cls.model_validate(obj)
182
+
183
+ _obj = cls.model_validate({
184
+ "name": obj.get("name"),
185
+ "project_root": obj.get("project_root"),
186
+ "env_vars": [EnvVar.from_dict(_item) for _item in obj["env_vars"]] if obj.get("env_vars") is not None else None,
187
+ "dependencies": ProjectDependency.from_dict(obj["dependencies"]) if obj.get("dependencies") is not None else None,
188
+ "build_system": obj.get("build_system"),
189
+ "contents": obj.get("contents"),
190
+ "src_path": obj.get("src_path"),
191
+ "include_path": obj.get("include_path"),
192
+ "specs_path": obj.get("specs_path"),
193
+ "hints_path": obj.get("hints_path"),
194
+ "deployment_script_path": obj.get("deployment_script_path"),
195
+ "input_info": InputInfo.from_dict(obj["input_info"]) if obj.get("input_info") is not None else None,
196
+ "id": obj.get("id"),
197
+ "created_at": obj.get("created_at"),
198
+ "gh_repo": obj.get("gh_repo"),
199
+ "is_deployed": obj.get("is_deployed"),
200
+ "deleted": obj.get("deleted"),
201
+ "created_by": obj.get("created_by"),
202
+ "organization_id": obj.get("organization_id")
203
+ })
204
+ return _obj
205
+
206
+