loopix-sdk 2.30.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 (238) hide show
  1. loopix/__init__.py +260 -0
  2. loopix/api/__init__.py +287 -0
  3. loopix/api/client/__init__.py +8 -0
  4. loopix/api/client/api/__init__.py +1 -0
  5. loopix/api/client/api/sandboxes/__init__.py +1 -0
  6. loopix/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py +161 -0
  7. loopix/api/client/api/sandboxes/get_sandboxes.py +176 -0
  8. loopix/api/client/api/sandboxes/get_sandboxes_metrics.py +173 -0
  9. loopix/api/client/api/sandboxes/get_sandboxes_sandbox_id.py +163 -0
  10. loopix/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py +199 -0
  11. loopix/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py +212 -0
  12. loopix/api/client/api/sandboxes/get_v2_sandboxes.py +230 -0
  13. loopix/api/client/api/sandboxes/get_v_2_sandboxes_sandbox_id_logs.py +254 -0
  14. loopix/api/client/api/sandboxes/post_sandboxes.py +172 -0
  15. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_connect.py +193 -0
  16. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py +187 -0
  17. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py +181 -0
  18. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py +189 -0
  19. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_snapshots.py +195 -0
  20. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py +193 -0
  21. loopix/api/client/api/sandboxes/put_sandboxes_sandbox_id_network.py +199 -0
  22. loopix/api/client/api/snapshots/__init__.py +1 -0
  23. loopix/api/client/api/snapshots/get_snapshots.py +202 -0
  24. loopix/api/client/api/tags/__init__.py +1 -0
  25. loopix/api/client/api/tags/delete_templates_tags.py +174 -0
  26. loopix/api/client/api/tags/get_templates_template_id_tags.py +172 -0
  27. loopix/api/client/api/tags/post_templates_tags.py +176 -0
  28. loopix/api/client/api/templates/__init__.py +1 -0
  29. loopix/api/client/api/templates/delete_templates_template_id.py +157 -0
  30. loopix/api/client/api/templates/get_templates.py +172 -0
  31. loopix/api/client/api/templates/get_templates_aliases_alias.py +167 -0
  32. loopix/api/client/api/templates/get_templates_template_id.py +195 -0
  33. loopix/api/client/api/templates/get_templates_template_id_builds_build_id_logs.py +272 -0
  34. loopix/api/client/api/templates/get_templates_template_id_builds_build_id_status.py +232 -0
  35. loopix/api/client/api/templates/get_templates_template_id_files_hash.py +180 -0
  36. loopix/api/client/api/templates/patch_templates_template_id.py +183 -0
  37. loopix/api/client/api/templates/patch_v_2_templates_template_id.py +185 -0
  38. loopix/api/client/api/templates/post_templates.py +172 -0
  39. loopix/api/client/api/templates/post_templates_template_id.py +181 -0
  40. loopix/api/client/api/templates/post_templates_template_id_builds_build_id.py +170 -0
  41. loopix/api/client/api/templates/post_v2_templates.py +172 -0
  42. loopix/api/client/api/templates/post_v3_templates.py +176 -0
  43. loopix/api/client/api/templates/post_v_2_templates_template_id_builds_build_id.py +192 -0
  44. loopix/api/client/api/volumes/__init__.py +1 -0
  45. loopix/api/client/api/volumes/delete_volumes_volume_id.py +161 -0
  46. loopix/api/client/api/volumes/get_volumes.py +140 -0
  47. loopix/api/client/api/volumes/get_volumes_volume_id.py +163 -0
  48. loopix/api/client/api/volumes/post_volumes.py +172 -0
  49. loopix/api/client/client.py +286 -0
  50. loopix/api/client/errors.py +16 -0
  51. loopix/api/client/models/__init__.py +185 -0
  52. loopix/api/client/models/admin_build_cancel_result.py +67 -0
  53. loopix/api/client/models/admin_sandbox_kill_result.py +67 -0
  54. loopix/api/client/models/assign_template_tags_request.py +67 -0
  55. loopix/api/client/models/assigned_template_tags.py +68 -0
  56. loopix/api/client/models/aws_registry.py +85 -0
  57. loopix/api/client/models/aws_registry_type.py +8 -0
  58. loopix/api/client/models/build_log_entry.py +89 -0
  59. loopix/api/client/models/build_status_reason.py +95 -0
  60. loopix/api/client/models/connect_sandbox.py +59 -0
  61. loopix/api/client/models/created_access_token.py +100 -0
  62. loopix/api/client/models/created_team_api_key.py +166 -0
  63. loopix/api/client/models/delete_template_tags_request.py +67 -0
  64. loopix/api/client/models/disk_metrics.py +91 -0
  65. loopix/api/client/models/error.py +67 -0
  66. loopix/api/client/models/gcp_registry.py +69 -0
  67. loopix/api/client/models/gcp_registry_type.py +8 -0
  68. loopix/api/client/models/general_registry.py +77 -0
  69. loopix/api/client/models/general_registry_type.py +8 -0
  70. loopix/api/client/models/identifier_masking_details.py +83 -0
  71. loopix/api/client/models/listed_sandbox.py +179 -0
  72. loopix/api/client/models/log_level.py +11 -0
  73. loopix/api/client/models/logs_direction.py +9 -0
  74. loopix/api/client/models/logs_source.py +9 -0
  75. loopix/api/client/models/machine_info.py +83 -0
  76. loopix/api/client/models/max_team_metric.py +78 -0
  77. loopix/api/client/models/mcp_type_0.py +44 -0
  78. loopix/api/client/models/new_access_token.py +59 -0
  79. loopix/api/client/models/new_sandbox.py +224 -0
  80. loopix/api/client/models/new_team_api_key.py +59 -0
  81. loopix/api/client/models/new_volume.py +59 -0
  82. loopix/api/client/models/node.py +160 -0
  83. loopix/api/client/models/node_detail.py +160 -0
  84. loopix/api/client/models/node_metrics.py +122 -0
  85. loopix/api/client/models/node_status.py +12 -0
  86. loopix/api/client/models/node_status_change.py +82 -0
  87. loopix/api/client/models/post_sandboxes_sandbox_id_refreshes_body.py +59 -0
  88. loopix/api/client/models/post_sandboxes_sandbox_id_snapshots_body.py +60 -0
  89. loopix/api/client/models/post_sandboxes_sandbox_id_timeout_body.py +59 -0
  90. loopix/api/client/models/resumed_sandbox.py +68 -0
  91. loopix/api/client/models/sandbox.py +145 -0
  92. loopix/api/client/models/sandbox_auto_resume_config.py +60 -0
  93. loopix/api/client/models/sandbox_detail.py +267 -0
  94. loopix/api/client/models/sandbox_lifecycle.py +70 -0
  95. loopix/api/client/models/sandbox_log.py +70 -0
  96. loopix/api/client/models/sandbox_log_entry.py +93 -0
  97. loopix/api/client/models/sandbox_log_entry_fields.py +44 -0
  98. loopix/api/client/models/sandbox_logs.py +91 -0
  99. loopix/api/client/models/sandbox_logs_v2_response.py +73 -0
  100. loopix/api/client/models/sandbox_metric.py +126 -0
  101. loopix/api/client/models/sandbox_network_config.py +118 -0
  102. loopix/api/client/models/sandbox_network_config_rules.py +72 -0
  103. loopix/api/client/models/sandbox_network_rule.py +74 -0
  104. loopix/api/client/models/sandbox_network_transform.py +79 -0
  105. loopix/api/client/models/sandbox_network_transform_headers.py +47 -0
  106. loopix/api/client/models/sandbox_network_update_config.py +114 -0
  107. loopix/api/client/models/sandbox_network_update_config_rules.py +71 -0
  108. loopix/api/client/models/sandbox_on_timeout.py +9 -0
  109. loopix/api/client/models/sandbox_pause_request.py +62 -0
  110. loopix/api/client/models/sandbox_state.py +9 -0
  111. loopix/api/client/models/sandbox_volume_mount.py +67 -0
  112. loopix/api/client/models/sandboxes_with_metrics.py +59 -0
  113. loopix/api/client/models/snapshot_info.py +70 -0
  114. loopix/api/client/models/team.py +83 -0
  115. loopix/api/client/models/team_api_key.py +158 -0
  116. loopix/api/client/models/team_metric.py +86 -0
  117. loopix/api/client/models/team_user.py +75 -0
  118. loopix/api/client/models/template.py +225 -0
  119. loopix/api/client/models/template_alias_response.py +67 -0
  120. loopix/api/client/models/template_build.py +139 -0
  121. loopix/api/client/models/template_build_file_upload.py +70 -0
  122. loopix/api/client/models/template_build_info.py +126 -0
  123. loopix/api/client/models/template_build_logs_response.py +73 -0
  124. loopix/api/client/models/template_build_request.py +115 -0
  125. loopix/api/client/models/template_build_request_v2.py +88 -0
  126. loopix/api/client/models/template_build_request_v3.py +107 -0
  127. loopix/api/client/models/template_build_start_v2.py +184 -0
  128. loopix/api/client/models/template_build_status.py +11 -0
  129. loopix/api/client/models/template_legacy.py +207 -0
  130. loopix/api/client/models/template_request_response_v3.py +99 -0
  131. loopix/api/client/models/template_step.py +91 -0
  132. loopix/api/client/models/template_tag.py +78 -0
  133. loopix/api/client/models/template_update_request.py +59 -0
  134. loopix/api/client/models/template_update_response.py +59 -0
  135. loopix/api/client/models/template_with_builds.py +156 -0
  136. loopix/api/client/models/update_team_api_key.py +59 -0
  137. loopix/api/client/models/volume.py +67 -0
  138. loopix/api/client/models/volume_and_token.py +75 -0
  139. loopix/api/client/models/volume_token.py +59 -0
  140. loopix/api/client/py.typed +1 -0
  141. loopix/api/client/types.py +54 -0
  142. loopix/api/client_async/__init__.py +74 -0
  143. loopix/api/client_sync/__init__.py +73 -0
  144. loopix/api/metadata.py +14 -0
  145. loopix/connection_config.py +309 -0
  146. loopix/envd/api.py +170 -0
  147. loopix/envd/filesystem/filesystem_connect.py +193 -0
  148. loopix/envd/filesystem/filesystem_pb2.py +80 -0
  149. loopix/envd/filesystem/filesystem_pb2.pyi +272 -0
  150. loopix/envd/process/process_connect.py +174 -0
  151. loopix/envd/process/process_pb2.py +96 -0
  152. loopix/envd/process/process_pb2.pyi +316 -0
  153. loopix/envd/rpc.py +139 -0
  154. loopix/envd/versions.py +11 -0
  155. loopix/exceptions.py +133 -0
  156. loopix/io_utils.py +57 -0
  157. loopix/paginator.py +52 -0
  158. loopix/py.typed +0 -0
  159. loopix/sandbox/_git/__init__.py +85 -0
  160. loopix/sandbox/_git/args.py +363 -0
  161. loopix/sandbox/_git/auth.py +132 -0
  162. loopix/sandbox/_git/config.py +32 -0
  163. loopix/sandbox/_git/parse.py +222 -0
  164. loopix/sandbox/_git/types.py +149 -0
  165. loopix/sandbox/commands/command_handle.py +69 -0
  166. loopix/sandbox/commands/main.py +39 -0
  167. loopix/sandbox/filesystem/filesystem.py +337 -0
  168. loopix/sandbox/filesystem/watch_handle.py +70 -0
  169. loopix/sandbox/main.py +227 -0
  170. loopix/sandbox/mcp.py +1949 -0
  171. loopix/sandbox/network.py +8 -0
  172. loopix/sandbox/sandbox_api.py +624 -0
  173. loopix/sandbox/signature.py +47 -0
  174. loopix/sandbox/utils.py +34 -0
  175. loopix/sandbox_async/commands/command.py +396 -0
  176. loopix/sandbox_async/commands/command_handle.py +298 -0
  177. loopix/sandbox_async/commands/pty.py +257 -0
  178. loopix/sandbox_async/filesystem/filesystem.py +720 -0
  179. loopix/sandbox_async/filesystem/watch_handle.py +97 -0
  180. loopix/sandbox_async/git.py +1100 -0
  181. loopix/sandbox_async/main.py +987 -0
  182. loopix/sandbox_async/paginator.py +140 -0
  183. loopix/sandbox_async/sandbox_api.py +504 -0
  184. loopix/sandbox_async/utils.py +7 -0
  185. loopix/sandbox_domains.py +5 -0
  186. loopix/sandbox_sync/commands/command.py +420 -0
  187. loopix/sandbox_sync/commands/command_handle.py +239 -0
  188. loopix/sandbox_sync/commands/pty.py +279 -0
  189. loopix/sandbox_sync/filesystem/filesystem.py +710 -0
  190. loopix/sandbox_sync/filesystem/watch_handle.py +102 -0
  191. loopix/sandbox_sync/git.py +1077 -0
  192. loopix/sandbox_sync/main.py +975 -0
  193. loopix/sandbox_sync/paginator.py +140 -0
  194. loopix/sandbox_sync/sandbox_api.py +491 -0
  195. loopix/template/consts.py +45 -0
  196. loopix/template/dockerfile_parser.py +286 -0
  197. loopix/template/logger.py +232 -0
  198. loopix/template/main.py +1368 -0
  199. loopix/template/readycmd.py +144 -0
  200. loopix/template/types.py +194 -0
  201. loopix/template/utils.py +426 -0
  202. loopix/template_async/build_api.py +419 -0
  203. loopix/template_async/main.py +528 -0
  204. loopix/template_sync/build_api.py +409 -0
  205. loopix/template_sync/main.py +529 -0
  206. loopix/volume/client/__init__.py +8 -0
  207. loopix/volume/client/api/__init__.py +1 -0
  208. loopix/volume/client/api/volumes/__init__.py +1 -0
  209. loopix/volume/client/api/volumes/delete_volumecontent_volume_id_path.py +174 -0
  210. loopix/volume/client/api/volumes/get_volumecontent_volume_id_dir.py +204 -0
  211. loopix/volume/client/api/volumes/get_volumecontent_volume_id_file.py +179 -0
  212. loopix/volume/client/api/volumes/get_volumecontent_volume_id_path.py +176 -0
  213. loopix/volume/client/api/volumes/patch_volumecontent_volume_id_path.py +203 -0
  214. loopix/volume/client/api/volumes/post_volumecontent_volume_id_dir.py +239 -0
  215. loopix/volume/client/api/volumes/put_volumecontent_volume_id_file.py +259 -0
  216. loopix/volume/client/client.py +286 -0
  217. loopix/volume/client/errors.py +16 -0
  218. loopix/volume/client/models/__init__.py +13 -0
  219. loopix/volume/client/models/error.py +67 -0
  220. loopix/volume/client/models/patch_volumecontent_volume_id_path_body.py +77 -0
  221. loopix/volume/client/models/volume_entry_stat.py +145 -0
  222. loopix/volume/client/models/volume_entry_stat_type.py +11 -0
  223. loopix/volume/client/py.typed +1 -0
  224. loopix/volume/client/types.py +54 -0
  225. loopix/volume/client_async/__init__.py +88 -0
  226. loopix/volume/client_sync/__init__.py +80 -0
  227. loopix/volume/connection_config.py +145 -0
  228. loopix/volume/types.py +62 -0
  229. loopix/volume/utils.py +52 -0
  230. loopix/volume/volume_async.py +639 -0
  231. loopix/volume/volume_sync.py +639 -0
  232. loopix_connect/__init__.py +1 -0
  233. loopix_connect/client.py +534 -0
  234. loopix_connect/py.typed +0 -0
  235. loopix_sdk-2.30.0.dist-info/METADATA +98 -0
  236. loopix_sdk-2.30.0.dist-info/RECORD +238 -0
  237. loopix_sdk-2.30.0.dist-info/WHEEL +4 -0
  238. loopix_sdk-2.30.0.dist-info/licenses/LICENSE +9 -0
