daytona_api_client 0.103.0rc3__py3-none-any.whl → 0.104.0rc2__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.

Potentially problematic release.


This version of daytona_api_client might be problematic. Click here for more details.

@@ -28,6 +28,7 @@ from daytona_api_client.models.computer_use_status_response import ComputerUseSt
28
28
  from daytona_api_client.models.computer_use_stop_response import ComputerUseStopResponse
29
29
  from daytona_api_client.models.create_session_request import CreateSessionRequest
30
30
  from daytona_api_client.models.display_info_response import DisplayInfoResponse
31
+ from daytona_api_client.models.download_files import DownloadFiles
31
32
  from daytona_api_client.models.execute_request import ExecuteRequest
32
33
  from daytona_api_client.models.execute_response import ExecuteResponse
33
34
  from daytona_api_client.models.file_info import FileInfo
@@ -1609,7 +1610,7 @@ class ToolboxApi:
1609
1610
  _headers: Optional[Dict[StrictStr, Any]] = None,
1610
1611
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1611
1612
  ) -> bytearray:
1612
- """Download file
1613
+ """(Deprecated) Download file
1613
1614
 
1614
1615
  Download file from sandbox
1615
1616
 
@@ -1640,6 +1641,7 @@ class ToolboxApi:
1640
1641
  :type _host_index: int, optional
1641
1642
  :return: Returns the result object.
1642
1643
  """ # noqa: E501
1644
+ warnings.warn("GET /toolbox/{sandboxId}/toolbox/files/download is deprecated.", DeprecationWarning)
1643
1645
 
1644
1646
  _param = self._download_file_serialize(
1645
1647
  sandbox_id=sandbox_id,
@@ -1684,7 +1686,7 @@ class ToolboxApi:
1684
1686
  _headers: Optional[Dict[StrictStr, Any]] = None,
1685
1687
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1686
1688
  ) -> ApiResponse[bytearray]:
1687
- """Download file
1689
+ """(Deprecated) Download file
1688
1690
 
1689
1691
  Download file from sandbox
1690
1692
 
@@ -1715,6 +1717,7 @@ class ToolboxApi:
1715
1717
  :type _host_index: int, optional
1716
1718
  :return: Returns the result object.
1717
1719
  """ # noqa: E501
1720
+ warnings.warn("GET /toolbox/{sandboxId}/toolbox/files/download is deprecated.", DeprecationWarning)
1718
1721
 
1719
1722
  _param = self._download_file_serialize(
1720
1723
  sandbox_id=sandbox_id,
@@ -1759,7 +1762,7 @@ class ToolboxApi:
1759
1762
  _headers: Optional[Dict[StrictStr, Any]] = None,
1760
1763
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1761
1764
  ) -> RESTResponseType:
1762
- """Download file
1765
+ """(Deprecated) Download file
1763
1766
 
1764
1767
  Download file from sandbox
1765
1768
 
@@ -1790,6 +1793,7 @@ class ToolboxApi:
1790
1793
  :type _host_index: int, optional
1791
1794
  :return: Returns the result object.
