scalebox-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 (157) hide show
  1. scalebox/__init__.py +80 -0
  2. scalebox/api/__init__.py +128 -0
  3. scalebox/api/client/__init__.py +8 -0
  4. scalebox/api/client/api/__init__.py +1 -0
  5. scalebox/api/client/api/sandboxes/__init__.py +0 -0
  6. scalebox/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py +161 -0
  7. scalebox/api/client/api/sandboxes/get_sandboxes.py +176 -0
  8. scalebox/api/client/api/sandboxes/get_sandboxes_metrics.py +173 -0
  9. scalebox/api/client/api/sandboxes/get_sandboxes_sandbox_id.py +163 -0
  10. scalebox/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py +199 -0
  11. scalebox/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py +214 -0
  12. scalebox/api/client/api/sandboxes/get_v2_sandboxes.py +229 -0
  13. scalebox/api/client/api/sandboxes/post_sandboxes.py +174 -0
  14. scalebox/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py +165 -0
  15. scalebox/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py +182 -0
  16. scalebox/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py +190 -0
  17. scalebox/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py +194 -0
  18. scalebox/api/client/client.py +288 -0
  19. scalebox/api/client/errors.py +16 -0
  20. scalebox/api/client/models/__init__.py +81 -0
  21. scalebox/api/client/models/build_log_entry.py +79 -0
  22. scalebox/api/client/models/created_access_token.py +100 -0
  23. scalebox/api/client/models/created_team_api_key.py +166 -0
  24. scalebox/api/client/models/error.py +67 -0
  25. scalebox/api/client/models/identifier_masking_details.py +83 -0
  26. scalebox/api/client/models/listed_sandbox.py +138 -0
  27. scalebox/api/client/models/log_level.py +11 -0
  28. scalebox/api/client/models/new_access_token.py +59 -0
  29. scalebox/api/client/models/new_sandbox.py +125 -0
  30. scalebox/api/client/models/new_team_api_key.py +59 -0
  31. scalebox/api/client/models/node.py +154 -0
  32. scalebox/api/client/models/node_detail.py +152 -0
  33. scalebox/api/client/models/node_status.py +11 -0
  34. scalebox/api/client/models/node_status_change.py +61 -0
  35. scalebox/api/client/models/post_sandboxes_sandbox_id_refreshes_body.py +59 -0
  36. scalebox/api/client/models/post_sandboxes_sandbox_id_timeout_body.py +59 -0
  37. scalebox/api/client/models/resumed_sandbox.py +68 -0
  38. scalebox/api/client/models/sandbox.py +125 -0
  39. scalebox/api/client/models/sandbox_detail.py +178 -0
  40. scalebox/api/client/models/sandbox_log.py +70 -0
  41. scalebox/api/client/models/sandbox_logs.py +73 -0
  42. scalebox/api/client/models/sandbox_metric.py +110 -0
  43. scalebox/api/client/models/sandbox_state.py +9 -0
  44. scalebox/api/client/models/sandboxes_with_metrics.py +59 -0
  45. scalebox/api/client/models/team.py +83 -0
  46. scalebox/api/client/models/team_api_key.py +158 -0
  47. scalebox/api/client/models/team_user.py +68 -0
  48. scalebox/api/client/models/template.py +179 -0
  49. scalebox/api/client/models/template_build.py +117 -0
  50. scalebox/api/client/models/template_build_file_upload.py +70 -0
  51. scalebox/api/client/models/template_build_request.py +115 -0
  52. scalebox/api/client/models/template_build_request_v2.py +88 -0
  53. scalebox/api/client/models/template_build_start_v2.py +114 -0
  54. scalebox/api/client/models/template_build_status.py +11 -0
  55. scalebox/api/client/models/template_step.py +91 -0
  56. scalebox/api/client/models/template_update_request.py +59 -0
  57. scalebox/api/client/models/update_team_api_key.py +59 -0
  58. scalebox/api/client/py.typed +1 -0
  59. scalebox/api/client/types.py +46 -0
  60. scalebox/api/metadata.py +19 -0
  61. scalebox/cli.py +125 -0
  62. scalebox/client/__init__.py +0 -0
  63. scalebox/client/aclient.py +57 -0
  64. scalebox/client/api.proto +460 -0
  65. scalebox/client/buf.gen.yaml +8 -0
  66. scalebox/client/client.py +102 -0
  67. scalebox/client/requirements.txt +5 -0
  68. scalebox/code_interpreter/__init__.py +12 -0
  69. scalebox/code_interpreter/charts.py +230 -0
  70. scalebox/code_interpreter/code_interpreter_async.py +369 -0
  71. scalebox/code_interpreter/code_interpreter_sync.py +317 -0
  72. scalebox/code_interpreter/constants.py +3 -0
  73. scalebox/code_interpreter/exceptions.py +13 -0
  74. scalebox/code_interpreter/models.py +485 -0
  75. scalebox/connection_config.py +92 -0
  76. scalebox/csx_connect/__init__.py +1 -0
  77. scalebox/csx_connect/client.py +485 -0
  78. scalebox/csx_desktop/__init__.py +0 -0
  79. scalebox/csx_desktop/main.py +651 -0
  80. scalebox/exceptions.py +83 -0
  81. scalebox/generated/__init__.py +0 -0
  82. scalebox/generated/api.py +61 -0
  83. scalebox/generated/api_pb2.py +203 -0
  84. scalebox/generated/api_pb2.pyi +956 -0
  85. scalebox/generated/api_pb2_connect.py +1456 -0
  86. scalebox/generated/rpc.py +50 -0
  87. scalebox/generated/versions.py +3 -0
  88. scalebox/requirements.txt +36 -0
  89. scalebox/sandbox/__init__.py +0 -0
  90. scalebox/sandbox/commands/__init__.py +0 -0
  91. scalebox/sandbox/commands/command_handle.py +69 -0
  92. scalebox/sandbox/commands/main.py +39 -0
  93. scalebox/sandbox/filesystem/__init__.py +0 -0
  94. scalebox/sandbox/filesystem/filesystem.py +95 -0
  95. scalebox/sandbox/filesystem/watch_handle.py +60 -0
  96. scalebox/sandbox/main.py +139 -0
  97. scalebox/sandbox/sandbox_api.py +91 -0
  98. scalebox/sandbox/signature.py +40 -0
  99. scalebox/sandbox/utils.py +34 -0
  100. scalebox/sandbox_async/__init__.py +1 -0
  101. scalebox/sandbox_async/commands/command.py +307 -0
  102. scalebox/sandbox_async/commands/command_handle.py +187 -0
  103. scalebox/sandbox_async/commands/pty.py +187 -0
  104. scalebox/sandbox_async/filesystem/filesystem.py +557 -0
  105. scalebox/sandbox_async/filesystem/watch_handle.py +61 -0
  106. scalebox/sandbox_async/main.py +646 -0
  107. scalebox/sandbox_async/sandbox_api.py +365 -0
  108. scalebox/sandbox_async/utils.py +7 -0
  109. scalebox/sandbox_sync/__init__.py +2 -0
  110. scalebox/sandbox_sync/commands/__init__.py +0 -0
  111. scalebox/sandbox_sync/commands/command.py +300 -0
  112. scalebox/sandbox_sync/commands/command_handle.py +150 -0
  113. scalebox/sandbox_sync/commands/pty.py +181 -0
  114. scalebox/sandbox_sync/filesystem/__init__.py +0 -0
  115. scalebox/sandbox_sync/filesystem/filesystem.py +543 -0
  116. scalebox/sandbox_sync/filesystem/watch_handle.py +66 -0
  117. scalebox/sandbox_sync/main.py +790 -0
  118. scalebox/sandbox_sync/sandbox_api.py +356 -0
  119. scalebox/test/CODE_INTERPRETER_TESTS_READY.md +323 -0
  120. scalebox/test/README.md +329 -0
  121. scalebox/test/__init__.py +0 -0
  122. scalebox/test/aclient.py +72 -0
  123. scalebox/test/code_interpreter_centext.py +21 -0
  124. scalebox/test/code_interpreter_centext_sync.py +21 -0
  125. scalebox/test/code_interpreter_test.py +34 -0
  126. scalebox/test/code_interpreter_test_sync.py +34 -0
  127. scalebox/test/run_all_validation_tests.py +334 -0
  128. scalebox/test/run_code_interpreter_tests.sh +67 -0
  129. scalebox/test/run_tests.sh +230 -0
  130. scalebox/test/test_basic.py +78 -0
  131. scalebox/test/test_code_interpreter_async_comprehensive.py +2653 -0
  132. scalebox/test/test_code_interpreter_e2basync_comprehensive.py +2655 -0
  133. scalebox/test/test_code_interpreter_e2bsync_comprehensive.py +3416 -0
  134. scalebox/test/test_code_interpreter_sync_comprehensive.py +3412 -0
  135. scalebox/test/test_e2b_first.py +11 -0
  136. scalebox/test/test_sandbox_async_comprehensive.py +738 -0
  137. scalebox/test/test_sandbox_stress_and_edge_cases.py +778 -0
  138. scalebox/test/test_sandbox_sync_comprehensive.py +770 -0
  139. scalebox/test/test_sandbox_usage_examples.py +987 -0
  140. scalebox/test/testacreate.py +24 -0
  141. scalebox/test/testagetinfo.py +18 -0
  142. scalebox/test/testcodeinterpreter_async.py +508 -0
  143. scalebox/test/testcodeinterpreter_sync.py +239 -0
  144. scalebox/test/testcomputeuse.py +243 -0
  145. scalebox/test/testnovnc.py +12 -0
  146. scalebox/test/testsandbox_async.py +118 -0
  147. scalebox/test/testsandbox_sync.py +38 -0
  148. scalebox/utils/__init__.py +0 -0
  149. scalebox/utils/httpcoreclient.py +297 -0
  150. scalebox/utils/httpxclient.py +403 -0
  151. scalebox/version.py +16 -0
  152. scalebox_sdk-0.1.0.dist-info/METADATA +292 -0
  153. scalebox_sdk-0.1.0.dist-info/RECORD +157 -0
  154. scalebox_sdk-0.1.0.dist-info/WHEEL +5 -0
  155. scalebox_sdk-0.1.0.dist-info/entry_points.txt +2 -0
  156. scalebox_sdk-0.1.0.dist-info/licenses/LICENSE +21 -0
  157. scalebox_sdk-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,115 @@