@@ -0,0 +1,73 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ if TYPE_CHECKING:
8
+ from ..models.sandbox_log_entry import SandboxLogEntry
9
+
10
+
11
+ T = TypeVar("T", bound="SandboxLogsV2Response")
12
+
13
+
14
+ @_attrs_define
15
+ class SandboxLogsV2Response:
16
+ """
17
+ Attributes:
18
+ logs (list['SandboxLogEntry']): Sandbox logs structured
19
+ """
20
+
21
+ logs: list["SandboxLogEntry"]
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ logs = []
26
+ for logs_item_data in self.logs:
27
+ logs_item = logs_item_data.to_dict()
28
+ logs.append(logs_item)
29
+
30
+ field_dict: dict[str, Any] = {}
31
+ field_dict.update(self.additional_properties)
32
+ field_dict.update(
33
+ {
34
+ "logs": logs,
35
+ }
36
+ )
37
+
38
+ return field_dict
39
+
40
+ @classmethod
41
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
42
+ from ..models.sandbox_log_entry import SandboxLogEntry
43
+
44
+ d = dict(src_dict)
45
+ logs = []
46
+ _logs = d.pop("logs")
47
+ for logs_item_data in _logs:
48
+ logs_item = SandboxLogEntry.from_dict(logs_item_data)
49
+
50
+ logs.append(logs_item)
51
+
52
+ sandbox_logs_v2_response = cls(
53
+ logs=logs,
54
+ )
55
+
56
+ sandbox_logs_v2_response.additional_properties = d
57
+ return sandbox_logs_v2_response
58
+
59
+ @property
60
+ def additional_keys(self) -> list[str]:
61
+ return list(self.additional_properties.keys())
62
+
63
+ def __getitem__(self, key: str) -> Any:
64
+ return self.additional_properties[key]
65
+
66
+ def __setitem__(self, key: str, value: Any) -> None:
67
+ self.additional_properties[key] = value
68
+
69
+ def __delitem__(self, key: str) -> None:
70
+ del self.additional_properties[key]
71
+
72
+ def __contains__(self, key: str) -> bool:
73
+ return key in self.additional_properties
@@ -0,0 +1,126 @@
1
+ import datetime
2
+ from collections.abc import Mapping
3
+ from typing import Any, TypeVar
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+ from dateutil.parser import isoparse
8
+
9
+ T = TypeVar("T", bound="SandboxMetric")
10
+
11
+
12
+ @_attrs_define
13
+ class SandboxMetric:
14
+ """Metric entry with timestamp and line
15
+
16
+ Attributes:
17
+ cpu_count (int): Number of CPU cores
18
+ cpu_used_pct (float): CPU usage percentage
19
+ disk_total (int): Total disk space in bytes
20
+ disk_used (int): Disk used in bytes
21
+ mem_cache (int): Cached memory (page cache) in bytes
22
+ mem_total (int): Total memory in bytes
23
+ mem_used (int): Memory used in bytes
24
+ timestamp (datetime.datetime): Timestamp of the metric entry
25
+ timestamp_unix (int): Timestamp of the metric entry in Unix time (seconds since epoch)
26
+ """
27
+
28
+ cpu_count: int
29
+ cpu_used_pct: float
30
+ disk_total: int
31
+ disk_used: int
32
+ mem_cache: int
33
+ mem_total: int
34
+ mem_used: int
35
+ timestamp: datetime.datetime
36
+ timestamp_unix: int
37
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
38
+
39
+ def to_dict(self) -> dict[str, Any]:
40
+ cpu_count = self.cpu_count
41
+
42
+ cpu_used_pct = self.cpu_used_pct
43
+
44
+ disk_total = self.disk_total
45
+
46
+ disk_used = self.disk_used
47
+
48
+ mem_cache = self.mem_cache
49
+
50
+ mem_total = self.mem_total
51
+
52
+ mem_used = self.mem_used
53
+
54
+ timestamp = self.timestamp.isoformat()
55
+
56
+ timestamp_unix = self.timestamp_unix
57
+
58
+ field_dict: dict[str, Any] = {}
59
+ field_dict.update(self.additional_properties)
60
+ field_dict.update(
61
+ {
62
+ "cpuCount": cpu_count,
63
+ "cpuUsedPct": cpu_used_pct,
64
+ "diskTotal": disk_total,
65
+ "diskUsed": disk_used,
66
+ "memCache": mem_cache,
67
+ "memTotal": mem_total,
68
+ "memUsed": mem_used,
69
+ "timestamp": timestamp,
70
+ "timestampUnix": timestamp_unix,
71
+ }
72
+ )
73
+
74
+ return field_dict
75
+
76
+ @classmethod
77
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
78
+ d = dict(src_dict)
79
+ cpu_count = d.pop("cpuCount")
80
+
81
+ cpu_used_pct = d.pop("cpuUsedPct")
82
+
83
+ disk_total = d.pop("diskTotal")
84
+
85
+ disk_used = d.pop("diskUsed")
86
+
87
+ mem_cache = d.pop("memCache")
88
+
89
+ mem_total = d.pop("memTotal")
90
+
91
+ mem_used = d.pop("memUsed")
92
+
93
+ timestamp = isoparse(d.pop("timestamp"))
94
+
95
+ timestamp_unix = d.pop("timestampUnix")
96
+
97
+ sandbox_metric = cls(
98
+ cpu_count=cpu_count,
99
+ cpu_used_pct=cpu_used_pct,
100
+ disk_total=disk_total,
101
+ disk_used=disk_used,
102
+ mem_cache=mem_cache,
103
+ mem_total=mem_total,
104
+ mem_used=mem_used,
105
+ timestamp=timestamp,
106
+ timestamp_unix=timestamp_unix,
107
+ )
108
+
109
+ sandbox_metric.additional_properties = d
110
+ return sandbox_metric
111
+
112
+ @property
113
+ def additional_keys(self) -> list[str]:
114
+ return list(self.additional_properties.keys())
115
+
116
+ def __getitem__(self, key: str) -> Any:
117
+ return self.additional_properties[key]
118
+
119
+ def __setitem__(self, key: str, value: Any) -> None:
120
+ self.additional_properties[key] = value
121
+
122
+ def __delitem__(self, key: str) -> None:
123
+ del self.additional_properties[key]
124
+
125
+ def __contains__(self, key: str) -> bool:
126
+ return key in self.additional_properties
@@ -0,0 +1,118 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.sandbox_network_config_rules import SandboxNetworkConfigRules
11
+
12
+
13
+ T = TypeVar("T", bound="SandboxNetworkConfig")
14
+
15
+
16
+ @_attrs_define
17
+ class SandboxNetworkConfig:
18
+ """
19
+ Attributes:
20
+ allow_out (Union[Unset, list[str]]): List of allowed destinations for egress traffic. Each entry can be a CIDR
21
+ block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com",
22
+ "*.example.com"). Allowed entries always take precedence over denied entries.
23
+ allow_public_traffic (Union[Unset, bool]): Specify if the sandbox URLs should be accessible only with
24
+ authentication. Default: True.
25
+ deny_out (Union[Unset, list[str]]): List of denied CIDR blocks or IP addresses for egress traffic. Domain names
26
+ are not supported for deny rules.
27
+ mask_request_host (Union[Unset, str]): Specify host mask which will be used for all sandbox requests
28
+ rules (Union[Unset, SandboxNetworkConfigRules]): Per-domain transform rules applied to matching egress
29
+ HTTP/HTTPS requests. Keys are domains (e.g. "api.example.com", "example.com"). A domain listed here is not
30
+ automatically allowed - use allowOut to permit the traffic.
31
+ """
32
+
33
+ allow_out: Union[Unset, list[str]] = UNSET
34
+ allow_public_traffic: Union[Unset, bool] = True
35
+ deny_out: Union[Unset, list[str]] = UNSET
36
+ mask_request_host: Union[Unset, str] = UNSET
37
+ rules: Union[Unset, "SandboxNetworkConfigRules"] = UNSET
38
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
+
40
+ def to_dict(self) -> dict[str, Any]:
41
+ allow_out: Union[Unset, list[str]] = UNSET
42
+ if not isinstance(self.allow_out, Unset):
43
+ allow_out = self.allow_out
44
+
45
+ allow_public_traffic = self.allow_public_traffic
46
+
47
+ deny_out: Union[Unset, list[str]] = UNSET
48
+ if not isinstance(self.deny_out, Unset):
49
+ deny_out = self.deny_out
50
+
51
+ mask_request_host = self.mask_request_host
52
+
53
+ rules: Union[Unset, dict[str, Any]] = UNSET
54
+ if not isinstance(self.rules, Unset):
55
+ rules = self.rules.to_dict()
56
+
57
+ field_dict: dict[str, Any] = {}
58
+ field_dict.update(self.additional_properties)
59
+ field_dict.update({})
60
+ if allow_out is not UNSET:
61
+ field_dict["allowOut"] = allow_out
62
+ if allow_public_traffic is not UNSET:
63
+ field_dict["allowPublicTraffic"] = allow_public_traffic
64
+ if deny_out is not UNSET:
65
+ field_dict["denyOut"] = deny_out
66
+ if mask_request_host is not UNSET:
67
+ field_dict["maskRequestHost"] = mask_request_host
68
+ if rules is not UNSET:
69
+ field_dict["rules"] = rules
70
+
71
+ return field_dict
72
+
73
+ @classmethod
74
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
75
+ from ..models.sandbox_network_config_rules import SandboxNetworkConfigRules
76
+
77
+ d = dict(src_dict)
78
+ allow_out = cast(list[str], d.pop("allowOut", UNSET))
79
+
80
+ allow_public_traffic = d.pop("allowPublicTraffic", UNSET)
81
+
82
+ deny_out = cast(list[str], d.pop("denyOut", UNSET))
83
+
84
+ mask_request_host = d.pop("maskRequestHost", UNSET)
85
+
86
+ _rules = d.pop("rules", UNSET)
87
+ rules: Union[Unset, SandboxNetworkConfigRules]
88
+ if isinstance(_rules, Unset):
89
+ rules = UNSET
90
+ else:
91
+ rules = SandboxNetworkConfigRules.from_dict(_rules)
92
+
93
+ sandbox_network_config = cls(
94
+ allow_out=allow_out,
95
+ allow_public_traffic=allow_public_traffic,
96
+ deny_out=deny_out,
97
+ mask_request_host=mask_request_host,
98
+ rules=rules,
99
+ )
100
+
101
+ sandbox_network_config.additional_properties = d
102
+ return sandbox_network_config
103
+
104
+ @property
105
+ def additional_keys(self) -> list[str]:
106
+ return list(self.additional_properties.keys())
107
+
108
+ def __getitem__(self, key: str) -> Any:
109
+ return self.additional_properties[key]
110
+
111
+ def __setitem__(self, key: str, value: Any) -> None:
112
+ self.additional_properties[key] = value
113
+
114
+ def __delitem__(self, key: str) -> None:
115
+ del self.additional_properties[key]
116
+
117
+ def __contains__(self, key: str) -> bool:
118
+ return key in self.additional_properties
@@ -0,0 +1,72 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ if TYPE_CHECKING:
8
+ from ..models.sandbox_network_rule import SandboxNetworkRule
9
+
10
+
11
+ T = TypeVar("T", bound="SandboxNetworkConfigRules")
12
+
13
+
14
+ @_attrs_define
15
+ class SandboxNetworkConfigRules:
16
+ """Per-domain transform rules applied to matching egress HTTP/HTTPS requests. Keys are domains (e.g. "api.example.com",
17
+ "example.com"). A domain listed here is not automatically allowed - use allowOut to permit the traffic.
18
+
19
+ """
20
+
21
+ additional_properties: dict[str, list["SandboxNetworkRule"]] = _attrs_field(
22
+ init=False, factory=dict
23
+ )
24
+
25
+ def to_dict(self) -> dict[str, Any]:
26
+ field_dict: dict[str, Any] = {}
27
+ for prop_name, prop in self.additional_properties.items():
28
+ field_dict[prop_name] = []
29
+ for additional_property_item_data in prop:
30
+ additional_property_item = additional_property_item_data.to_dict()
31
+ field_dict[prop_name].append(additional_property_item)
32
+
33
+ return field_dict
34
+
35
+ @classmethod
36
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
37
+ from ..models.sandbox_network_rule import SandboxNetworkRule
38
+
39
+ d = dict(src_dict)
40
+ sandbox_network_config_rules = cls()
41
+
42
+ additional_properties = {}
43
+ for prop_name, prop_dict in d.items():
44
+ additional_property = []
45
+ _additional_property = prop_dict
46
+ for additional_property_item_data in _additional_property:
47
+ additional_property_item = SandboxNetworkRule.from_dict(
48
+ additional_property_item_data
49
+ )
50
+
51
+ additional_property.append(additional_property_item)
52
+
53
+ additional_properties[prop_name] = additional_property
54
+
55
+ sandbox_network_config_rules.additional_properties = additional_properties
56
+ return sandbox_network_config_rules
57
+
58
+ @property
59
+ def additional_keys(self) -> list[str]:
60
+ return list(self.additional_properties.keys())
61
+
62
+ def __getitem__(self, key: str) -> list["SandboxNetworkRule"]:
63
+ return self.additional_properties[key]
64
+
65
+ def __setitem__(self, key: str, value: list["SandboxNetworkRule"]) -> None:
66
+ self.additional_properties[key] = value
67
+
68
+ def __delitem__(self, key: str) -> None:
69
+ del self.additional_properties[key]
70
+
71
+ def __contains__(self, key: str) -> bool:
72
+ return key in self.additional_properties
@@ -0,0 +1,74 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.sandbox_network_transform import SandboxNetworkTransform
11
+
12
+
13
+ T = TypeVar("T", bound="SandboxNetworkRule")
14
+
15
+
16
+ @_attrs_define
17
+ class SandboxNetworkRule:
18
+ """Transform rule applied to egress requests matching a domain pattern.
19
+
20
+ Attributes:
21
+ transform (Union[Unset, SandboxNetworkTransform]): Transformations applied to matching egress requests before
22
+ forwarding.
23
+ """
24
+
25
+ transform: Union[Unset, "SandboxNetworkTransform"] = UNSET
26
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
27
+
28
+ def to_dict(self) -> dict[str, Any]:
29
+ transform: Union[Unset, dict[str, Any]] = UNSET
30
+ if not isinstance(self.transform, Unset):
31
+ transform = self.transform.to_dict()
32
+
33
+ field_dict: dict[str, Any] = {}
34
+ field_dict.update(self.additional_properties)
35
+ field_dict.update({})
36
+ if transform is not UNSET:
37
+ field_dict["transform"] = transform
38
+
39
+ return field_dict
40
+
41
+ @classmethod
42
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
43
+ from ..models.sandbox_network_transform import SandboxNetworkTransform
44
+
45
+ d = dict(src_dict)
46
+ _transform = d.pop("transform", UNSET)
47
+ transform: Union[Unset, SandboxNetworkTransform]
48
+ if isinstance(_transform, Unset):
49
+ transform = UNSET
50
+ else:
51
+ transform = SandboxNetworkTransform.from_dict(_transform)
52
+
53
+ sandbox_network_rule = cls(
54
+ transform=transform,
55
+ )
56
+
57
+ sandbox_network_rule.additional_properties = d
58
+ return sandbox_network_rule
59
+
60
+ @property
61
+ def additional_keys(self) -> list[str]:
62
+ return list(self.additional_properties.keys())
63
+
64
+ def __getitem__(self, key: str) -> Any:
65
+ return self.additional_properties[key]
66
+
67
+ def __setitem__(self, key: str, value: Any) -> None:
68
+ self.additional_properties[key] = value
69
+
70
+ def __delitem__(self, key: str) -> None:
71
+ del self.additional_properties[key]
72
+
73
+ def __contains__(self, key: str) -> bool:
74
+ return key in self.additional_properties
@@ -0,0 +1,79 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.sandbox_network_transform_headers import (
11
+ SandboxNetworkTransformHeaders,
12
+ )
13
+
14
+
15
+ T = TypeVar("T", bound="SandboxNetworkTransform")
16
+
17
+
18
+ @_attrs_define
19
+ class SandboxNetworkTransform:
20
+ """Transformations applied to matching egress requests before forwarding.
21
+
22
+ Attributes:
23
+ headers (Union[Unset, SandboxNetworkTransformHeaders]): HTTP headers to inject or override in matching requests.
24
+ An existing header with the same name is replaced. Values are plain strings; secret resolution happens client-
25
+ side before sending to the API.
26
+ """
27
+
28
+ headers: Union[Unset, "SandboxNetworkTransformHeaders"] = UNSET
29
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
30
+
31
+ def to_dict(self) -> dict[str, Any]:
32
+ headers: Union[Unset, dict[str, Any]] = UNSET
33
+ if not isinstance(self.headers, Unset):
34
+ headers = self.headers.to_dict()
35
+
36
+ field_dict: dict[str, Any] = {}
37
+ field_dict.update(self.additional_properties)
38
+ field_dict.update({})
39
+ if headers is not UNSET:
40
+ field_dict["headers"] = headers
41
+
42
+ return field_dict
43
+
44
+ @classmethod
45
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
46
+ from ..models.sandbox_network_transform_headers import (
47
+ SandboxNetworkTransformHeaders,
48
+ )
49
+
50
+ d = dict(src_dict)
51
+ _headers = d.pop("headers", UNSET)
52
+ headers: Union[Unset, SandboxNetworkTransformHeaders]
53
+ if isinstance(_headers, Unset):
54
+ headers = UNSET
55
+ else:
56
+ headers = SandboxNetworkTransformHeaders.from_dict(_headers)
57
+
58
+ sandbox_network_transform = cls(
59
+ headers=headers,
60
+ )
61
+
62
+ sandbox_network_transform.additional_properties = d
63
+ return sandbox_network_transform
64
+
65
+ @property
66
+ def additional_keys(self) -> list[str]:
67
+ return list(self.additional_properties.keys())
68
+
69
+ def __getitem__(self, key: str) -> Any:
70
+ return self.additional_properties[key]
71
+
72
+ def __setitem__(self, key: str, value: Any) -> None:
73
+ self.additional_properties[key] = value
74
+
75
+ def __delitem__(self, key: str) -> None:
76
+ del self.additional_properties[key]
77
+
78
+ def __contains__(self, key: str) -> bool:
79
+ return key in self.additional_properties
@@ -0,0 +1,47 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="SandboxNetworkTransformHeaders")
8
+
9
+
10
+ @_attrs_define
11
+ class SandboxNetworkTransformHeaders:
12
+ """HTTP headers to inject or override in matching requests. An existing header with the same name is replaced. Values
13
+ are plain strings; secret resolution happens client-side before sending to the API.
14
+
15
+ """
16
+
17
+ additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
18
+
19
+ def to_dict(self) -> dict[str, Any]:
20
+ field_dict: dict[str, Any] = {}
21
+ field_dict.update(self.additional_properties)
22
+
23
+ return field_dict
24
+
25
+ @classmethod
26
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
27
+ d = dict(src_dict)
28
+ sandbox_network_transform_headers = cls()
29
+
30
+ sandbox_network_transform_headers.additional_properties = d
31
+ return sandbox_network_transform_headers
32
+
33
+ @property
34
+ def additional_keys(self) -> list[str]:
35
+ return list(self.additional_properties.keys())
36
+
37
+ def __getitem__(self, key: str) -> str:
38
+ return self.additional_properties[key]
39
+
40
+ def __setitem__(self, key: str, value: str) -> None:
41
+ self.additional_properties[key] = value
42
+
43
+ def __delitem__(self, key: str) -> None:
44
+ del self.additional_properties[key]
45
+
46
+ def __contains__(self, key: str) -> bool:
47
+ return key in self.additional_properties