1792
1795
  """ # noqa: E501
1796
+ warnings.warn("GET /toolbox/{sandboxId}/toolbox/files/download is deprecated.", DeprecationWarning)
1793
1797
 
1794
1798
  _param = self._download_file_serialize(
1795
1799
  sandbox_id=sandbox_id,
@@ -1884,6 +1888,311 @@ class ToolboxApi:
1884
1888
 
1885
1889
 
1886
1890
 
1891
+ @validate_call
1892
+ def download_files(
1893
+ self,
1894
+ sandbox_id: StrictStr,
1895
+ download_files: DownloadFiles,
1896
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1897
+ _request_timeout: Union[
1898
+ None,
1899
+ Annotated[StrictFloat, Field(gt=0)],
1900
+ Tuple[
1901
+ Annotated[StrictFloat, Field(gt=0)],
1902
+ Annotated[StrictFloat, Field(gt=0)]
1903
+ ]
1904
+ ] = None,
1905
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1906
+ _content_type: Optional[StrictStr] = None,
1907
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1908
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1909
+ ) -> bytearray:
1910
+ """Download multiple files
1911
+
1912
+ Streams back a multipart/form-data bundle of the requested paths
1913
+
1914
+ :param sandbox_id: (required)
1915
+ :type sandbox_id: str
1916
+ :param download_files: (required)
1917
+ :type download_files: DownloadFiles
1918
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1919
+ :type x_daytona_organization_id: str
1920
+ :param _request_timeout: timeout setting for this request. If one
1921
+ number provided, it will be total request
1922
+ timeout. It can also be a pair (tuple) of
1923
+ (connection, read) timeouts.
1924
+ :type _request_timeout: int, tuple(int, int), optional
1925
+ :param _request_auth: set to override the auth_settings for an a single
1926
+ request; this effectively ignores the
1927
+ authentication in the spec for a single request.
1928
+ :type _request_auth: dict, optional
1929
+ :param _content_type: force content-type for the request.
1930
+ :type _content_type: str, Optional
1931
+ :param _headers: set to override the headers for a single
1932
+ request; this effectively ignores the headers
1933
+ in the spec for a single request.
1934
+ :type _headers: dict, optional
1935
+ :param _host_index: set to override the host_index for a single
1936
+ request; this effectively ignores the host_index
1937
+ in the spec for a single request.
1938
+ :type _host_index: int, optional
1939
+ :return: Returns the result object.
1940
+ """ # noqa: E501
1941
+
1942
+ _param = self._download_files_serialize(
1943
+ sandbox_id=sandbox_id,
1944
+ download_files=download_files,
1945
+ x_daytona_organization_id=x_daytona_organization_id,
1946
+ _request_auth=_request_auth,
1947
+ _content_type=_content_type,
1948
+ _headers=_headers,
1949
+ _host_index=_host_index
1950
+ )
1951
+
1952
+ _response_types_map: Dict[str, Optional[str]] = {
1953
+ '200': "bytearray",
1954
+ }
1955
+ response_data = self.api_client.call_api(
1956
+ *_param,
1957
+ _request_timeout=_request_timeout
1958
+ )
1959
+ response_data.read()
1960
+ return self.api_client.response_deserialize(
1961
+ response_data=response_data,
1962
+ response_types_map=_response_types_map,
1963
+ ).data
1964
+
1965
+
1966
+ @validate_call
1967
+ def download_files_with_http_info(
1968
+ self,
1969
+ sandbox_id: StrictStr,
1970
+ download_files: DownloadFiles,
1971
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1972
+ _request_timeout: Union[
1973
+ None,
1974
+ Annotated[StrictFloat, Field(gt=0)],
1975
+ Tuple[
1976
+ Annotated[StrictFloat, Field(gt=0)],
1977
+ Annotated[StrictFloat, Field(gt=0)]
1978
+ ]
1979
+ ] = None,
1980
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1981
+ _content_type: Optional[StrictStr] = None,
1982
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1983
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1984
+ ) -> ApiResponse[bytearray]:
1985
+ """Download multiple files
1986
+
1987
+ Streams back a multipart/form-data bundle of the requested paths
1988
+
1989
+ :param sandbox_id: (required)
1990
+ :type sandbox_id: str
1991
+ :param download_files: (required)
1992
+ :type download_files: DownloadFiles
1993
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1994
+ :type x_daytona_organization_id: str
1995
+ :param _request_timeout: timeout setting for this request. If one
1996
+ number provided, it will be total request
1997
+ timeout. It can also be a pair (tuple) of
1998
+ (connection, read) timeouts.
1999
+ :type _request_timeout: int, tuple(int, int), optional
2000
+ :param _request_auth: set to override the auth_settings for an a single
2001
+ request; this effectively ignores the
2002
+ authentication in the spec for a single request.
2003
+ :type _request_auth: dict, optional
2004
+ :param _content_type: force content-type for the request.
2005
+ :type _content_type: str, Optional
2006
+ :param _headers: set to override the headers for a single
2007
+ request; this effectively ignores the headers
2008
+ in the spec for a single request.
2009
+ :type _headers: dict, optional
2010
+ :param _host_index: set to override the host_index for a single
2011
+ request; this effectively ignores the host_index
2012
+ in the spec for a single request.
2013
+ :type _host_index: int, optional
2014
+ :return: Returns the result object.
2015
+ """ # noqa: E501
2016
+
2017
+ _param = self._download_files_serialize(
2018
+ sandbox_id=sandbox_id,
2019
+ download_files=download_files,
2020
+ x_daytona_organization_id=x_daytona_organization_id,
2021
+ _request_auth=_request_auth,
2022
+ _content_type=_content_type,
2023
+ _headers=_headers,
2024
+ _host_index=_host_index
2025
+ )
2026
+
2027
+ _response_types_map: Dict[str, Optional[str]] = {
2028
+ '200': "bytearray",
2029
+ }
2030
+ response_data = self.api_client.call_api(
2031
+ *_param,
2032
+ _request_timeout=_request_timeout
2033
+ )
2034
+ response_data.read()
2035
+ return self.api_client.response_deserialize(
2036
+ response_data=response_data,
2037
+ response_types_map=_response_types_map,
2038
+ )
2039
+
2040
+
2041
+ @validate_call
2042
+ def download_files_without_preload_content(
2043
+ self,
2044
+ sandbox_id: StrictStr,
2045
+ download_files: DownloadFiles,
2046
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
2047
+ _request_timeout: Union[
2048
+ None,
2049
+ Annotated[StrictFloat, Field(gt=0)],
2050
+ Tuple[
2051
+ Annotated[StrictFloat, Field(gt=0)],
2052
+ Annotated[StrictFloat, Field(gt=0)]
2053
+ ]
2054
+ ] = None,
2055
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2056
+ _content_type: Optional[StrictStr] = None,
2057
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2058
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2059
+ ) -> RESTResponseType:
2060
+ """Download multiple files
2061
+
2062
+ Streams back a multipart/form-data bundle of the requested paths
2063
+
2064
+ :param sandbox_id: (required)
2065
+ :type sandbox_id: str
2066
+ :param download_files: (required)
2067
+ :type download_files: DownloadFiles
2068
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2069
+ :type x_daytona_organization_id: str
2070
+ :param _request_timeout: timeout setting for this request. If one
2071
+ number provided, it will be total request
2072
+ timeout. It can also be a pair (tuple) of
2073
+ (connection, read) timeouts.
2074
+ :type _request_timeout: int, tuple(int, int), optional
2075
+ :param _request_auth: set to override the auth_settings for an a single
2076
+ request; this effectively ignores the
2077
+ authentication in the spec for a single request.
2078
+ :type _request_auth: dict, optional
2079
+ :param _content_type: force content-type for the request.
2080
+ :type _content_type: str, Optional
2081
+ :param _headers: set to override the headers for a single
2082
+ request; this effectively ignores the headers
2083
+ in the spec for a single request.
2084
+ :type _headers: dict, optional
2085
+ :param _host_index: set to override the host_index for a single
2086
+ request; this effectively ignores the host_index
2087
+ in the spec for a single request.
2088
+ :type _host_index: int, optional
2089
+ :return: Returns the result object.
2090
+ """ # noqa: E501
2091
+
2092
+ _param = self._download_files_serialize(
2093
+ sandbox_id=sandbox_id,
2094
+ download_files=download_files,
2095
+ x_daytona_organization_id=x_daytona_organization_id,
2096
+ _request_auth=_request_auth,
2097
+ _content_type=_content_type,
2098
+ _headers=_headers,
2099
+ _host_index=_host_index
2100
+ )
2101
+
2102
+ _response_types_map: Dict[str, Optional[str]] = {
2103
+ '200': "bytearray",
2104
+ }
2105
+ response_data = self.api_client.call_api(
2106
+ *_param,
2107
+ _request_timeout=_request_timeout
2108
+ )
2109
+ return response_data.response
2110
+
2111
+
2112
+ def _download_files_serialize(
2113
+ self,
2114
+ sandbox_id,
2115
+ download_files,
2116
+ x_daytona_organization_id,
2117
+ _request_auth,
2118
+ _content_type,
2119
+ _headers,
2120
+ _host_index,
2121
+ ) -> RequestSerialized:
2122
+
2123
+ _host = None
2124
+
2125
+ _collection_formats: Dict[str, str] = {
2126
+ }
2127
+
2128
+ _path_params: Dict[str, str] = {}
2129
+ _query_params: List[Tuple[str, str]] = []
2130
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2131
+ _form_params: List[Tuple[str, str]] = []
2132
+ _files: Dict[
2133
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2134
+ ] = {}
2135
+ _body_params: Optional[bytes] = None
2136
+
2137
+ # process the path parameters
2138
+ if sandbox_id is not None:
2139
+ _path_params['sandboxId'] = sandbox_id
2140
+ # process the query parameters
2141
+ # process the header parameters
2142
+ if x_daytona_organization_id is not None:
2143
+ _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
2144
+ # process the form parameters
2145
+ # process the body parameter
2146
+ if download_files is not None:
2147
+ _body_params = download_files
2148
+
2149
+
2150
+ # set the HTTP header `Accept`
2151
+ if 'Accept' not in _header_params:
2152
+ _header_params['Accept'] = self.api_client.select_header_accept(
2153
+ [
2154
+ 'application/json'
2155
+ ]
2156
+ )
2157
+
2158
+ # set the HTTP header `Content-Type`
2159
+ if _content_type:
2160
+ _header_params['Content-Type'] = _content_type
2161
+ else:
2162
+ _default_content_type = (
2163
+ self.api_client.select_header_content_type(
2164
+ [
2165
+ 'application/json'
2166
+ ]
2167
+ )
2168
+ )
2169
+ if _default_content_type is not None:
2170
+ _header_params['Content-Type'] = _default_content_type
2171
+
2172
+ # authentication setting
2173
+ _auth_settings: List[str] = [
2174
+ 'bearer',
2175
+ 'oauth2'
2176
+ ]
2177
+
2178
+ return self.api_client.param_serialize(
2179
+ method='POST',
2180
+ resource_path='/toolbox/{sandboxId}/toolbox/files/bulk-download',
2181
+ path_params=_path_params,
2182
+ query_params=_query_params,
2183
+ header_params=_header_params,
2184
+ body=_body_params,
2185
+ post_params=_form_params,
2186
+ files=_files,
2187
+ auth_settings=_auth_settings,
2188
+ collection_formats=_collection_formats,
2189
+ _host=_host,
2190
+ _request_auth=_request_auth
2191
+ )
2192
+
2193
+
2194
+
2195
+
1887
2196
  @validate_call
1888
2197
  def drag_mouse(
1889
2198
  self,
@@ -16,6 +16,7 @@
16
16
 
17
17
  # import models into model package
18
18
  from daytona_api_client.models.account_provider import AccountProvider
19
+ from daytona_api_client.models.announcement import Announcement
19
20
  from daytona_api_client.models.api_key_list import ApiKeyList
20
21
  from daytona_api_client.models.api_key_response import ApiKeyResponse
21
22
  from daytona_api_client.models.audit_log import AuditLog
@@ -44,8 +45,10 @@ from daytona_api_client.models.create_snapshot import CreateSnapshot
44
45
  from daytona_api_client.models.create_user import CreateUser
45
46
  from daytona_api_client.models.create_volume import CreateVolume
46
47
  from daytona_api_client.models.create_workspace import CreateWorkspace
48
+ from daytona_api_client.models.daytona_configuration import DaytonaConfiguration
47
49
  from daytona_api_client.models.display_info_response import DisplayInfoResponse
48
50
  from daytona_api_client.models.docker_registry import DockerRegistry
51
+ from daytona_api_client.models.download_files import DownloadFiles
49
52
  from daytona_api_client.models.execute_request import ExecuteRequest
50
53
  from daytona_api_client.models.execute_response import ExecuteResponse
51
54
  from daytona_api_client.models.file_info import FileInfo
@@ -82,6 +85,7 @@ from daytona_api_client.models.mouse_move_response import MouseMoveResponse
82
85
  from daytona_api_client.models.mouse_position import MousePosition
83
86
  from daytona_api_client.models.mouse_scroll_request import MouseScrollRequest
84
87
  from daytona_api_client.models.mouse_scroll_response import MouseScrollResponse
88
+ from daytona_api_client.models.oidc_config import OidcConfig
85
89
  from daytona_api_client.models.organization import Organization
86
90
  from daytona_api_client.models.organization_invitation import OrganizationInvitation
87
91
  from daytona_api_client.models.organization_role import OrganizationRole
@@ -93,6 +97,7 @@ from daytona_api_client.models.paginated_audit_logs import PaginatedAuditLogs
93
97
  from daytona_api_client.models.paginated_snapshots_dto import PaginatedSnapshotsDto
94
98
  from daytona_api_client.models.port_preview_url import PortPreviewUrl
95
99
  from daytona_api_client.models.position import Position
100
+ from daytona_api_client.models.posthog_config import PosthogConfig
96
101
  from daytona_api_client.models.process_errors_response import ProcessErrorsResponse
97
102
  from daytona_api_client.models.process_logs_response import ProcessLogsResponse
98
103
  from daytona_api_client.models.process_restart_response import ProcessRestartResponse
@@ -130,6 +135,7 @@ from daytona_api_client.models.update_organization_invitation import UpdateOrgan
130
135
  from daytona_api_client.models.update_organization_member_access import UpdateOrganizationMemberAccess
131
136
  from daytona_api_client.models.update_organization_quota import UpdateOrganizationQuota
132
137
  from daytona_api_client.models.update_organization_role import UpdateOrganizationRole
138
+ from daytona_api_client.models.update_sandbox_state_dto import UpdateSandboxStateDto
133
139
  from daytona_api_client.models.user import User
134
140
  from daytona_api_client.models.user_home_dir_response import UserHomeDirResponse
135
141
  from daytona_api_client.models.user_public_key import UserPublicKey
@@ -0,0 +1,103 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Daytona
5
+
6
+ Daytona AI platform API Docs
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@daytona.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, 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 Announcement(BaseModel):
27
+ """
28
+ Announcement
29
+ """ # noqa: E501
30
+ text: StrictStr = Field(description="The announcement text")
31
+ learn_more_url: Optional[StrictStr] = Field(default=None, description="URL to learn more about the announcement", alias="learnMoreUrl")
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["text", "learnMoreUrl"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of Announcement from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ * Fields in `self.additional_properties` are added to the output dict.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ "additional_properties",
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # puts key-value pairs in additional_properties in the top level
77
+ if self.additional_properties is not None:
78
+ for _key, _value in self.additional_properties.items():
79
+ _dict[_key] = _value
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of Announcement from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "text": obj.get("text"),
94
+ "learnMoreUrl": obj.get("learnMoreUrl")
95
+ })
96
+ # store additional fields in additional_properties
97
+ for _key in obj.keys():
98
+ if _key not in cls.__properties:
99
+ _obj.additional_properties[_key] = obj.get(_key)
100
+
101
+ return _obj
102
+
103
+
@@ -0,0 +1,148 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Daytona
5
+
6
+ Daytona AI platform API Docs
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@daytona.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from daytona_api_client.models.announcement import Announcement
24
+ from daytona_api_client.models.oidc_config import OidcConfig
25
+ from daytona_api_client.models.posthog_config import PosthogConfig
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class DaytonaConfiguration(BaseModel):
30
+ """
31
+ DaytonaConfiguration
32
+ """ # noqa: E501
33
+ version: StrictStr = Field(description="Daytona version")
34
+ posthog: Optional[PosthogConfig] = Field(default=None, description="PostHog configuration")
35
+ oidc: OidcConfig = Field(description="OIDC configuration")
36
+ linked_accounts_enabled: StrictBool = Field(description="Whether linked accounts are enabled", alias="linkedAccountsEnabled")
37
+ announcements: Dict[str, Announcement] = Field(description="System announcements")
38
+ pylon_app_id: Optional[StrictStr] = Field(default=None, description="Pylon application ID", alias="pylonAppId")
39
+ proxy_template_url: StrictStr = Field(description="Proxy template URL", alias="proxyTemplateUrl")
40
+ default_snapshot: StrictStr = Field(description="Default snapshot for sandboxes", alias="defaultSnapshot")
41
+ dashboard_url: StrictStr = Field(description="Dashboard URL", alias="dashboardUrl")
42
+ max_auto_archive_interval: Union[StrictFloat, StrictInt] = Field(description="Maximum auto-archive interval in minutes", alias="maxAutoArchiveInterval")
43
+ maintanance_mode: StrictBool = Field(description="Whether maintenance mode is enabled", alias="maintananceMode")
44
+ environment: StrictStr = Field(description="Current environment")
45
+ billing_api_url: Optional[StrictStr] = Field(default=None, description="Billing API URL", alias="billingApiUrl")
46
+ ssh_gateway_command: Optional[StrictStr] = Field(default=None, description="SSH Gateway command", alias="sshGatewayCommand")
47
+ additional_properties: Dict[str, Any] = {}
48
+ __properties: ClassVar[List[str]] = ["version", "posthog", "oidc", "linkedAccountsEnabled", "announcements", "pylonAppId", "proxyTemplateUrl", "defaultSnapshot", "dashboardUrl", "maxAutoArchiveInterval", "maintananceMode", "environment", "billingApiUrl", "sshGatewayCommand"]
49
+
50
+ model_config = ConfigDict(
51
+ populate_by_name=True,
52
+ validate_assignment=True,
53
+ protected_namespaces=(),
54
+ )
55
+
56
+
57
+ def to_str(self) -> str:
58
+ """Returns the string representation of the model using alias"""
59
+ return pprint.pformat(self.model_dump(by_alias=True))
60
+
61
+ def to_json(self) -> str:
62
+ """Returns the JSON representation of the model using alias"""
63
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
64
+ return json.dumps(self.to_dict())
65
+
66
+ @classmethod
67
+ def from_json(cls, json_str: str) -> Optional[Self]:
68
+ """Create an instance of DaytonaConfiguration from a JSON string"""
69
+ return cls.from_dict(json.loads(json_str))
70
+
71
+ def to_dict(self) -> Dict[str, Any]:
72
+ """Return the dictionary representation of the model using alias.
73
+
74
+ This has the following differences from calling pydantic's
75
+ `self.model_dump(by_alias=True)`:
76
+
77
+ * `None` is only added to the output dict for nullable fields that
78
+ were set at model initialization. Other fields with value `None`
79
+ are ignored.
80
+ * Fields in `self.additional_properties` are added to the output dict.
81
+ """
82
+ excluded_fields: Set[str] = set([
83
+ "additional_properties",
84
+ ])
85
+
86
+ _dict = self.model_dump(
87
+ by_alias=True,
88
+ exclude=excluded_fields,
89
+ exclude_none=True,
90
+ )
91
+ # override the default output from pydantic by calling `to_dict()` of posthog
92
+ if self.posthog:
93
+ _dict['posthog'] = self.posthog.to_dict()
94
+ # override the default output from pydantic by calling `to_dict()` of oidc
95
+ if self.oidc:
96
+ _dict['oidc'] = self.oidc.to_dict()
97
+ # override the default output from pydantic by calling `to_dict()` of each value in announcements (dict)
98
+ _field_dict = {}
99
+ if self.announcements:
100
+ for _key_announcements in self.announcements:
101
+ if self.announcements[_key_announcements]:
102
+ _field_dict[_key_announcements] = self.announcements[_key_announcements].to_dict()
103
+ _dict['announcements'] = _field_dict
104
+ # puts key-value pairs in additional_properties in the top level
105
+ if self.additional_properties is not None:
106
+ for _key, _value in self.additional_properties.items():
107
+ _dict[_key] = _value
108
+
109
+ return _dict
110
+
111
+ @classmethod
112
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
113
+ """Create an instance of DaytonaConfiguration from a dict"""
114
+ if obj is None:
115
+ return None
116
+
117
+ if not isinstance(obj, dict):
118
+ return cls.model_validate(obj)
119
+
120
+ _obj = cls.model_validate({
121
+ "version": obj.get("version"),
122
+ "posthog": PosthogConfig.from_dict(obj["posthog"]) if obj.get("posthog") is not None else None,
123
+ "oidc": OidcConfig.from_dict(obj["oidc"]) if obj.get("oidc") is not None else None,
124
+ "linkedAccountsEnabled": obj.get("linkedAccountsEnabled"),
125
+ "announcements": dict(
126
+ (_k, Announcement.from_dict(_v))
127
+ for _k, _v in obj["announcements"].items()
128
+ )
129
+ if obj.get("announcements") is not None
130
+ else None,
131
+ "pylonAppId": obj.get("pylonAppId"),
132
+ "proxyTemplateUrl": obj.get("proxyTemplateUrl"),
133
+ "defaultSnapshot": obj.get("defaultSnapshot"),
134
+ "dashboardUrl": obj.get("dashboardUrl"),
135
+ "maxAutoArchiveInterval": obj.get("maxAutoArchiveInterval"),
136
+ "maintananceMode": obj.get("maintananceMode"),
137
+ "environment": obj.get("environment"),
138
+ "billingApiUrl": obj.get("billingApiUrl"),
139
+ "sshGatewayCommand": obj.get("sshGatewayCommand")
140
+ })
141
+ # store additional fields in additional_properties
142
+ for _key in obj.keys():
143
+ if _key not in cls.__properties:
144
+ _obj.additional_properties[_key] = obj.get(_key)
145
+
146
+ return _obj
147
+
148
+