1
+ from collections.abc import Mapping
2
+ from typing import 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
+ T = TypeVar("T", bound="TemplateBuildRequest")
10
+
11
+
12
+ @_attrs_define
13
+ class TemplateBuildRequest:
14
+ """
15
+ Attributes:
16
+ dockerfile (str): Dockerfile for the template
17
+ alias (Union[Unset, str]): Alias of the template
18
+ cpu_count (Union[Unset, int]): CPU cores for the sandbox
19
+ memory_mb (Union[Unset, int]): Memory for the sandbox in MB
20
+ ready_cmd (Union[Unset, str]): Ready check command to execute in the template after the build
21
+ start_cmd (Union[Unset, str]): Start command to execute in the template after the build
22
+ team_id (Union[Unset, str]): Identifier of the team
23
+ """
24
+
25
+ dockerfile: str
26
+ alias: Union[Unset, str] = UNSET
27
+ cpu_count: Union[Unset, int] = UNSET
28
+ memory_mb: Union[Unset, int] = UNSET
29
+ ready_cmd: Union[Unset, str] = UNSET
30
+ start_cmd: Union[Unset, str] = UNSET
31
+ team_id: Union[Unset, str] = UNSET
32
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ dockerfile = self.dockerfile
36
+
37
+ alias = self.alias
38
+
39
+ cpu_count = self.cpu_count
40
+
41
+ memory_mb = self.memory_mb
42
+
43
+ ready_cmd = self.ready_cmd
44
+
45
+ start_cmd = self.start_cmd
46
+
47
+ team_id = self.team_id
48
+
49
+ field_dict: dict[str, Any] = {}
50
+ field_dict.update(self.additional_properties)
51
+ field_dict.update(
52
+ {
53
+ "dockerfile": dockerfile,
54
+ }
55
+ )
56
+ if alias is not UNSET:
57
+ field_dict["alias"] = alias
58
+ if cpu_count is not UNSET:
59
+ field_dict["cpuCount"] = cpu_count
60
+ if memory_mb is not UNSET:
61
+ field_dict["memoryMB"] = memory_mb
62
+ if ready_cmd is not UNSET:
63
+ field_dict["readyCmd"] = ready_cmd
64
+ if start_cmd is not UNSET:
65
+ field_dict["startCmd"] = start_cmd
66
+ if team_id is not UNSET:
67
+ field_dict["teamID"] = team_id
68
+
69
+ return field_dict
70
+
71
+ @classmethod
72
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
73
+ d = dict(src_dict)
74
+ dockerfile = d.pop("dockerfile")
75
+
76
+ alias = d.pop("alias", UNSET)
77
+
78
+ cpu_count = d.pop("cpuCount", UNSET)
79
+
80
+ memory_mb = d.pop("memoryMB", UNSET)
81
+
82
+ ready_cmd = d.pop("readyCmd", UNSET)
83
+
84
+ start_cmd = d.pop("startCmd", UNSET)
85
+
86
+ team_id = d.pop("teamID", UNSET)
87
+
88
+ template_build_request = cls(
89
+ dockerfile=dockerfile,
90
+ alias=alias,
91
+ cpu_count=cpu_count,
92
+ memory_mb=memory_mb,
93
+ ready_cmd=ready_cmd,
94
+ start_cmd=start_cmd,
95
+ team_id=team_id,
96
+ )
97
+
98
+ template_build_request.additional_properties = d
99
+ return template_build_request
100
+
101
+ @property
102
+ def additional_keys(self) -> list[str]:
103
+ return list(self.additional_properties.keys())
104
+
105
+ def __getitem__(self, key: str) -> Any:
106
+ return self.additional_properties[key]
107
+
108
+ def __setitem__(self, key: str, value: Any) -> None:
109
+ self.additional_properties[key] = value
110
+
111
+ def __delitem__(self, key: str) -> None:
112
+ del self.additional_properties[key]
113
+
114
+ def __contains__(self, key: str) -> bool:
115
+ return key in self.additional_properties
@@ -0,0 +1,88 @@
1
+ from collections.abc import Mapping
2
+ from typing import 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
+ T = TypeVar("T", bound="TemplateBuildRequestV2")
10
+
11
+
12
+ @_attrs_define
13
+ class TemplateBuildRequestV2:
14
+ """
15
+ Attributes:
16
+ alias (str): Alias of the template
17
+ cpu_count (Union[Unset, int]): CPU cores for the sandbox
18
+ memory_mb (Union[Unset, int]): Memory for the sandbox in MB
19
+ team_id (Union[Unset, str]): Identifier of the team
20
+ """
21
+
22
+ alias: str
23
+ cpu_count: Union[Unset, int] = UNSET
24
+ memory_mb: Union[Unset, int] = UNSET
25
+ team_id: Union[Unset, str] = UNSET
26
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
27
+
28
+ def to_dict(self) -> dict[str, Any]:
29
+ alias = self.alias
30
+
31
+ cpu_count = self.cpu_count
32
+
33
+ memory_mb = self.memory_mb
34
+
35
+ team_id = self.team_id
36
+
37
+ field_dict: dict[str, Any] = {}
38
+ field_dict.update(self.additional_properties)
39
+ field_dict.update(
40
+ {
41
+ "alias": alias,
42
+ }
43
+ )
44
+ if cpu_count is not UNSET:
45
+ field_dict["cpuCount"] = cpu_count
46
+ if memory_mb is not UNSET:
47
+ field_dict["memoryMB"] = memory_mb
48
+ if team_id is not UNSET:
49
+ field_dict["teamID"] = team_id
50
+
51
+ return field_dict
52
+
53
+ @classmethod
54
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
55
+ d = dict(src_dict)
56
+ alias = d.pop("alias")
57
+
58
+ cpu_count = d.pop("cpuCount", UNSET)
59
+
60
+ memory_mb = d.pop("memoryMB", UNSET)
61
+
62
+ team_id = d.pop("teamID", UNSET)
63
+
64
+ template_build_request_v2 = cls(
65
+ alias=alias,
66
+ cpu_count=cpu_count,
67
+ memory_mb=memory_mb,
68
+ team_id=team_id,
69
+ )
70
+
71
+ template_build_request_v2.additional_properties = d
72
+ return template_build_request_v2
73
+
74
+ @property
75
+ def additional_keys(self) -> list[str]:
76
+ return list(self.additional_properties.keys())
77
+
78
+ def __getitem__(self, key: str) -> Any:
79
+ return self.additional_properties[key]
80
+
81
+ def __setitem__(self, key: str, value: Any) -> None:
82
+ self.additional_properties[key] = value
83
+
84
+ def __delitem__(self, key: str) -> None:
85
+ del self.additional_properties[key]
86
+
87
+ def __contains__(self, key: str) -> bool:
88
+ return key in self.additional_properties
@@ -0,0 +1,114 @@
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.template_step import TemplateStep
11
+
12
+
13
+ T = TypeVar("T", bound="TemplateBuildStartV2")
14
+
15
+
16
+ @_attrs_define
17
+ class TemplateBuildStartV2:
18
+ """
19
+ Attributes:
20
+ from_image (str): Image to use as a base for the template build
21
+ force (Union[Unset, bool]): Whether the whole build should be forced to run regardless of the cache Default:
22
+ False.
23
+ ready_cmd (Union[Unset, str]): Ready check command to execute in the template after the build
24
+ start_cmd (Union[Unset, str]): Start command to execute in the template after the build
25
+ steps (Union[Unset, list['TemplateStep']]): List of steps to execute in the template build
26
+ """
27
+
28
+ from_image: str
29
+ force: Union[Unset, bool] = False
30
+ ready_cmd: Union[Unset, str] = UNSET
31
+ start_cmd: Union[Unset, str] = UNSET
32
+ steps: Union[Unset, list["TemplateStep"]] = UNSET
33
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
34
+
35
+ def to_dict(self) -> dict[str, Any]:
36
+ from_image = self.from_image
37
+
38
+ force = self.force
39
+
40
+ ready_cmd = self.ready_cmd
41
+
42
+ start_cmd = self.start_cmd
43
+
44
+ steps: Union[Unset, list[dict[str, Any]]] = UNSET
45
+ if not isinstance(self.steps, Unset):
46
+ steps = []
47
+ for steps_item_data in self.steps:
48
+ steps_item = steps_item_data.to_dict()
49
+ steps.append(steps_item)
50
+
51
+ field_dict: dict[str, Any] = {}
52
+ field_dict.update(self.additional_properties)
53
+ field_dict.update(
54
+ {
55
+ "fromImage": from_image,
56
+ }
57
+ )
58
+ if force is not UNSET:
59
+ field_dict["force"] = force
60
+ if ready_cmd is not UNSET:
61
+ field_dict["readyCmd"] = ready_cmd
62
+ if start_cmd is not UNSET:
63
+ field_dict["startCmd"] = start_cmd
64
+ if steps is not UNSET:
65
+ field_dict["steps"] = steps
66
+
67
+ return field_dict
68
+
69
+ @classmethod
70
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
71
+ from ..models.template_step import TemplateStep
72
+
73
+ d = dict(src_dict)
74
+ from_image = d.pop("fromImage")
75
+
76
+ force = d.pop("force", UNSET)
77
+
78
+ ready_cmd = d.pop("readyCmd", UNSET)
79
+
80
+ start_cmd = d.pop("startCmd", UNSET)
81
+
82
+ steps = []
83
+ _steps = d.pop("steps", UNSET)
84
+ for steps_item_data in _steps or []:
85
+ steps_item = TemplateStep.from_dict(steps_item_data)
86
+
87
+ steps.append(steps_item)
88
+
89
+ template_build_start_v2 = cls(
90
+ from_image=from_image,
91
+ force=force,
92
+ ready_cmd=ready_cmd,
93
+ start_cmd=start_cmd,
94
+ steps=steps,
95
+ )
96
+
97
+ template_build_start_v2.additional_properties = d
98
+ return template_build_start_v2
99
+
100
+ @property
101
+ def additional_keys(self) -> list[str]:
102
+ return list(self.additional_properties.keys())
103
+
104
+ def __getitem__(self, key: str) -> Any:
105
+ return self.additional_properties[key]
106
+
107
+ def __setitem__(self, key: str, value: Any) -> None:
108
+ self.additional_properties[key] = value
109
+
110
+ def __delitem__(self, key: str) -> None:
111
+ del self.additional_properties[key]
112
+
113
+ def __contains__(self, key: str) -> bool:
114
+ return key in self.additional_properties
@@ -0,0 +1,11 @@
1
+ from enum import Enum
2
+
3
+
4
+ class TemplateBuildStatus(str, Enum):
5
+ BUILDING = "building"
6
+ ERROR = "error"
7
+ READY = "ready"
8
+ WAITING = "waiting"
9
+
10
+ def __str__(self) -> str:
11
+ return str(self.value)
@@ -0,0 +1,91 @@
1
+ from collections.abc import Mapping
2
+ from typing import 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
+ T = TypeVar("T", bound="TemplateStep")
10
+
11
+
12
+ @_attrs_define
13
+ class TemplateStep:
14
+ """Step in the template build process
15
+
16
+ Attributes:
17
+ type_ (str): Type of the step
18
+ args (Union[Unset, list[str]]): Arguments for the step
19
+ files_hash (Union[Unset, str]): Hash of the files used in the step
20
+ force (Union[Unset, bool]): Whether the step should be forced to run regardless of the cache Default: False.
21
+ """
22
+
23
+ type_: str
24
+ args: Union[Unset, list[str]] = UNSET
25
+ files_hash: Union[Unset, str] = UNSET
26
+ force: Union[Unset, bool] = False
27
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
+
29
+ def to_dict(self) -> dict[str, Any]:
30
+ type_ = self.type_
31
+
32
+ args: Union[Unset, list[str]] = UNSET
33
+ if not isinstance(self.args, Unset):
34
+ args = self.args
35
+
36
+ files_hash = self.files_hash
37
+
38
+ force = self.force
39
+
40
+ field_dict: dict[str, Any] = {}
41
+ field_dict.update(self.additional_properties)
42
+ field_dict.update(
43
+ {
44
+ "type": type_,
45
+ }
46
+ )
47
+ if args is not UNSET:
48
+ field_dict["args"] = args
49
+ if files_hash is not UNSET:
50
+ field_dict["filesHash"] = files_hash
51
+ if force is not UNSET:
52
+ field_dict["force"] = force
53
+
54
+ return field_dict
55
+
56
+ @classmethod
57
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
58
+ d = dict(src_dict)
59
+ type_ = d.pop("type")
60
+
61
+ args = cast(list[str], d.pop("args", UNSET))
62
+
63
+ files_hash = d.pop("filesHash", UNSET)
64
+
65
+ force = d.pop("force", UNSET)
66
+
67
+ template_step = cls(
68
+ type_=type_,
69
+ args=args,
70
+ files_hash=files_hash,
71
+ force=force,
72
+ )
73
+
74
+ template_step.additional_properties = d
75
+ return template_step
76
+
77
+ @property
78
+ def additional_keys(self) -> list[str]:
79
+ return list(self.additional_properties.keys())
80
+
81
+ def __getitem__(self, key: str) -> Any:
82
+ return self.additional_properties[key]
83
+
84
+ def __setitem__(self, key: str, value: Any) -> None:
85
+ self.additional_properties[key] = value
86
+
87
+ def __delitem__(self, key: str) -> None:
88
+ del self.additional_properties[key]
89
+
90
+ def __contains__(self, key: str) -> bool:
91
+ return key in self.additional_properties
@@ -0,0 +1,59 @@
1
+ from collections.abc import Mapping
2
+ from typing import 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
+ T = TypeVar("T", bound="TemplateUpdateRequest")
10
+
11
+
12
+ @_attrs_define
13
+ class TemplateUpdateRequest:
14
+ """
15
+ Attributes:
16
+ public (Union[Unset, bool]): Whether the template is public or only accessible by the team
17
+ """
18
+
19
+ public: Union[Unset, bool] = UNSET
20
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
21
+
22
+ def to_dict(self) -> dict[str, Any]:
23
+ public = self.public
24
+
25
+ field_dict: dict[str, Any] = {}
26
+ field_dict.update(self.additional_properties)
27
+ field_dict.update({})
28
+ if public is not UNSET:
29
+ field_dict["public"] = public
30
+
31
+ return field_dict
32
+
33
+ @classmethod
34
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
35
+ d = dict(src_dict)
36
+ public = d.pop("public", UNSET)
37
+
38
+ template_update_request = cls(
39
+ public=public,
40
+ )
41
+
42
+ template_update_request.additional_properties = d
43
+ return template_update_request
44
+
45
+ @property
46
+ def additional_keys(self) -> list[str]:
47
+ return list(self.additional_properties.keys())
48
+
49
+ def __getitem__(self, key: str) -> Any:
50
+ return self.additional_properties[key]
51
+
52
+ def __setitem__(self, key: str, value: Any) -> None:
53
+ self.additional_properties[key] = value
54
+
55
+ def __delitem__(self, key: str) -> None:
56
+ del self.additional_properties[key]
57
+
58
+ def __contains__(self, key: str) -> bool:
59
+ return key in self.additional_properties
@@ -0,0 +1,59 @@
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="UpdateTeamAPIKey")
8
+
9
+
10
+ @_attrs_define
11
+ class UpdateTeamAPIKey:
12
+ """
13
+ Attributes:
14
+ name (str): New name for the API key
15
+ """
16
+
17
+ name: str
18
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
19
+
20
+ def to_dict(self) -> dict[str, Any]:
21
+ name = self.name
22
+
23
+ field_dict: dict[str, Any] = {}
24
+ field_dict.update(self.additional_properties)
25
+ field_dict.update(
26
+ {
27
+ "name": name,
28
+ }
29
+ )
30
+
31
+ return field_dict
32
+
33
+ @classmethod
34
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
35
+ d = dict(src_dict)
36
+ name = d.pop("name")
37
+
38
+ update_team_api_key = cls(
39
+ name=name,
40
+ )
41
+
42
+ update_team_api_key.additional_properties = d
43
+ return update_team_api_key
44
+
45
+ @property
46
+ def additional_keys(self) -> list[str]:
47
+ return list(self.additional_properties.keys())
48
+
49
+ def __getitem__(self, key: str) -> Any:
50
+ return self.additional_properties[key]
51
+
52
+ def __setitem__(self, key: str, value: Any) -> None:
53
+ self.additional_properties[key] = value
54
+
55
+ def __delitem__(self, key: str) -> None:
56
+ del self.additional_properties[key]
57
+
58
+ def __contains__(self, key: str) -> bool:
59
+ return key in self.additional_properties
@@ -0,0 +1 @@
1
+ # Marker file for PEP 561
@@ -0,0 +1,46 @@
1
+ """Contains some shared types for properties"""
2
+
3
+ from collections.abc import MutableMapping
4
+ from http import HTTPStatus
5
+ from typing import BinaryIO, Generic, Literal, Optional, TypeVar
6
+
7
+ from attrs import define
8
+
9
+
10
+ class Unset:
11
+ def __bool__(self) -> Literal[False]:
12
+ return False
13
+
14
+
15
+ UNSET: Unset = Unset()
16
+
17
+ FileJsonType = tuple[Optional[str], BinaryIO, Optional[str]]
18
+
19
+
20
+ @define
21
+ class File:
22
+ """Contains information for file uploads"""
23
+
24
+ payload: BinaryIO
25
+ file_name: Optional[str] = None
26
+ mime_type: Optional[str] = None
27
+
28
+ def to_tuple(self) -> FileJsonType:
29
+ """Return a tuple representation that httpx will accept for multipart/form-data"""
30
+ return self.file_name, self.payload, self.mime_type
31
+
32
+
33
+ T = TypeVar("T")
34
+
35
+
36
+ @define
37
+ class Response(Generic[T]):
38
+ """A response from an endpoint"""
39
+
40
+ status_code: HTTPStatus
41
+ content: bytes
42
+ headers: MutableMapping[str, str]
43
+ parsed: Optional[T]
44
+
45
+
46
+ __all__ = ["UNSET", "File", "FileJsonType", "Response", "Unset"]
@@ -0,0 +1,19 @@
1
+ import platform
2
+
3
+ # from importlib import metadata
4
+
5
+ # package_version = metadata.version("scalebox")
6
+ #
7
+ # default_headers = {
8
+ # "lang": "python",
9
+ # "lang_version": platform.python_version(),
10
+ # "machine": platform.machine(),
11
+ # "os": platform.platform(),
12
+ # "package_version": metadata.version("csx"),
13
+ # "processor": platform.processor(),
14
+ # "publisher": "csx",
15
+ # "release": platform.release(),
16
+ # "sdk_runtime": "python",
17
+ # "system": platform.system(),
18
+ # }
19
+ default_headers = {}