daytona_api_client 0.27.1__py3-none-any.whl → 0.102.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.
@@ -116,6 +116,7 @@ from daytona_api_client.models.mouse_scroll_response import MouseScrollResponse
116
116
  from daytona_api_client.models.organization import Organization
117
117
  from daytona_api_client.models.organization_invitation import OrganizationInvitation
118
118
  from daytona_api_client.models.organization_role import OrganizationRole
119
+ from daytona_api_client.models.organization_sandbox_default_limited_network_egress import OrganizationSandboxDefaultLimitedNetworkEgress
119
120
  from daytona_api_client.models.organization_suspension import OrganizationSuspension
120
121
  from daytona_api_client.models.organization_usage_overview import OrganizationUsageOverview
121
122
  from daytona_api_client.models.organization_user import OrganizationUser
@@ -26,6 +26,7 @@ from daytona_api_client.models.create_organization_role import CreateOrganizatio
26
26
  from daytona_api_client.models.organization import Organization
27
27
  from daytona_api_client.models.organization_invitation import OrganizationInvitation
28
28
  from daytona_api_client.models.organization_role import OrganizationRole
29
+ from daytona_api_client.models.organization_sandbox_default_limited_network_egress import OrganizationSandboxDefaultLimitedNetworkEgress
29
30
  from daytona_api_client.models.organization_suspension import OrganizationSuspension
30
31
  from daytona_api_client.models.organization_usage_overview import OrganizationUsageOverview
31
32
  from daytona_api_client.models.organization_user import OrganizationUser
@@ -6716,3 +6717,283 @@ class OrganizationsApi:
6716
6717
  )
6717
6718
 
6718
6719
 
