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,104 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FastAPI
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class OrganizationActiveQuota(BaseModel):
27
+ """
28
+ OrganizationActiveQuota
29
+ """ # noqa: E501
30
+ date_from: datetime
31
+ date_to: datetime
32
+ cpu_minutes: Optional[StrictInt]
33
+ storage_mb: Optional[StrictInt]
34
+ __properties: ClassVar[List[str]] = ["date_from", "date_to", "cpu_minutes", "storage_mb"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of OrganizationActiveQuota from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # set to None if cpu_minutes (nullable) is None
76
+ # and model_fields_set contains the field
77
+ if self.cpu_minutes is None and "cpu_minutes" in self.model_fields_set:
78
+ _dict['cpu_minutes'] = None
79
+
80
+ # set to None if storage_mb (nullable) is None
81
+ # and model_fields_set contains the field
82
+ if self.storage_mb is None and "storage_mb" in self.model_fields_set:
83
+ _dict['storage_mb'] = None
84
+
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of OrganizationActiveQuota from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "date_from": obj.get("date_from"),
98
+ "date_to": obj.get("date_to"),
99
+ "cpu_minutes": obj.get("cpu_minutes"),
100
+ "storage_mb": obj.get("storage_mb")
101
+ })
102
+ return _obj
103
+
104
+
@@ -0,0 +1,110 @@
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 import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class OrganizationAdmin(BaseModel):
27
+ """
28
+ OrganizationAdmin
29
+ """ # noqa: E501
30
+ name: StrictStr
31
+ support_channel: Optional[StrictStr] = None
32
+ user_limit: Optional[StrictInt] = None
33
+ id: StrictInt
34
+ gh_connected: StrictBool
35
+ created_at: datetime
36
+ deleted: StrictBool = Field(description="If true, then the Organization has been soft-deleted.")
37
+ __properties: ClassVar[List[str]] = ["name", "support_channel", "user_limit", "id", "gh_connected", "created_at", "deleted"]
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 OrganizationAdmin 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
+ # set to None if support_channel (nullable) is None
79
+ # and model_fields_set contains the field
80
+ if self.support_channel is None and "support_channel" in self.model_fields_set:
81
+ _dict['support_channel'] = None
82
+
83
+ # set to None if user_limit (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.user_limit is None and "user_limit" in self.model_fields_set:
86
+ _dict['user_limit'] = None
87
+
88
+ return _dict
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
+ """Create an instance of OrganizationAdmin from a dict"""
93
+ if obj is None:
94
+ return None
95
+
96
+ if not isinstance(obj, dict):
97
+ return cls.model_validate(obj)
98
+
99
+ _obj = cls.model_validate({
100
+ "name": obj.get("name"),
101
+ "support_channel": obj.get("support_channel"),
102
+ "user_limit": obj.get("user_limit"),
103
+ "id": obj.get("id"),
104
+ "gh_connected": obj.get("gh_connected"),
105
+ "created_at": obj.get("created_at"),
106
+ "deleted": obj.get("deleted")
107
+ })
108
+ return _obj
109
+
110
+
@@ -0,0 +1,104 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FastAPI
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class OrganizationConsumption(BaseModel):
27
+ """
28
+ OrganizationConsumption
29
+ """ # noqa: E501
30
+ cpu_minutes: StrictInt
31
+ storage_mb: StrictInt
32
+ from_date: Optional[datetime] = None
33
+ to_date: Optional[datetime] = None
34
+ __properties: ClassVar[List[str]] = ["cpu_minutes", "storage_mb", "from_date", "to_date"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of OrganizationConsumption from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # set to None if from_date (nullable) is None
76
+ # and model_fields_set contains the field
77
+ if self.from_date is None and "from_date" in self.model_fields_set:
78
+ _dict['from_date'] = None
79
+
80
+ # set to None if to_date (nullable) is None
81
+ # and model_fields_set contains the field
82
+ if self.to_date is None and "to_date" in self.model_fields_set:
83
+ _dict['to_date'] = None
84
+
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of OrganizationConsumption from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "cpu_minutes": obj.get("cpu_minutes"),
98
+ "storage_mb": obj.get("storage_mb"),
99
+ "from_date": obj.get("from_date"),
100
+ "to_date": obj.get("to_date")
101
+ })
102
+ return _obj
103
+
104
+
@@ -0,0 +1,96 @@
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, Optional
22
+ from audithub_sdk.models.organization_active_quota import OrganizationActiveQuota
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class OrganizationQuota(BaseModel):
27
+ """
28
+ OrganizationQuota
29
+ """ # noqa: E501
30
+ active_quota: Optional[OrganizationActiveQuota]
31
+ __properties: ClassVar[List[str]] = ["active_quota"]
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 OrganizationQuota 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
+ # override the default output from pydantic by calling `to_dict()` of active_quota
73
+ if self.active_quota:
74
+ _dict['active_quota'] = self.active_quota.to_dict()
75
+ # set to None if active_quota (nullable) is None
76
+ # and model_fields_set contains the field
77
+ if self.active_quota is None and "active_quota" in self.model_fields_set:
78
+ _dict['active_quota'] = None
79
+
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of OrganizationQuota from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "active_quota": OrganizationActiveQuota.from_dict(obj["active_quota"]) if obj.get("active_quota") is not None else None
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,135 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FastAPI
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class OrganizationSubscription(BaseModel):
27
+ """
28
+ OrganizationSubscription
29
+ """ # noqa: E501
30
+ subscription_type: Optional[StrictStr] = Field(default='S', description="Subscription type can be S for subscription and E for extension.")
31
+ from_date: datetime
32
+ to_date: datetime
33
+ monthly_cpu_minutes: Optional[StrictInt] = Field(default=None, alias="monthly_CPU_minutes")
34
+ storage_mb: Optional[StrictInt] = None
35
+ package_name: Optional[StrictStr] = None
36
+ enforce_monthly_resource_consumption: Optional[StrictBool] = Field(default=False, description="It indicates how to enforce quotas: a) when True, monthly quotas can only be consumed within the specific month, and b) when False, quota are freely consumed any time within the subscription time window")
37
+ id: StrictInt
38
+ created_at: datetime
39
+ created_by: StrictStr
40
+ last_updated_at: datetime
41
+ last_updated_by: StrictStr
42
+ __properties: ClassVar[List[str]] = ["subscription_type", "from_date", "to_date", "monthly_CPU_minutes", "storage_mb", "package_name", "enforce_monthly_resource_consumption", "id", "created_at", "created_by", "last_updated_at", "last_updated_by"]
43
+
44
+ @field_validator('subscription_type')
45
+ def subscription_type_validate_enum(cls, value):
46
+ """Validates the enum"""
47
+ if value is None:
48
+ return value
49
+
50
+ if value not in set(['S', 'E']):
51
+ raise ValueError("must be one of enum values ('S', 'E')")
52
+ return value
53
+
54
+ model_config = ConfigDict(
55
+ populate_by_name=True,
56
+ validate_assignment=True,
57
+ protected_namespaces=(),
58
+ )
59
+
60
+
61
+ def to_str(self) -> str:
62
+ """Returns the string representation of the model using alias"""
63
+ return pprint.pformat(self.model_dump(by_alias=True))
64
+
65
+ def to_json(self) -> str:
66
+ """Returns the JSON representation of the model using alias"""
67
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
68
+ return json.dumps(self.to_dict())
69
+
70
+ @classmethod
71
+ def from_json(cls, json_str: str) -> Optional[Self]:
72
+ """Create an instance of OrganizationSubscription from a JSON string"""
73
+ return cls.from_dict(json.loads(json_str))
74
+
75
+ def to_dict(self) -> Dict[str, Any]:
76
+ """Return the dictionary representation of the model using alias.
77
+
78
+ This has the following differences from calling pydantic's
79
+ `self.model_dump(by_alias=True)`:
80
+
81
+ * `None` is only added to the output dict for nullable fields that
82
+ were set at model initialization. Other fields with value `None`
83
+ are ignored.
84
+ """
85
+ excluded_fields: Set[str] = set([
86
+ ])
87
+
88
+ _dict = self.model_dump(
89
+ by_alias=True,
90
+ exclude=excluded_fields,
91
+ exclude_none=True,
92
+ )
93
+ # set to None if monthly_cpu_minutes (nullable) is None
94
+ # and model_fields_set contains the field
95
+ if self.monthly_cpu_minutes is None and "monthly_cpu_minutes" in self.model_fields_set:
96
+ _dict['monthly_CPU_minutes'] = None
97
+
98
+ # set to None if storage_mb (nullable) is None
99
+ # and model_fields_set contains the field
100
+ if self.storage_mb is None and "storage_mb" in self.model_fields_set:
101
+ _dict['storage_mb'] = None
102
+
103
+ # set to None if package_name (nullable) is None
104
+ # and model_fields_set contains the field
105
+ if self.package_name is None and "package_name" in self.model_fields_set:
106
+ _dict['package_name'] = None
107
+
108
+ return _dict
109
+
110
+ @classmethod
111
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
112
+ """Create an instance of OrganizationSubscription from a dict"""
113
+ if obj is None:
114
+ return None
115
+
116
+ if not isinstance(obj, dict):
117
+ return cls.model_validate(obj)
118
+
119
+ _obj = cls.model_validate({
120
+ "subscription_type": obj.get("subscription_type") if obj.get("subscription_type") is not None else 'S',
121
+ "from_date": obj.get("from_date"),
122
+ "to_date": obj.get("to_date"),
123
+ "monthly_CPU_minutes": obj.get("monthly_CPU_minutes"),
124
+ "storage_mb": obj.get("storage_mb"),
125
+ "package_name": obj.get("package_name"),
126
+ "enforce_monthly_resource_consumption": obj.get("enforce_monthly_resource_consumption") if obj.get("enforce_monthly_resource_consumption") is not None else False,
127
+ "id": obj.get("id"),
128
+ "created_at": obj.get("created_at"),
129
+ "created_by": obj.get("created_by"),
130
+ "last_updated_at": obj.get("last_updated_at"),
131
+ "last_updated_by": obj.get("last_updated_by")
132
+ })
133
+ return _obj
134
+
135
+
@@ -0,0 +1,140 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FastAPI
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from audithub_sdk.models.organization_access_restriction import OrganizationAccessRestriction
23
+ from audithub_sdk.models.package_subscription import PackageSubscription
24
+ from audithub_sdk.models.project_data import ProjectData
25
+ from audithub_sdk.models.user_access_restriction import UserAccessRestriction
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class PackageData(BaseModel):
30
+ """
31
+ PackageData
32
+ """ # noqa: E501
33
+ organization_name: StrictStr
34
+ user_limit: Optional[StrictInt]
35
+ projects: List[ProjectData]
36
+ org_restrictions: Optional[List[OrganizationAccessRestriction]]
37
+ user_restrictions: Optional[List[UserAccessRestriction]]
38
+ subscription: PackageSubscription
39
+ __properties: ClassVar[List[str]] = ["organization_name", "user_limit", "projects", "org_restrictions", "user_restrictions", "subscription"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of PackageData from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # override the default output from pydantic by calling `to_dict()` of each item in projects (list)
81
+ _items = []
82
+ if self.projects:
83
+ for _item_projects in self.projects:
84
+ if _item_projects:
85
+ _items.append(_item_projects.to_dict())
86
+ _dict['projects'] = _items
87
+ # override the default output from pydantic by calling `to_dict()` of each item in org_restrictions (list)
88
+ _items = []
89
+ if self.org_restrictions:
90
+ for _item_org_restrictions in self.org_restrictions:
91
+ if _item_org_restrictions:
92
+ _items.append(_item_org_restrictions.to_dict())
93
+ _dict['org_restrictions'] = _items
94
+ # override the default output from pydantic by calling `to_dict()` of each item in user_restrictions (list)
95
+ _items = []
96
+ if self.user_restrictions:
97
+ for _item_user_restrictions in self.user_restrictions:
98
+ if _item_user_restrictions:
99
+ _items.append(_item_user_restrictions.to_dict())
100
+ _dict['user_restrictions'] = _items
101
+ # override the default output from pydantic by calling `to_dict()` of subscription
102
+ if self.subscription:
103
+ _dict['subscription'] = self.subscription.to_dict()
104
+ # set to None if user_limit (nullable) is None
105
+ # and model_fields_set contains the field
106
+ if self.user_limit is None and "user_limit" in self.model_fields_set:
107
+ _dict['user_limit'] = None
108
+
109
+ # set to None if org_restrictions (nullable) is None
110
+ # and model_fields_set contains the field
111
+ if self.org_restrictions is None and "org_restrictions" in self.model_fields_set:
112
+ _dict['org_restrictions'] = None
113
+
114
+ # set to None if user_restrictions (nullable) is None
115
+ # and model_fields_set contains the field
116
+ if self.user_restrictions is None and "user_restrictions" in self.model_fields_set:
117
+ _dict['user_restrictions'] = None
118
+
119
+ return _dict
120
+
121
+ @classmethod
122
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
123
+ """Create an instance of PackageData from a dict"""
124
+ if obj is None:
125
+ return None
126
+
127
+ if not isinstance(obj, dict):
128
+ return cls.model_validate(obj)
129
+
130
+ _obj = cls.model_validate({
131
+ "organization_name": obj.get("organization_name"),
132
+ "user_limit": obj.get("user_limit"),
133
+ "projects": [ProjectData.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None,
134
+ "org_restrictions": [OrganizationAccessRestriction.from_dict(_item) for _item in obj["org_restrictions"]] if obj.get("org_restrictions") is not None else None,
135
+ "user_restrictions": [UserAccessRestriction.from_dict(_item) for _item in obj["user_restrictions"]] if obj.get("user_restrictions") is not None else None,
136
+ "subscription": PackageSubscription.from_dict(obj["subscription"]) if obj.get("subscription") is not None else None
137
+ })
138
+ return _obj
139
+
140
+