6720
+
6721
+
6722
+ @validate_call
6723
+ def update_sandbox_default_limited_network_egress(
6724
+ self,
6725
+ organization_id: Annotated[StrictStr, Field(description="Organization ID")],
6726
+ organization_sandbox_default_limited_network_egress: OrganizationSandboxDefaultLimitedNetworkEgress,
6727
+ _request_timeout: Union[
6728
+ None,
6729
+ Annotated[StrictFloat, Field(gt=0)],
6730
+ Tuple[
6731
+ Annotated[StrictFloat, Field(gt=0)],
6732
+ Annotated[StrictFloat, Field(gt=0)]
6733
+ ]
6734
+ ] = None,
6735
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
6736
+ _content_type: Optional[StrictStr] = None,
6737
+ _headers: Optional[Dict[StrictStr, Any]] = None,
6738
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
6739
+ ) -> None:
6740
+ """Update sandbox default limited network egress
6741
+
6742
+
6743
+ :param organization_id: Organization ID (required)
6744
+ :type organization_id: str
6745
+ :param organization_sandbox_default_limited_network_egress: (required)
6746
+ :type organization_sandbox_default_limited_network_egress: OrganizationSandboxDefaultLimitedNetworkEgress
6747
+ :param _request_timeout: timeout setting for this request. If one
6748
+ number provided, it will be total request
6749
+ timeout. It can also be a pair (tuple) of
6750
+ (connection, read) timeouts.
6751
+ :type _request_timeout: int, tuple(int, int), optional
6752
+ :param _request_auth: set to override the auth_settings for an a single
6753
+ request; this effectively ignores the
6754
+ authentication in the spec for a single request.
6755
+ :type _request_auth: dict, optional
6756
+ :param _content_type: force content-type for the request.
6757
+ :type _content_type: str, Optional
6758
+ :param _headers: set to override the headers for a single
6759
+ request; this effectively ignores the headers
6760
+ in the spec for a single request.
6761
+ :type _headers: dict, optional
6762
+ :param _host_index: set to override the host_index for a single
6763
+ request; this effectively ignores the host_index
6764
+ in the spec for a single request.
6765
+ :type _host_index: int, optional
6766
+ :return: Returns the result object.
6767
+ """ # noqa: E501
6768
+
6769
+ _param = self._update_sandbox_default_limited_network_egress_serialize(
6770
+ organization_id=organization_id,
6771
+ organization_sandbox_default_limited_network_egress=organization_sandbox_default_limited_network_egress,
6772
+ _request_auth=_request_auth,
6773
+ _content_type=_content_type,
6774
+ _headers=_headers,
6775
+ _host_index=_host_index
6776
+ )
6777
+
6778
+ _response_types_map: Dict[str, Optional[str]] = {
6779
+ '204': None,
6780
+ }
6781
+ response_data = self.api_client.call_api(
6782
+ *_param,
6783
+ _request_timeout=_request_timeout
6784
+ )
6785
+ response_data.read()
6786
+ return self.api_client.response_deserialize(
6787
+ response_data=response_data,
6788
+ response_types_map=_response_types_map,
6789
+ ).data
6790
+
6791
+
6792
+ @validate_call
6793
+ def update_sandbox_default_limited_network_egress_with_http_info(
6794
+ self,
6795
+ organization_id: Annotated[StrictStr, Field(description="Organization ID")],
6796
+ organization_sandbox_default_limited_network_egress: OrganizationSandboxDefaultLimitedNetworkEgress,
6797
+ _request_timeout: Union[
6798
+ None,
6799
+ Annotated[StrictFloat, Field(gt=0)],
6800
+ Tuple[
6801
+ Annotated[StrictFloat, Field(gt=0)],
6802
+ Annotated[StrictFloat, Field(gt=0)]
6803
+ ]
6804
+ ] = None,
6805
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
6806
+ _content_type: Optional[StrictStr] = None,
6807
+ _headers: Optional[Dict[StrictStr, Any]] = None,
6808
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
6809
+ ) -> ApiResponse[None]:
6810
+ """Update sandbox default limited network egress
6811
+
6812
+
6813
+ :param organization_id: Organization ID (required)
6814
+ :type organization_id: str
6815
+ :param organization_sandbox_default_limited_network_egress: (required)
6816
+ :type organization_sandbox_default_limited_network_egress: OrganizationSandboxDefaultLimitedNetworkEgress
6817
+ :param _request_timeout: timeout setting for this request. If one
6818
+ number provided, it will be total request
6819
+ timeout. It can also be a pair (tuple) of
6820
+ (connection, read) timeouts.
6821
+ :type _request_timeout: int, tuple(int, int), optional
6822
+ :param _request_auth: set to override the auth_settings for an a single
6823
+ request; this effectively ignores the
6824
+ authentication in the spec for a single request.
6825
+ :type _request_auth: dict, optional
6826
+ :param _content_type: force content-type for the request.
6827
+ :type _content_type: str, Optional
6828
+ :param _headers: set to override the headers for a single
6829
+ request; this effectively ignores the headers
6830
+ in the spec for a single request.
6831
+ :type _headers: dict, optional
6832
+ :param _host_index: set to override the host_index for a single
6833
+ request; this effectively ignores the host_index
6834
+ in the spec for a single request.
6835
+ :type _host_index: int, optional
6836
+ :return: Returns the result object.
6837
+ """ # noqa: E501
6838
+
6839
+ _param = self._update_sandbox_default_limited_network_egress_serialize(
6840
+ organization_id=organization_id,
6841
+ organization_sandbox_default_limited_network_egress=organization_sandbox_default_limited_network_egress,
6842
+ _request_auth=_request_auth,
6843
+ _content_type=_content_type,
6844
+ _headers=_headers,
6845
+ _host_index=_host_index
6846
+ )
6847
+
6848
+ _response_types_map: Dict[str, Optional[str]] = {
6849
+ '204': None,
6850
+ }
6851
+ response_data = self.api_client.call_api(
6852
+ *_param,
6853
+ _request_timeout=_request_timeout
6854
+ )
6855
+ response_data.read()
6856
+ return self.api_client.response_deserialize(
6857
+ response_data=response_data,
6858
+ response_types_map=_response_types_map,
6859
+ )
6860
+
6861
+
6862
+ @validate_call
6863
+ def update_sandbox_default_limited_network_egress_without_preload_content(
6864
+ self,
6865
+ organization_id: Annotated[StrictStr, Field(description="Organization ID")],
6866
+ organization_sandbox_default_limited_network_egress: OrganizationSandboxDefaultLimitedNetworkEgress,
6867
+ _request_timeout: Union[
6868
+ None,
6869
+ Annotated[StrictFloat, Field(gt=0)],
6870
+ Tuple[
6871
+ Annotated[StrictFloat, Field(gt=0)],
6872
+ Annotated[StrictFloat, Field(gt=0)]
6873
+ ]
6874
+ ] = None,
6875
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
6876
+ _content_type: Optional[StrictStr] = None,
6877
+ _headers: Optional[Dict[StrictStr, Any]] = None,
6878
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
6879
+ ) -> RESTResponseType:
6880
+ """Update sandbox default limited network egress
6881
+
6882
+
6883
+ :param organization_id: Organization ID (required)
6884
+ :type organization_id: str
6885
+ :param organization_sandbox_default_limited_network_egress: (required)
6886
+ :type organization_sandbox_default_limited_network_egress: OrganizationSandboxDefaultLimitedNetworkEgress
6887
+ :param _request_timeout: timeout setting for this request. If one
6888
+ number provided, it will be total request
6889
+ timeout. It can also be a pair (tuple) of
6890
+ (connection, read) timeouts.
6891
+ :type _request_timeout: int, tuple(int, int), optional
6892
+ :param _request_auth: set to override the auth_settings for an a single
6893
+ request; this effectively ignores the
6894
+ authentication in the spec for a single request.
6895
+ :type _request_auth: dict, optional
6896
+ :param _content_type: force content-type for the request.
6897
+ :type _content_type: str, Optional
6898
+ :param _headers: set to override the headers for a single
6899
+ request; this effectively ignores the headers
6900
+ in the spec for a single request.
6901
+ :type _headers: dict, optional
6902
+ :param _host_index: set to override the host_index for a single
6903
+ request; this effectively ignores the host_index
6904
+ in the spec for a single request.
6905
+ :type _host_index: int, optional
6906
+ :return: Returns the result object.
6907
+ """ # noqa: E501
6908
+
6909
+ _param = self._update_sandbox_default_limited_network_egress_serialize(
6910
+ organization_id=organization_id,
6911
+ organization_sandbox_default_limited_network_egress=organization_sandbox_default_limited_network_egress,
6912
+ _request_auth=_request_auth,
6913
+ _content_type=_content_type,
6914
+ _headers=_headers,
6915
+ _host_index=_host_index
6916
+ )
6917
+
6918
+ _response_types_map: Dict[str, Optional[str]] = {
6919
+ '204': None,
6920
+ }
6921
+ response_data = self.api_client.call_api(
6922
+ *_param,
6923
+ _request_timeout=_request_timeout
6924
+ )
6925
+ return response_data.response
6926
+
6927
+
6928
+ def _update_sandbox_default_limited_network_egress_serialize(
6929
+ self,
6930
+ organization_id,
6931
+ organization_sandbox_default_limited_network_egress,
6932
+ _request_auth,
6933
+ _content_type,
6934
+ _headers,
6935
+ _host_index,
6936
+ ) -> RequestSerialized:
6937
+
6938
+ _host = None
6939
+
6940
+ _collection_formats: Dict[str, str] = {
6941
+ }
6942
+
6943
+ _path_params: Dict[str, str] = {}
6944
+ _query_params: List[Tuple[str, str]] = []
6945
+ _header_params: Dict[str, Optional[str]] = _headers or {}
6946
+ _form_params: List[Tuple[str, str]] = []
6947
+ _files: Dict[
6948
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
6949
+ ] = {}
6950
+ _body_params: Optional[bytes] = None
6951
+
6952
+ # process the path parameters
6953
+ if organization_id is not None:
6954
+ _path_params['organizationId'] = organization_id
6955
+ # process the query parameters
6956
+ # process the header parameters
6957
+ # process the form parameters
6958
+ # process the body parameter
6959
+ if organization_sandbox_default_limited_network_egress is not None:
6960
+ _body_params = organization_sandbox_default_limited_network_egress
6961
+
6962
+
6963
+
6964
+ # set the HTTP header `Content-Type`
6965
+ if _content_type:
6966
+ _header_params['Content-Type'] = _content_type
6967
+ else:
6968
+ _default_content_type = (
6969
+ self.api_client.select_header_content_type(
6970
+ [
6971
+ 'application/json'
6972
+ ]
6973
+ )
6974
+ )
6975
+ if _default_content_type is not None:
6976
+ _header_params['Content-Type'] = _default_content_type
6977
+
6978
+ # authentication setting
6979
+ _auth_settings: List[str] = [
6980
+ 'bearer',
6981
+ 'oauth2'
6982
+ ]
6983
+
6984
+ return self.api_client.param_serialize(
6985
+ method='POST',
6986
+ resource_path='/organizations/{organizationId}/sandbox-default-limited-network-egress',
6987
+ path_params=_path_params,
6988
+ query_params=_query_params,
6989
+ header_params=_header_params,
6990
+ body=_body_params,
6991
+ post_params=_form_params,
6992
+ files=_files,
6993
+ auth_settings=_auth_settings,
6994
+ collection_formats=_collection_formats,
6995
+ _host=_host,
6996
+ _request_auth=_request_auth
6997
+ )
6998
+
6999
+
@@ -85,6 +85,7 @@ from daytona_api_client.models.mouse_scroll_response import MouseScrollResponse
85
85
  from daytona_api_client.models.organization import Organization
86
86
  from daytona_api_client.models.organization_invitation import OrganizationInvitation
87
87
  from daytona_api_client.models.organization_role import OrganizationRole
88
+ from daytona_api_client.models.organization_sandbox_default_limited_network_egress import OrganizationSandboxDefaultLimitedNetworkEgress
88
89
  from daytona_api_client.models.organization_suspension import OrganizationSuspension
89
90
  from daytona_api_client.models.organization_usage_overview import OrganizationUsageOverview
90
91
  from daytona_api_client.models.organization_user import OrganizationUser
@@ -39,8 +39,8 @@ class CreateAuditLog(BaseModel):
39
39
  @field_validator('action')
40
40
  def action_validate_enum(cls, value):
41
41
  """Validates the enum"""
42
- if value not in set(['create', 'read', 'update', 'delete', 'login', 'set_default', 'update_access', 'update_quota', 'suspend', 'unsuspend', 'accept', 'decline', 'link_account', 'unlink_account', 'leave_organization', 'regenerate_key_pair', 'update_scheduling', 'start', 'stop', 'replace_labels', 'create_backup', 'update_public_status', 'set_auto_stop_interval', 'set_auto_archive_interval', 'set_auto_delete_interval', 'archive', 'get_port_preview_url', 'set_general_status', 'activate', 'deactivate', 'update_network_settings', 'get_webhook_app_portal_access', 'send_webhook_message', 'initialize_webhooks', 'toolbox_delete_file', 'toolbox_download_file', 'toolbox_create_folder', 'toolbox_move_file', 'toolbox_set_file_permissions', 'toolbox_replace_in_files', 'toolbox_upload_file', 'toolbox_bulk_upload_files', 'toolbox_git_add_files', 'toolbox_git_create_branch', 'toolbox_git_delete_branch', 'toolbox_git_clone_repository', 'toolbox_git_commit_changes', 'toolbox_git_pull_changes', 'toolbox_git_push_changes', 'toolbox_git_checkout_branch', 'toolbox_execute_command', 'toolbox_create_session', 'toolbox_session_execute_command', 'toolbox_delete_session', 'toolbox_computer_use_start', 'toolbox_computer_use_stop', 'toolbox_computer_use_restart_process']):
43
- raise ValueError("must be one of enum values ('create', 'read', 'update', 'delete', 'login', 'set_default', 'update_access', 'update_quota', 'suspend', 'unsuspend', 'accept', 'decline', 'link_account', 'unlink_account', 'leave_organization', 'regenerate_key_pair', 'update_scheduling', 'start', 'stop', 'replace_labels', 'create_backup', 'update_public_status', 'set_auto_stop_interval', 'set_auto_archive_interval', 'set_auto_delete_interval', 'archive', 'get_port_preview_url', 'set_general_status', 'activate', 'deactivate', 'update_network_settings', 'get_webhook_app_portal_access', 'send_webhook_message', 'initialize_webhooks', 'toolbox_delete_file', 'toolbox_download_file', 'toolbox_create_folder', 'toolbox_move_file', 'toolbox_set_file_permissions', 'toolbox_replace_in_files', 'toolbox_upload_file', 'toolbox_bulk_upload_files', 'toolbox_git_add_files', 'toolbox_git_create_branch', 'toolbox_git_delete_branch', 'toolbox_git_clone_repository', 'toolbox_git_commit_changes', 'toolbox_git_pull_changes', 'toolbox_git_push_changes', 'toolbox_git_checkout_branch', 'toolbox_execute_command', 'toolbox_create_session', 'toolbox_session_execute_command', 'toolbox_delete_session', 'toolbox_computer_use_start', 'toolbox_computer_use_stop', 'toolbox_computer_use_restart_process')")
42
+ if value not in set(['create', 'read', 'update', 'delete', 'login', 'set_default', 'update_access', 'update_quota', 'suspend', 'unsuspend', 'accept', 'decline', 'link_account', 'unlink_account', 'leave_organization', 'regenerate_key_pair', 'update_scheduling', 'start', 'stop', 'replace_labels', 'create_backup', 'update_public_status', 'set_auto_stop_interval', 'set_auto_archive_interval', 'set_auto_delete_interval', 'archive', 'get_port_preview_url', 'set_general_status', 'activate', 'deactivate', 'update_network_settings', 'get_webhook_app_portal_access', 'send_webhook_message', 'initialize_webhooks', 'update_sandbox_default_limited_network_egress', 'toolbox_delete_file', 'toolbox_download_file', 'toolbox_create_folder', 'toolbox_move_file', 'toolbox_set_file_permissions', 'toolbox_replace_in_files', 'toolbox_upload_file', 'toolbox_bulk_upload_files', 'toolbox_git_add_files', 'toolbox_git_create_branch', 'toolbox_git_delete_branch', 'toolbox_git_clone_repository', 'toolbox_git_commit_changes', 'toolbox_git_pull_changes', 'toolbox_git_push_changes', 'toolbox_git_checkout_branch', 'toolbox_execute_command', 'toolbox_create_session', 'toolbox_session_execute_command', 'toolbox_delete_session', 'toolbox_computer_use_start', 'toolbox_computer_use_stop', 'toolbox_computer_use_restart_process']):
43
+ raise ValueError("must be one of enum values ('create', 'read', 'update', 'delete', 'login', 'set_default', 'update_access', 'update_quota', 'suspend', 'unsuspend', 'accept', 'decline', 'link_account', 'unlink_account', 'leave_organization', 'regenerate_key_pair', 'update_scheduling', 'start', 'stop', 'replace_labels', 'create_backup', 'update_public_status', 'set_auto_stop_interval', 'set_auto_archive_interval', 'set_auto_delete_interval', 'archive', 'get_port_preview_url', 'set_general_status', 'activate', 'deactivate', 'update_network_settings', 'get_webhook_app_portal_access', 'send_webhook_message', 'initialize_webhooks', 'update_sandbox_default_limited_network_egress', 'toolbox_delete_file', 'toolbox_download_file', 'toolbox_create_folder', 'toolbox_move_file', 'toolbox_set_file_permissions', 'toolbox_replace_in_files', 'toolbox_upload_file', 'toolbox_bulk_upload_files', 'toolbox_git_add_files', 'toolbox_git_create_branch', 'toolbox_git_delete_branch', 'toolbox_git_clone_repository', 'toolbox_git_commit_changes', 'toolbox_git_pull_changes', 'toolbox_git_push_changes', 'toolbox_git_checkout_branch', 'toolbox_execute_command', 'toolbox_create_session', 'toolbox_session_execute_command', 'toolbox_delete_session', 'toolbox_computer_use_start', 'toolbox_computer_use_stop', 'toolbox_computer_use_restart_process')")
44
44
  return value
45
45
 
46
46
  @field_validator('target_type')
@@ -45,8 +45,9 @@ class Organization(BaseModel):
45
45
  max_cpu_per_sandbox: Union[StrictFloat, StrictInt] = Field(description="Max CPU per sandbox", alias="maxCpuPerSandbox")
46
46
  max_memory_per_sandbox: Union[StrictFloat, StrictInt] = Field(description="Max memory per sandbox", alias="maxMemoryPerSandbox")
47
47
  max_disk_per_sandbox: Union[StrictFloat, StrictInt] = Field(description="Max disk per sandbox", alias="maxDiskPerSandbox")
48
+ sandbox_limited_network_egress: StrictBool = Field(description="Sandbox default network block all", alias="sandboxLimitedNetworkEgress")
48
49
  additional_properties: Dict[str, Any] = {}
49
- __properties: ClassVar[List[str]] = ["id", "name", "createdBy", "personal", "createdAt", "updatedAt", "suspended", "suspendedAt", "suspensionReason", "suspendedUntil", "suspensionCleanupGracePeriodHours", "totalCpuQuota", "totalMemoryQuota", "totalDiskQuota", "maxCpuPerSandbox", "maxMemoryPerSandbox", "maxDiskPerSandbox"]
50
+ __properties: ClassVar[List[str]] = ["id", "name", "createdBy", "personal", "createdAt", "updatedAt", "suspended", "suspendedAt", "suspensionReason", "suspendedUntil", "suspensionCleanupGracePeriodHours", "totalCpuQuota", "totalMemoryQuota", "totalDiskQuota", "maxCpuPerSandbox", "maxMemoryPerSandbox", "maxDiskPerSandbox", "sandboxLimitedNetworkEgress"]
50
51
 
51
52
  model_config = ConfigDict(
52
53
  populate_by_name=True,
@@ -122,7 +123,8 @@ class Organization(BaseModel):
122
123
  "totalDiskQuota": obj.get("totalDiskQuota"),
123
124
  "maxCpuPerSandbox": obj.get("maxCpuPerSandbox"),
124
125
  "maxMemoryPerSandbox": obj.get("maxMemoryPerSandbox"),
125
- "maxDiskPerSandbox": obj.get("maxDiskPerSandbox")
126
+ "maxDiskPerSandbox": obj.get("maxDiskPerSandbox"),
127
+ "sandboxLimitedNetworkEgress": obj.get("sandboxLimitedNetworkEgress")
126
128
  })
127
129
  # store additional fields in additional_properties
128
130
  for _key in obj.keys():
@@ -18,25 +18,18 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
22
22
  from typing import Any, ClassVar, Dict, List
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
- class UpdateOrganizationMemberRole(BaseModel):
26
+ class OrganizationSandboxDefaultLimitedNetworkEgress(BaseModel):
27
27
  """
28
- UpdateOrganizationMemberRole
28
+ OrganizationSandboxDefaultLimitedNetworkEgress
29
29
  """ # noqa: E501
30
- role: StrictStr = Field(description="Organization member role")
30
+ sandbox_default_limited_network_egress: StrictBool = Field(description="Sandbox default limited network egress", alias="sandboxDefaultLimitedNetworkEgress")
31
31
  additional_properties: Dict[str, Any] = {}
32
- __properties: ClassVar[List[str]] = ["role"]
33
-
34
- @field_validator('role')
35
- def role_validate_enum(cls, value):
36
- """Validates the enum"""
37
- if value not in set(['owner', 'member']):
38
- raise ValueError("must be one of enum values ('owner', 'member')")
39
- return value
32
+ __properties: ClassVar[List[str]] = ["sandboxDefaultLimitedNetworkEgress"]
40
33
 
41
34
  model_config = ConfigDict(
42
35
  populate_by_name=True,
@@ -56,7 +49,7 @@ class UpdateOrganizationMemberRole(BaseModel):
56
49
 
57
50
  @classmethod
58
51
  def from_json(cls, json_str: str) -> Optional[Self]:
59
- """Create an instance of UpdateOrganizationMemberRole from a JSON string"""
52
+ """Create an instance of OrganizationSandboxDefaultLimitedNetworkEgress from a JSON string"""
60
53
  return cls.from_dict(json.loads(json_str))
61
54
 
62
55
  def to_dict(self) -> Dict[str, Any]:
@@ -88,7 +81,7 @@ class UpdateOrganizationMemberRole(BaseModel):
88
81
 
89
82
  @classmethod
90
83
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
- """Create an instance of UpdateOrganizationMemberRole from a dict"""
84
+ """Create an instance of OrganizationSandboxDefaultLimitedNetworkEgress from a dict"""
92
85
  if obj is None:
93
86
  return None
94
87
 
@@ -96,7 +89,7 @@ class UpdateOrganizationMemberRole(BaseModel):
96
89
  return cls.model_validate(obj)
97
90
 
98
91
  _obj = cls.model_validate({
99
- "role": obj.get("role")
92
+ "sandboxDefaultLimitedNetworkEgress": obj.get("sandboxDefaultLimitedNetworkEgress")
100
93
  })
101
94
  # store additional fields in additional_properties
102
95
  for _key in obj.keys():
@@ -18,18 +18,18 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
22
22
  from typing import Any, ClassVar, Dict, List
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
- class UpdateAssignedOrganizationRoles(BaseModel):
26
+ class OrganizationSandboxDefaultNetworkBlockAll(BaseModel):
27
27
  """
28
- UpdateAssignedOrganizationRoles
28
+ OrganizationSandboxDefaultNetworkBlockAll
29
29
  """ # noqa: E501
30
- role_ids: List[StrictStr] = Field(description="Array of role IDs", alias="roleIds")
30
+ sandbox_default_network_block_all: StrictBool = Field(description="Sandbox default network block all", alias="sandboxDefaultNetworkBlockAll")
31
31
  additional_properties: Dict[str, Any] = {}
32
- __properties: ClassVar[List[str]] = ["roleIds"]
32
+ __properties: ClassVar[List[str]] = ["sandboxDefaultNetworkBlockAll"]
33
33
 
34
34
  model_config = ConfigDict(
35
35
  populate_by_name=True,
@@ -49,7 +49,7 @@ class UpdateAssignedOrganizationRoles(BaseModel):
49
49
 
50
50
  @classmethod
51
51
  def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of UpdateAssignedOrganizationRoles from a JSON string"""
52
+ """Create an instance of OrganizationSandboxDefaultNetworkBlockAll from a JSON string"""
53
53
  return cls.from_dict(json.loads(json_str))
54
54
 
55
55
  def to_dict(self) -> Dict[str, Any]:
@@ -81,7 +81,7 @@ class UpdateAssignedOrganizationRoles(BaseModel):
81
81
 
82
82
  @classmethod
83
83
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
- """Create an instance of UpdateAssignedOrganizationRoles from a dict"""
84
+ """Create an instance of OrganizationSandboxDefaultNetworkBlockAll from a dict"""
85
85
  if obj is None:
86
86
  return None
87
87
 
@@ -89,7 +89,7 @@ class UpdateAssignedOrganizationRoles(BaseModel):
89
89
  return cls.model_validate(obj)
90
90
 
91
91
  _obj = cls.model_validate({
92
- "roleIds": obj.get("roleIds")
92
+ "sandboxDefaultNetworkBlockAll": obj.get("sandboxDefaultNetworkBlockAll")
93
93
  })
94
94
  # store additional fields in additional_properties
95
95
  for _key in obj.keys():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: daytona_api_client
3
- Version: 0.27.1
3
+ Version: 0.102.0
4
4
  Summary: Daytona
5
5
  Home-page:
6
6
  Author: Daytona Platforms Inc.
@@ -1,4 +1,4 @@
1
- daytona_api_client/__init__.py,sha256=KLwzj2dFjpvgPVgRuaDEKdEWPeUn6107QvBWeHAQHco,11069
1
+ daytona_api_client/__init__.py,sha256=ZQqYvkZ1gEatH0m9_Ar05jG90hCtcJIVXBc472Oflm4,11206
2
2
  daytona_api_client/api_client.py,sha256=9EKcRsveS2okE5kTbp212LVTY6LJATDZEqA8Rj77vXY,27455
3
3
  daytona_api_client/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
4
4
  daytona_api_client/configuration.py,sha256=Dz7AXjEZ4BCCCUoGQZLfXUTtuH1PUuo3KrlwLO5Dlsk,18241
@@ -12,7 +12,7 @@ daytona_api_client/api/default_api.py,sha256=4-VA8V8k3HRRMrs94ANAwkyDKVAZWmNlm2g
12
12
  daytona_api_client/api/docker_registry_api.py,sha256=ids7YUbqX4s2uwv7ROhqFqNzHzdYa7nK9wOPQ5rgB8U,78838
13
13
  daytona_api_client/api/health_api.py,sha256=alnAhh9vQkpx2OmVre6dHmHTlcFldBfqsogNoUPzFsc,10533
14
14
  daytona_api_client/api/object_storage_api.py,sha256=wvOdTUjvlChxzwwzA-49iwjl46F0uFt06Axfcb_BX4Q,11605
15
- daytona_api_client/api/organizations_api.py,sha256=lsI2ZOuAqYO3rAeNSHd-4UA7K5RJj_45_MqFw42V4VM,264232
15
+ daytona_api_client/api/organizations_api.py,sha256=ve8cb9Oa6fAeKgcysbl4MVZ6I6_0pI51vYs_3g9Yn4g,276339
16
16
  daytona_api_client/api/preview_api.py,sha256=_cYR0xaBKtYBFUKIRezvR0d6swN7yKkmVkJ5yBLk_ro,31054
17
17
  daytona_api_client/api/runners_api.py,sha256=kl74Mg19G71Kcj9dNK9xeJCaZ2upk4z-DS7Ul70n-Ww,49018
18
18
  daytona_api_client/api/sandbox_api.py,sha256=yr4s9iuEYpu2mspxJC4WfkVJMpAlEAa1NEI38IwW6R4,210810
@@ -22,7 +22,7 @@ daytona_api_client/api/users_api.py,sha256=KR4cw2mfRp06QV2b0UXXQ1Jcx59TyuS0c7yGR
22
22
  daytona_api_client/api/volumes_api.py,sha256=N9kxZzhfaZxC_YQ-Vi1QksoTIzqp_dFADywgQup1oSk,56613
23
23
  daytona_api_client/api/webhooks_api.py,sha256=epxKIYqZfebDapzSvqUVlJct1KfVr_T3ZnAc9YyiZX8,69516
24
24
  daytona_api_client/api/workspace_api.py,sha256=mjn4jlTtMbKfuqxcr9goo-01RJX-hFjVLT1rF8K5uKI,169328
25
- daytona_api_client/models/__init__.py,sha256=noGK3GQhRu5_XEIHVCJM5yQrX9wsl2k34JW7XggZ5sw,9574
25
+ daytona_api_client/models/__init__.py,sha256=of6-DRHX_XDceMp6vmwND-DZTgnhPzej3en4PimK6qk,9711
26
26
  daytona_api_client/models/account_provider.py,sha256=yKJ_dMGnxGalNYuVTmo4CoFHpj1PIssSE1rnUaQeOKY,3154
27
27
  daytona_api_client/models/api_key_list.py,sha256=Q0NYG_KlqZgscz7WpkhTns6z1hYUaZH8yut8X40mQ1A,5166
28
28
  daytona_api_client/models/api_key_response.py,sha256=XWqJdKTMp1w8uoUpmeKn0tKeXeImTJElnTvLunZGX5Y,4611
@@ -37,7 +37,7 @@ daytona_api_client/models/computer_use_start_response.py,sha256=9VYe5UMBU-0EpGaw
37
37
  daytona_api_client/models/computer_use_status_response.py,sha256=P2dNSx1Ot-szu4y5gk1GCEJixCxsXrVnMNetxeYMh54,3489
38
38
  daytona_api_client/models/computer_use_stop_response.py,sha256=FUpPYsIMPXqCGKYqdvVozjHHthg5j0o8NOMCYXjp5lY,3332
39
39
  daytona_api_client/models/create_api_key.py,sha256=GFv3d-rA2Mbr9UhP-0O0DKm-gvln_JSGFJjMyoSAc8A,4351
40
- daytona_api_client/models/create_audit_log.py,sha256=NkEnWDpRRELoKER5kTmUE48J5UNv4uxV1aq8mfXKCf8,7031
40
+ daytona_api_client/models/create_audit_log.py,sha256=Hkt8o4LtfbcckOZ6Nico-b_hkOvCMFTKJAZMwC1RP3M,7129
41
41
  daytona_api_client/models/create_build_info.py,sha256=hepmmgcZn199sgLksLm3ksJNSv-XLSgqL2BPdFnNAdg,3402
42
42
  daytona_api_client/models/create_docker_registry.py,sha256=dyWgwtTu6RcbGgXyosFbwtvPJ55FjuK0duof-jK9o7Q,4337
43
43
  daytona_api_client/models/create_linked_account.py,sha256=ar_cK_7Ep9iQ6zKeYDEMhQ5m3jc5EuomXj9SpdtWtSE,3289
@@ -94,9 +94,11 @@ daytona_api_client/models/mouse_move_response.py,sha256=8dNZRVGwou0z5Hnm8qgcpH-M
94
94
  daytona_api_client/models/mouse_position.py,sha256=7SihmxntHoebKBqFus3FCThvOAc95zYtnDVsKOY29Cs,3262
95
95
  daytona_api_client/models/mouse_scroll_request.py,sha256=k8gy6A4zgfA-s1_pcJ6Ju53E-WpfU68uiT370IoxiK0,3653
96
96
  daytona_api_client/models/mouse_scroll_response.py,sha256=8jjnRrSdfynLVoJY5YpG4nKnum0FpV6JoWMsLHuQ5-w,3134
97
- daytona_api_client/models/organization.py,sha256=C9r47QH32-YeOmoE3EgtnXpiUIloq6z684LJz9md6Rk,5969
97
+ daytona_api_client/models/organization.py,sha256=cO54dUvJOMxwhKAiNHBHnDJO0Xuu8YPzTI1uOEcdvf8,6224
98
98
  daytona_api_client/models/organization_invitation.py,sha256=LXPDanRJHU6bfXD-wanIY2Ise7VakZoRLgqhYrOu_Vk,5722
99
99
  daytona_api_client/models/organization_role.py,sha256=RXGyGoi6XQI94zMzYU0h7UzI6Dm245t4hwNkKV9TCiE,4571
100
+ daytona_api_client/models/organization_sandbox_default_limited_network_egress.py,sha256=ld2A6ECqHt-YkpUI2r1JrCfljjb-vmS6ESqrCQ3d6Tg,3387
101
+ daytona_api_client/models/organization_sandbox_default_network_block_all.py,sha256=RWdyeOiaFMess1gVzQyJT7hRDE8vtj2YzR1_ptxCsw8,3337
100
102
  daytona_api_client/models/organization_suspension.py,sha256=Pd6oBCKzlvI7xAfjDamyte2eHJKOZBFgG3GXMUVOe2A,3586
101
103
  daytona_api_client/models/organization_usage_overview.py,sha256=49A5lhlQf30c2i5YdEZ17VCnFp_35zhVHBC76Eju_R0,4736
102
104
  daytona_api_client/models/organization_user.py,sha256=t4rkA-cpCRLgLqDMplg1yv2JYUu7jrRBLPL1xkcjaJI,4889
@@ -149,15 +151,12 @@ daytona_api_client/models/snapshot_state_updated_post_request_data_snapshot.py,s
149
151
  daytona_api_client/models/ssh_access_dto.py,sha256=SlKSwrMITp1Gs84p4g9Jo8jOp7pyXgZM-DSj1ywTnUc,3857
150
152
  daytona_api_client/models/ssh_access_validation_dto.py,sha256=pZPI4xS3fV-FqdH6KbPSAWToTjR4Gmv8KnXbOIXZ7-w,3708
151
153
  daytona_api_client/models/storage_access_dto.py,sha256=aivW_3ewAA5jcevSPyvsTaqqY5nUeaW8_2OPUeih614,3879
152
- daytona_api_client/models/update_assigned_organization_roles.py,sha256=G8-T_36mlvj5o0QGO5rhXcMed86NaWyEc8kvhRm4Uho,3172
153
154
  daytona_api_client/models/update_docker_registry.py,sha256=ya9FuZ3xvkUr0Dt69umaIJZjnH3Fy882qs82pt2iytw,3604
154
155
  daytona_api_client/models/update_organization_invitation.py,sha256=_98DviKjGYq1h_zKngy0WphVyvi19d6kO8yiMgviX5A,3809
155
156
  daytona_api_client/models/update_organization_member_access.py,sha256=I0q60678RqxDc_-ZWqNf2drqEmEB1FMPpJ60ZL7-MbY,3646
156
- daytona_api_client/models/update_organization_member_role.py,sha256=-B8wsTJgQSkQTiYqD0nuc8yUXRRzIX5U0z5z94CTc5Q,3401
157
157
  daytona_api_client/models/update_organization_quota.py,sha256=qfwgYkEKBJHhksdhbC0_LZUt5fBBFehQdtfq5seFSGc,6830
158
158
  daytona_api_client/models/update_organization_role.py,sha256=-Z8oRpO3ebQRtlzMaeYKyfyNiFARD76kGvY_9-mF4os,4069
159
159
  daytona_api_client/models/user.py,sha256=sXLeH2Rivv_Jls4rGcv3ihfX9B7-4pCZqk_JrSGBGmI,4060
160
- daytona_api_client/models/user_home_dir_response.py,sha256=Hw3BXi_AdWuJRQ7lzncLSnBKW1iulBMSFD5rP92aoY8,3063
161
160
  daytona_api_client/models/user_public_key.py,sha256=Y0_O7Sq8NP3XzCdKJJj7iTavEY8ytcBAf0Q3qOnJhbQ,3150
162
161
  daytona_api_client/models/volume_created_post_request.py,sha256=chleMJEqyLN_mdwd7UpmLLr1bRMQnZnb-UkYtyyDqDk,3653
163
162
  daytona_api_client/models/volume_created_post_request_data.py,sha256=MEqGnebIYVqY4-CqWCZ6LUx7OdPQZprAeqMwY9-nCmE,4487
@@ -172,11 +171,9 @@ daytona_api_client/models/webhook_controller_get_initialization_status200_respon
172
171
  daytona_api_client/models/webhook_controller_get_status200_response.py,sha256=aRWG6gX4340N2Xhv6F3_5xr29zcNxLE8k-I7E7PSqVE,3153
173
172
  daytona_api_client/models/webhook_initialization_status.py,sha256=zmw2g68mZfYXNDGwvJmd5QewHJtJ5JsUUgwBrbMQ8Bw,4664
174
173
  daytona_api_client/models/windows_response.py,sha256=1fW2GYVSjFbipfQupU2MjfhUlcEyawzwtnWnwGngsFs,3295
175
- daytona_api_client/models/work_dir_response.py,sha256=1dndjWYnDSMDeLiY8pxQDX1viESoAGF_fegSiMx3i40,3047
176
- daytona_api_client/models/workdir_response.py,sha256=geBhfQDR7LK0uPlmJF6Ple1eQMCzhSb4qK-9UfhqV7k,3047
177
174
  daytona_api_client/models/workspace.py,sha256=uwAStXOLrVJzbxdTfPZokrcMr4Dp4ghgH8V5fy5r0gY,11488
178
- daytona_api_client-0.27.1.dist-info/licenses/LICENSE,sha256=Qrw_9vreBpJ9mUMcB5B7ALDecZHgRciuOqS0BPfpihc,10752
179
- daytona_api_client-0.27.1.dist-info/METADATA,sha256=5qOlOJ8gB40TiGdM616EHXWnd8vaicqzpa6gQeBuT4Y,618
180
- daytona_api_client-0.27.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
181
- daytona_api_client-0.27.1.dist-info/top_level.txt,sha256=sDZKAfxKnAQYvOLS9vAOx88EYH3wV5Wx897pODDupuE,19
182
- daytona_api_client-0.27.1.dist-info/RECORD,,
175
+ daytona_api_client-0.102.0.dist-info/licenses/LICENSE,sha256=Qrw_9vreBpJ9mUMcB5B7ALDecZHgRciuOqS0BPfpihc,10752
176
+ daytona_api_client-0.102.0.dist-info/METADATA,sha256=pH3PrYsVZcEbJq62Ejpj6WMKi4FK3cMws_-MvIHIa04,619
177
+ daytona_api_client-0.102.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
178
+ daytona_api_client-0.102.0.dist-info/top_level.txt,sha256=sDZKAfxKnAQYvOLS9vAOx88EYH3wV5Wx897pODDupuE,19
179
+ daytona_api_client-0.102.0.dist-info/RECORD,,
@@ -1,101 +0,0 @@
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, 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 UserHomeDirResponse(BaseModel):
27
- """
28
- UserHomeDirResponse
29
- """ # noqa: E501
30
- dir: Optional[StrictStr] = None
31
- additional_properties: Dict[str, Any] = {}
32
- __properties: ClassVar[List[str]] = ["dir"]
33
-
34
- model_config = ConfigDict(
35
- populate_by_name=True,
36
- validate_assignment=True,
37
- protected_namespaces=(),
38
- )
39
-
40
-
41
- def to_str(self) -> str:
42
- """Returns the string representation of the model using alias"""
43
- return pprint.pformat(self.model_dump(by_alias=True))
44
-
45
- def to_json(self) -> str:
46
- """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of UserHomeDirResponse from a JSON string"""
53
- return cls.from_dict(json.loads(json_str))
54
-
55
- def to_dict(self) -> Dict[str, Any]:
56
- """Return the dictionary representation of the model using alias.
57
-
58
- This has the following differences from calling pydantic's
59
- `self.model_dump(by_alias=True)`:
60
-
61
- * `None` is only added to the output dict for nullable fields that
62
- were set at model initialization. Other fields with value `None`
63
- are ignored.
64
- * Fields in `self.additional_properties` are added to the output dict.
65
- """
66
- excluded_fields: Set[str] = set([
67
- "additional_properties",
68
- ])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # puts key-value pairs in additional_properties in the top level
76
- if self.additional_properties is not None:
77
- for _key, _value in self.additional_properties.items():
78
- _dict[_key] = _value
79
-
80
- return _dict
81
-
82
- @classmethod
83
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
- """Create an instance of UserHomeDirResponse 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
- "dir": obj.get("dir")
93
- })
94
- # store additional fields in additional_properties
95
- for _key in obj.keys():
96
- if _key not in cls.__properties:
97
- _obj.additional_properties[_key] = obj.get(_key)
98
-
99
- return _obj
100
-
101
-
@@ -1,101 +0,0 @@
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, 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 WorkDirResponse(BaseModel):
27
- """
28
- WorkDirResponse
29
- """ # noqa: E501
30
- dir: Optional[StrictStr] = None
31
- additional_properties: Dict[str, Any] = {}
32
- __properties: ClassVar[List[str]] = ["dir"]
33
-
34
- model_config = ConfigDict(
35
- populate_by_name=True,
36
- validate_assignment=True,
37
- protected_namespaces=(),
38
- )
39
-
40
-
41
- def to_str(self) -> str:
42
- """Returns the string representation of the model using alias"""
43
- return pprint.pformat(self.model_dump(by_alias=True))
44
-
45
- def to_json(self) -> str:
46
- """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of WorkDirResponse from a JSON string"""
53
- return cls.from_dict(json.loads(json_str))
54
-
55
- def to_dict(self) -> Dict[str, Any]:
56
- """Return the dictionary representation of the model using alias.
57
-
58
- This has the following differences from calling pydantic's
59
- `self.model_dump(by_alias=True)`:
60
-
61
- * `None` is only added to the output dict for nullable fields that
62
- were set at model initialization. Other fields with value `None`
63
- are ignored.
64
- * Fields in `self.additional_properties` are added to the output dict.
65
- """
66
- excluded_fields: Set[str] = set([
67
- "additional_properties",
68
- ])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # puts key-value pairs in additional_properties in the top level
76
- if self.additional_properties is not None:
77
- for _key, _value in self.additional_properties.items():
78
- _dict[_key] = _value
79
-
80
- return _dict
81
-
82
- @classmethod
83
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
- """Create an instance of WorkDirResponse 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
- "dir": obj.get("dir")
93
- })
94
- # store additional fields in additional_properties
95
- for _key in obj.keys():
96
- if _key not in cls.__properties:
97
- _obj.additional_properties[_key] = obj.get(_key)
98
-
99
- return _obj
100
-
101
-
@@ -1,101 +0,0 @@
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, 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 WorkdirResponse(BaseModel):
27
- """
28
- WorkdirResponse
29
- """ # noqa: E501
30
- dir: Optional[StrictStr] = None
31
- additional_properties: Dict[str, Any] = {}
32
- __properties: ClassVar[List[str]] = ["dir"]
33
-
34
- model_config = ConfigDict(
35
- populate_by_name=True,
36
- validate_assignment=True,
37
- protected_namespaces=(),
38
- )
39
-
40
-
41
- def to_str(self) -> str:
42
- """Returns the string representation of the model using alias"""
43
- return pprint.pformat(self.model_dump(by_alias=True))
44
-
45
- def to_json(self) -> str:
46
- """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of WorkdirResponse from a JSON string"""
53
- return cls.from_dict(json.loads(json_str))
54
-
55
- def to_dict(self) -> Dict[str, Any]:
56
- """Return the dictionary representation of the model using alias.
57
-
58
- This has the following differences from calling pydantic's
59
- `self.model_dump(by_alias=True)`:
60
-
61
- * `None` is only added to the output dict for nullable fields that
62
- were set at model initialization. Other fields with value `None`
63
- are ignored.
64
- * Fields in `self.additional_properties` are added to the output dict.
65
- """
66
- excluded_fields: Set[str] = set([
67
- "additional_properties",
68
- ])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # puts key-value pairs in additional_properties in the top level
76
- if self.additional_properties is not None:
77
- for _key, _value in self.additional_properties.items():
78
- _dict[_key] = _value
79
-
80
- return _dict
81
-
82
- @classmethod
83
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
- """Create an instance of WorkdirResponse 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
- "dir": obj.get("dir")
93
- })
94
- # store additional fields in additional_properties
95
- for _key in obj.keys():
96
- if _key not in cls.__properties:
97
- _obj.additional_properties[_key] = obj.get(_key)
98
-
99
- return _obj
100
-
101
-