cyberdesk 0.2.7__py3-none-any.whl → 1.2.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.
Potentially problematic release.
This version of cyberdesk might be problematic. Click here for more details.
- cyberdesk/__init__.py +45 -7
- cyberdesk/client.py +779 -70
- cyberdesk-1.2.0.dist-info/METADATA +274 -0
- cyberdesk-1.2.0.dist-info/RECORD +113 -0
- {cyberdesk-0.2.7.dist-info → cyberdesk-1.2.0.dist-info}/WHEEL +1 -1
- openapi_client/{api_reference_client → cyberdesk_cloud_client}/__init__.py +8 -8
- openapi_client/{api_reference_client → cyberdesk_cloud_client}/api/__init__.py +1 -1
- openapi_client/{api_reference_client/api/desktop → cyberdesk_cloud_client/api/computer}/__init__.py +1 -1
- openapi_client/cyberdesk_cloud_client/api/computer/get_display_dimensions_v1_computer_machine_id_display_dimensions_get.py +163 -0
- openapi_client/cyberdesk_cloud_client/api/computer/get_mouse_position_v1_computer_machine_id_input_mouse_position_get.py +163 -0
- openapi_client/cyberdesk_cloud_client/api/computer/get_screenshot_v1_computer_machine_id_display_screenshot_get.py +158 -0
- openapi_client/cyberdesk_cloud_client/api/computer/keyboard_key_v1_computer_machine_id_input_keyboard_key_post.py +183 -0
- openapi_client/cyberdesk_cloud_client/api/computer/keyboard_type_v1_computer_machine_id_input_keyboard_type_post.py +183 -0
- openapi_client/cyberdesk_cloud_client/api/computer/mouse_click_v1_computer_machine_id_input_mouse_click_post.py +187 -0
- openapi_client/cyberdesk_cloud_client/api/computer/mouse_move_v1_computer_machine_id_input_mouse_move_post.py +183 -0
- openapi_client/cyberdesk_cloud_client/api/connections/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/connections/create_connection_v1_connections_post.py +180 -0
- openapi_client/cyberdesk_cloud_client/api/connections/delete_connection_v1_connections_connection_id_delete.py +170 -0
- openapi_client/cyberdesk_cloud_client/api/connections/get_connection_v1_connections_connection_id_get.py +172 -0
- openapi_client/cyberdesk_cloud_client/api/connections/list_connections_v1_connections_get.py +244 -0
- openapi_client/cyberdesk_cloud_client/api/connections/update_connection_v1_connections_connection_id_patch.py +198 -0
- openapi_client/cyberdesk_cloud_client/api/default/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/default/root_get.py +83 -0
- openapi_client/cyberdesk_cloud_client/api/health/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/health/database_health_check_v1_health_db_get.py +146 -0
- openapi_client/cyberdesk_cloud_client/api/health/health_check_v1_health_get.py +144 -0
- openapi_client/cyberdesk_cloud_client/api/machines/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/machines/create_machine_v1_machines_post.py +180 -0
- openapi_client/cyberdesk_cloud_client/api/machines/delete_machine_v1_machines_machine_id_delete.py +174 -0
- openapi_client/cyberdesk_cloud_client/api/machines/get_machine_v1_machines_machine_id_get.py +172 -0
- openapi_client/cyberdesk_cloud_client/api/machines/list_machines_v1_machines_get.py +217 -0
- openapi_client/cyberdesk_cloud_client/api/machines/update_machine_v1_machines_machine_id_patch.py +198 -0
- openapi_client/cyberdesk_cloud_client/api/request_logs/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/request_logs/create_request_log_v1_request_logs_post.py +184 -0
- openapi_client/cyberdesk_cloud_client/api/request_logs/delete_request_log_v1_request_logs_log_id_delete.py +170 -0
- openapi_client/cyberdesk_cloud_client/api/request_logs/get_request_log_v1_request_logs_log_id_get.py +172 -0
- openapi_client/cyberdesk_cloud_client/api/request_logs/list_request_logs_v1_request_logs_get.py +257 -0
- openapi_client/cyberdesk_cloud_client/api/request_logs/update_request_log_v1_request_logs_log_id_patch.py +202 -0
- openapi_client/cyberdesk_cloud_client/api/runs/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/runs/create_run_v1_runs_post.py +188 -0
- openapi_client/cyberdesk_cloud_client/api/runs/delete_run_v1_runs_run_id_delete.py +170 -0
- openapi_client/cyberdesk_cloud_client/api/runs/get_run_v1_runs_run_id_get.py +176 -0
- openapi_client/cyberdesk_cloud_client/api/runs/list_runs_v1_runs_get.py +266 -0
- openapi_client/cyberdesk_cloud_client/api/runs/update_run_v1_runs_run_id_patch.py +202 -0
- openapi_client/cyberdesk_cloud_client/api/test/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/test/dummy_test_endpoint_v1_test_post.py +156 -0
- openapi_client/cyberdesk_cloud_client/api/trajectories/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/trajectories/create_trajectory_v1_trajectories_post.py +184 -0
- openapi_client/cyberdesk_cloud_client/api/trajectories/delete_trajectory_v1_trajectories_trajectory_id_delete.py +170 -0
- openapi_client/cyberdesk_cloud_client/api/trajectories/get_latest_trajectory_for_workflow_v1_workflows_workflow_id_latest_trajectory_get.py +176 -0
- openapi_client/cyberdesk_cloud_client/api/trajectories/get_trajectory_v1_trajectories_trajectory_id_get.py +176 -0
- openapi_client/cyberdesk_cloud_client/api/trajectories/list_trajectories_v1_trajectories_get.py +221 -0
- openapi_client/cyberdesk_cloud_client/api/trajectories/update_trajectory_v1_trajectories_trajectory_id_patch.py +198 -0
- openapi_client/cyberdesk_cloud_client/api/workflows/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/workflows/create_workflow_v1_workflows_post.py +180 -0
- openapi_client/cyberdesk_cloud_client/api/workflows/delete_workflow_v1_workflows_workflow_id_delete.py +174 -0
- openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_v1_workflows_workflow_id_get.py +172 -0
- openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_versions_v1_workflows_workflow_id_versions_get.py +185 -0
- openapi_client/cyberdesk_cloud_client/api/workflows/list_workflows_v1_workflows_get.py +194 -0
- openapi_client/cyberdesk_cloud_client/api/workflows/update_workflow_v1_workflows_workflow_id_patch.py +202 -0
- openapi_client/{api_reference_client → cyberdesk_cloud_client}/client.py +268 -268
- openapi_client/{api_reference_client → cyberdesk_cloud_client}/errors.py +16 -16
- openapi_client/cyberdesk_cloud_client/models/__init__.py +105 -0
- openapi_client/cyberdesk_cloud_client/models/connection_create.py +111 -0
- openapi_client/cyberdesk_cloud_client/models/connection_response.py +171 -0
- openapi_client/{api_reference_client/models/get_v1_desktop_id_response_404_status.py → cyberdesk_cloud_client/models/connection_status.py} +10 -8
- openapi_client/cyberdesk_cloud_client/models/database_health_check_v1_health_db_get_response_database_health_check_v1_health_db_get.py +44 -0
- openapi_client/{api_reference_client/models/post_v1_desktop_id_bash_action_body.py → cyberdesk_cloud_client/models/display_dimensions.py} +67 -59
- openapi_client/cyberdesk_cloud_client/models/dummy_test_endpoint_v1_test_post_response_dummy_test_endpoint_v1_test_post.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/get_workflow_versions_v1_workflows_workflow_id_versions_get_response_200_item.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/health_check_v1_health_get_response_health_check_v1_health_get.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/http_validation_error.py +75 -0
- openapi_client/{api_reference_client/models/post_v1_desktop_body.py → cyberdesk_cloud_client/models/keyboard_key_request.py} +59 -59
- openapi_client/{api_reference_client/models/post_v1_desktop_id_stop_response_200.py → cyberdesk_cloud_client/models/keyboard_type_request.py} +59 -62
- openapi_client/cyberdesk_cloud_client/models/machine_create.py +130 -0
- openapi_client/cyberdesk_cloud_client/models/machine_response.py +182 -0
- openapi_client/{api_reference_client/models/get_v1_desktop_id_response_403_status.py → cyberdesk_cloud_client/models/machine_status.py} +10 -8
- openapi_client/cyberdesk_cloud_client/models/machine_update.py +195 -0
- openapi_client/cyberdesk_cloud_client/models/mouse_click_request.py +109 -0
- openapi_client/{api_reference_client/models/post_v1_desktop_id_computer_action_drag_mouse_action_end.py → cyberdesk_cloud_client/models/mouse_move_request.py} +67 -71
- openapi_client/{api_reference_client/models/post_v1_desktop_id_computer_action_drag_mouse_action_start.py → cyberdesk_cloud_client/models/mouse_position.py} +67 -71
- openapi_client/cyberdesk_cloud_client/models/paginated_response.py +84 -0
- openapi_client/cyberdesk_cloud_client/models/paginated_response_connection_response.py +97 -0
- openapi_client/cyberdesk_cloud_client/models/paginated_response_machine_response.py +97 -0
- openapi_client/cyberdesk_cloud_client/models/paginated_response_run_response.py +97 -0
- openapi_client/cyberdesk_cloud_client/models/paginated_response_trajectory_response.py +97 -0
- openapi_client/cyberdesk_cloud_client/models/paginated_response_workflow_response.py +97 -0
- openapi_client/cyberdesk_cloud_client/models/request_log_create.py +187 -0
- openapi_client/cyberdesk_cloud_client/models/request_log_response.py +230 -0
- openapi_client/cyberdesk_cloud_client/models/request_log_update.py +164 -0
- openapi_client/cyberdesk_cloud_client/models/run_create.py +94 -0
- openapi_client/cyberdesk_cloud_client/models/run_response.py +245 -0
- openapi_client/cyberdesk_cloud_client/models/run_response_output_data_type_0.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/run_response_run_message_history_type_0_item.py +44 -0
- openapi_client/{api_reference_client/models/post_v1_desktop_response_200_status.py → cyberdesk_cloud_client/models/run_status.py} +12 -11
- openapi_client/cyberdesk_cloud_client/models/run_update.py +226 -0
- openapi_client/cyberdesk_cloud_client/models/run_update_output_data_type_0.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/run_update_run_message_history_type_0_item.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/trajectory_create.py +83 -0
- openapi_client/cyberdesk_cloud_client/models/trajectory_create_trajectory_data_item.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/trajectory_response.py +117 -0
- openapi_client/cyberdesk_cloud_client/models/trajectory_response_trajectory_data_item.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/trajectory_update.py +99 -0
- openapi_client/cyberdesk_cloud_client/models/trajectory_update_trajectory_data_type_0_item.py +44 -0
- openapi_client/{api_reference_client/models/post_v1_desktop_id_computer_action_wait_action.py → cyberdesk_cloud_client/models/validation_error.py} +88 -70
- openapi_client/cyberdesk_cloud_client/models/workflow_create.py +82 -0
- openapi_client/cyberdesk_cloud_client/models/workflow_response.py +164 -0
- openapi_client/cyberdesk_cloud_client/models/workflow_response_old_versions_type_0_item.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/workflow_update.py +92 -0
- openapi_client/{api_reference_client → cyberdesk_cloud_client}/types.py +54 -46
- cyberdesk/actions.py +0 -118
- cyberdesk/types.py +0 -50
- cyberdesk-0.2.7.dist-info/METADATA +0 -228
- cyberdesk-0.2.7.dist-info/RECORD +0 -136
- openapi_client/api_reference_client/api/desktop/get_v1_desktop_id.py +0 -293
- openapi_client/api_reference_client/api/desktop/post_v1_desktop.py +0 -294
- openapi_client/api_reference_client/api/desktop/post_v1_desktop_id_bash_action.py +0 -307
- openapi_client/api_reference_client/api/desktop/post_v1_desktop_id_computer_action.py +0 -419
- openapi_client/api_reference_client/api/desktop/post_v1_desktop_id_stop.py +0 -288
- openapi_client/api_reference_client/models/__init__.py +0 -249
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_200.py +0 -104
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_200_status.py +0 -11
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_400.py +0 -69
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_400_status.py +0 -8
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_401.py +0 -69
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_401_status.py +0 -8
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_403.py +0 -69
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_404.py +0 -69
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_409.py +0 -69
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_409_status.py +0 -8
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_429.py +0 -69
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_429_status.py +0 -8
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_500.py +0 -69
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_500_status.py +0 -8
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_502.py +0 -69
- openapi_client/api_reference_client/models/get_v1_desktop_id_response_502_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_200.py +0 -79
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_400.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_400_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_401.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_401_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_403.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_403_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_404.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_404_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_409.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_409_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_429.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_429_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_500.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_500_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_502.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_bash_action_response_502_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_click_mouse_action.py +0 -133
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_click_mouse_action_button.py +0 -10
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_click_mouse_action_click_type.py +0 -10
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_click_mouse_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_drag_mouse_action.py +0 -98
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_drag_mouse_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_get_cursor_position_action.py +0 -64
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_get_cursor_position_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_move_mouse_action.py +0 -80
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_move_mouse_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_press_keys_action.py +0 -109
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_press_keys_action_key_action_type.py +0 -10
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_press_keys_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_200.py +0 -79
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_400.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_400_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_401.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_401_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_403.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_403_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_404.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_404_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_409.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_409_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_429.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_429_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_500.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_500_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_502.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_response_502_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_screenshot_action.py +0 -63
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_screenshot_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_scroll_action.py +0 -81
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_scroll_action_direction.py +0 -11
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_scroll_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_type_text_action.py +0 -71
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_type_text_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_computer_action_wait_action_type.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_200_status.py +0 -11
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_400.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_400_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_401.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_401_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_403.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_403_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_404.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_404_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_409.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_409_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_429.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_429_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_500.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_500_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_502.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_id_stop_response_502_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_response_200.py +0 -70
- openapi_client/api_reference_client/models/post_v1_desktop_response_400.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_response_400_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_response_401.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_response_401_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_response_403.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_response_403_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_response_404.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_response_404_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_response_409.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_response_409_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_response_429.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_response_429_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_response_500.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_response_500_status.py +0 -8
- openapi_client/api_reference_client/models/post_v1_desktop_response_502.py +0 -69
- openapi_client/api_reference_client/models/post_v1_desktop_response_502_status.py +0 -8
- {cyberdesk-0.2.7.dist-info → cyberdesk-1.2.0.dist-info}/licenses/LICENSE +0 -0
- {cyberdesk-0.2.7.dist-info → cyberdesk-1.2.0.dist-info}/top_level.txt +0 -0
- /openapi_client/{api_reference_client → cyberdesk_cloud_client}/py.typed +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar, Union, cast
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
from dateutil.parser import isoparse
|
|
8
|
+
|
|
9
|
+
from ..models.machine_status import MachineStatus
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="MachineUpdate")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class MachineUpdate:
|
|
17
|
+
"""Schema for updating a machine
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
version (Union[None, Unset, str]):
|
|
21
|
+
hostname (Union[None, Unset, str]):
|
|
22
|
+
os_info (Union[None, Unset, str]):
|
|
23
|
+
status (Union[MachineStatus, None, Unset]):
|
|
24
|
+
is_available (Union[None, Unset, bool]):
|
|
25
|
+
last_seen (Union[None, Unset, datetime.datetime]):
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
version: Union[None, Unset, str] = UNSET
|
|
29
|
+
hostname: Union[None, Unset, str] = UNSET
|
|
30
|
+
os_info: Union[None, Unset, str] = UNSET
|
|
31
|
+
status: Union[MachineStatus, None, Unset] = UNSET
|
|
32
|
+
is_available: Union[None, Unset, bool] = UNSET
|
|
33
|
+
last_seen: Union[None, Unset, datetime.datetime] = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
version: Union[None, Unset, str]
|
|
38
|
+
if isinstance(self.version, Unset):
|
|
39
|
+
version = UNSET
|
|
40
|
+
else:
|
|
41
|
+
version = self.version
|
|
42
|
+
|
|
43
|
+
hostname: Union[None, Unset, str]
|
|
44
|
+
if isinstance(self.hostname, Unset):
|
|
45
|
+
hostname = UNSET
|
|
46
|
+
else:
|
|
47
|
+
hostname = self.hostname
|
|
48
|
+
|
|
49
|
+
os_info: Union[None, Unset, str]
|
|
50
|
+
if isinstance(self.os_info, Unset):
|
|
51
|
+
os_info = UNSET
|
|
52
|
+
else:
|
|
53
|
+
os_info = self.os_info
|
|
54
|
+
|
|
55
|
+
status: Union[None, Unset, str]
|
|
56
|
+
if isinstance(self.status, Unset):
|
|
57
|
+
status = UNSET
|
|
58
|
+
elif isinstance(self.status, MachineStatus):
|
|
59
|
+
status = self.status.value
|
|
60
|
+
else:
|
|
61
|
+
status = self.status
|
|
62
|
+
|
|
63
|
+
is_available: Union[None, Unset, bool]
|
|
64
|
+
if isinstance(self.is_available, Unset):
|
|
65
|
+
is_available = UNSET
|
|
66
|
+
else:
|
|
67
|
+
is_available = self.is_available
|
|
68
|
+
|
|
69
|
+
last_seen: Union[None, Unset, str]
|
|
70
|
+
if isinstance(self.last_seen, Unset):
|
|
71
|
+
last_seen = UNSET
|
|
72
|
+
elif isinstance(self.last_seen, datetime.datetime):
|
|
73
|
+
last_seen = self.last_seen.isoformat()
|
|
74
|
+
else:
|
|
75
|
+
last_seen = self.last_seen
|
|
76
|
+
|
|
77
|
+
field_dict: dict[str, Any] = {}
|
|
78
|
+
field_dict.update(self.additional_properties)
|
|
79
|
+
field_dict.update({})
|
|
80
|
+
if version is not UNSET:
|
|
81
|
+
field_dict["version"] = version
|
|
82
|
+
if hostname is not UNSET:
|
|
83
|
+
field_dict["hostname"] = hostname
|
|
84
|
+
if os_info is not UNSET:
|
|
85
|
+
field_dict["os_info"] = os_info
|
|
86
|
+
if status is not UNSET:
|
|
87
|
+
field_dict["status"] = status
|
|
88
|
+
if is_available is not UNSET:
|
|
89
|
+
field_dict["is_available"] = is_available
|
|
90
|
+
if last_seen is not UNSET:
|
|
91
|
+
field_dict["last_seen"] = last_seen
|
|
92
|
+
|
|
93
|
+
return field_dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
97
|
+
d = dict(src_dict)
|
|
98
|
+
|
|
99
|
+
def _parse_version(data: object) -> Union[None, Unset, str]:
|
|
100
|
+
if data is None:
|
|
101
|
+
return data
|
|
102
|
+
if isinstance(data, Unset):
|
|
103
|
+
return data
|
|
104
|
+
return cast(Union[None, Unset, str], data)
|
|
105
|
+
|
|
106
|
+
version = _parse_version(d.pop("version", UNSET))
|
|
107
|
+
|
|
108
|
+
def _parse_hostname(data: object) -> Union[None, Unset, str]:
|
|
109
|
+
if data is None:
|
|
110
|
+
return data
|
|
111
|
+
if isinstance(data, Unset):
|
|
112
|
+
return data
|
|
113
|
+
return cast(Union[None, Unset, str], data)
|
|
114
|
+
|
|
115
|
+
hostname = _parse_hostname(d.pop("hostname", UNSET))
|
|
116
|
+
|
|
117
|
+
def _parse_os_info(data: object) -> Union[None, Unset, str]:
|
|
118
|
+
if data is None:
|
|
119
|
+
return data
|
|
120
|
+
if isinstance(data, Unset):
|
|
121
|
+
return data
|
|
122
|
+
return cast(Union[None, Unset, str], data)
|
|
123
|
+
|
|
124
|
+
os_info = _parse_os_info(d.pop("os_info", UNSET))
|
|
125
|
+
|
|
126
|
+
def _parse_status(data: object) -> Union[MachineStatus, None, Unset]:
|
|
127
|
+
if data is None:
|
|
128
|
+
return data
|
|
129
|
+
if isinstance(data, Unset):
|
|
130
|
+
return data
|
|
131
|
+
try:
|
|
132
|
+
if not isinstance(data, str):
|
|
133
|
+
raise TypeError()
|
|
134
|
+
status_type_0 = MachineStatus(data)
|
|
135
|
+
|
|
136
|
+
return status_type_0
|
|
137
|
+
except: # noqa: E722
|
|
138
|
+
pass
|
|
139
|
+
return cast(Union[MachineStatus, None, Unset], data)
|
|
140
|
+
|
|
141
|
+
status = _parse_status(d.pop("status", UNSET))
|
|
142
|
+
|
|
143
|
+
def _parse_is_available(data: object) -> Union[None, Unset, bool]:
|
|
144
|
+
if data is None:
|
|
145
|
+
return data
|
|
146
|
+
if isinstance(data, Unset):
|
|
147
|
+
return data
|
|
148
|
+
return cast(Union[None, Unset, bool], data)
|
|
149
|
+
|
|
150
|
+
is_available = _parse_is_available(d.pop("is_available", UNSET))
|
|
151
|
+
|
|
152
|
+
def _parse_last_seen(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
153
|
+
if data is None:
|
|
154
|
+
return data
|
|
155
|
+
if isinstance(data, Unset):
|
|
156
|
+
return data
|
|
157
|
+
try:
|
|
158
|
+
if not isinstance(data, str):
|
|
159
|
+
raise TypeError()
|
|
160
|
+
last_seen_type_0 = isoparse(data)
|
|
161
|
+
|
|
162
|
+
return last_seen_type_0
|
|
163
|
+
except: # noqa: E722
|
|
164
|
+
pass
|
|
165
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
166
|
+
|
|
167
|
+
last_seen = _parse_last_seen(d.pop("last_seen", UNSET))
|
|
168
|
+
|
|
169
|
+
machine_update = cls(
|
|
170
|
+
version=version,
|
|
171
|
+
hostname=hostname,
|
|
172
|
+
os_info=os_info,
|
|
173
|
+
status=status,
|
|
174
|
+
is_available=is_available,
|
|
175
|
+
last_seen=last_seen,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
machine_update.additional_properties = d
|
|
179
|
+
return machine_update
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def additional_keys(self) -> list[str]:
|
|
183
|
+
return list(self.additional_properties.keys())
|
|
184
|
+
|
|
185
|
+
def __getitem__(self, key: str) -> Any:
|
|
186
|
+
return self.additional_properties[key]
|
|
187
|
+
|
|
188
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
189
|
+
self.additional_properties[key] = value
|
|
190
|
+
|
|
191
|
+
def __delitem__(self, key: str) -> None:
|
|
192
|
+
del self.additional_properties[key]
|
|
193
|
+
|
|
194
|
+
def __contains__(self, key: str) -> bool:
|
|
195
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,109 @@
|
|
|
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="MouseClickRequest")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class MouseClickRequest:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
x (Union[None, Unset, int]):
|
|
17
|
+
y (Union[None, Unset, int]):
|
|
18
|
+
button (Union[Unset, str]): Default: 'left'.
|
|
19
|
+
down (Union[Unset, bool]): Default: False.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
x: Union[None, Unset, int] = UNSET
|
|
23
|
+
y: Union[None, Unset, int] = UNSET
|
|
24
|
+
button: Union[Unset, str] = "left"
|
|
25
|
+
down: Union[Unset, bool] = False
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
x: Union[None, Unset, int]
|
|
30
|
+
if isinstance(self.x, Unset):
|
|
31
|
+
x = UNSET
|
|
32
|
+
else:
|
|
33
|
+
x = self.x
|
|
34
|
+
|
|
35
|
+
y: Union[None, Unset, int]
|
|
36
|
+
if isinstance(self.y, Unset):
|
|
37
|
+
y = UNSET
|
|
38
|
+
else:
|
|
39
|
+
y = self.y
|
|
40
|
+
|
|
41
|
+
button = self.button
|
|
42
|
+
|
|
43
|
+
down = self.down
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update({})
|
|
48
|
+
if x is not UNSET:
|
|
49
|
+
field_dict["x"] = x
|
|
50
|
+
if y is not UNSET:
|
|
51
|
+
field_dict["y"] = y
|
|
52
|
+
if button is not UNSET:
|
|
53
|
+
field_dict["button"] = button
|
|
54
|
+
if down is not UNSET:
|
|
55
|
+
field_dict["down"] = down
|
|
56
|
+
|
|
57
|
+
return field_dict
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
61
|
+
d = dict(src_dict)
|
|
62
|
+
|
|
63
|
+
def _parse_x(data: object) -> Union[None, Unset, int]:
|
|
64
|
+
if data is None:
|
|
65
|
+
return data
|
|
66
|
+
if isinstance(data, Unset):
|
|
67
|
+
return data
|
|
68
|
+
return cast(Union[None, Unset, int], data)
|
|
69
|
+
|
|
70
|
+
x = _parse_x(d.pop("x", UNSET))
|
|
71
|
+
|
|
72
|
+
def _parse_y(data: object) -> Union[None, Unset, int]:
|
|
73
|
+
if data is None:
|
|
74
|
+
return data
|
|
75
|
+
if isinstance(data, Unset):
|
|
76
|
+
return data
|
|
77
|
+
return cast(Union[None, Unset, int], data)
|
|
78
|
+
|
|
79
|
+
y = _parse_y(d.pop("y", UNSET))
|
|
80
|
+
|
|
81
|
+
button = d.pop("button", UNSET)
|
|
82
|
+
|
|
83
|
+
down = d.pop("down", UNSET)
|
|
84
|
+
|
|
85
|
+
mouse_click_request = cls(
|
|
86
|
+
x=x,
|
|
87
|
+
y=y,
|
|
88
|
+
button=button,
|
|
89
|
+
down=down,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
mouse_click_request.additional_properties = d
|
|
93
|
+
return mouse_click_request
|
|
94
|
+
|
|
95
|
+
@property
|
|
96
|
+
def additional_keys(self) -> list[str]:
|
|
97
|
+
return list(self.additional_properties.keys())
|
|
98
|
+
|
|
99
|
+
def __getitem__(self, key: str) -> Any:
|
|
100
|
+
return self.additional_properties[key]
|
|
101
|
+
|
|
102
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
103
|
+
self.additional_properties[key] = value
|
|
104
|
+
|
|
105
|
+
def __delitem__(self, key: str) -> None:
|
|
106
|
+
del self.additional_properties[key]
|
|
107
|
+
|
|
108
|
+
def __contains__(self, key: str) -> bool:
|
|
109
|
+
return key in self.additional_properties
|
|
@@ -1,71 +1,67 @@
|
|
|
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="
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@_attrs_define
|
|
11
|
-
class
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
del self.additional_properties[key]
|
|
69
|
-
|
|
70
|
-
def __contains__(self, key: str) -> bool:
|
|
71
|
-
return key in self.additional_properties
|
|
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="MouseMoveRequest")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class MouseMoveRequest:
|
|
12
|
+
"""
|
|
13
|
+
Attributes:
|
|
14
|
+
x (int):
|
|
15
|
+
y (int):
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
x: int
|
|
19
|
+
y: int
|
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
x = self.x
|
|
24
|
+
|
|
25
|
+
y = self.y
|
|
26
|
+
|
|
27
|
+
field_dict: dict[str, Any] = {}
|
|
28
|
+
field_dict.update(self.additional_properties)
|
|
29
|
+
field_dict.update(
|
|
30
|
+
{
|
|
31
|
+
"x": x,
|
|
32
|
+
"y": y,
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
return field_dict
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
40
|
+
d = dict(src_dict)
|
|
41
|
+
x = d.pop("x")
|
|
42
|
+
|
|
43
|
+
y = d.pop("y")
|
|
44
|
+
|
|
45
|
+
mouse_move_request = cls(
|
|
46
|
+
x=x,
|
|
47
|
+
y=y,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
mouse_move_request.additional_properties = d
|
|
51
|
+
return mouse_move_request
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def additional_keys(self) -> list[str]:
|
|
55
|
+
return list(self.additional_properties.keys())
|
|
56
|
+
|
|
57
|
+
def __getitem__(self, key: str) -> Any:
|
|
58
|
+
return self.additional_properties[key]
|
|
59
|
+
|
|
60
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
61
|
+
self.additional_properties[key] = value
|
|
62
|
+
|
|
63
|
+
def __delitem__(self, key: str) -> None:
|
|
64
|
+
del self.additional_properties[key]
|
|
65
|
+
|
|
66
|
+
def __contains__(self, key: str) -> bool:
|
|
67
|
+
return key in self.additional_properties
|
|
@@ -1,71 +1,67 @@
|
|
|
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="
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@_attrs_define
|
|
11
|
-
class
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
del self.additional_properties[key]
|
|
69
|
-
|
|
70
|
-
def __contains__(self, key: str) -> bool:
|
|
71
|
-
return key in self.additional_properties
|
|
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="MousePosition")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class MousePosition:
|
|
12
|
+
"""
|
|
13
|
+
Attributes:
|
|
14
|
+
x (int):
|
|
15
|
+
y (int):
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
x: int
|
|
19
|
+
y: int
|
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
x = self.x
|
|
24
|
+
|
|
25
|
+
y = self.y
|
|
26
|
+
|
|
27
|
+
field_dict: dict[str, Any] = {}
|
|
28
|
+
field_dict.update(self.additional_properties)
|
|
29
|
+
field_dict.update(
|
|
30
|
+
{
|
|
31
|
+
"x": x,
|
|
32
|
+
"y": y,
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
return field_dict
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
40
|
+
d = dict(src_dict)
|
|
41
|
+
x = d.pop("x")
|
|
42
|
+
|
|
43
|
+
y = d.pop("y")
|
|
44
|
+
|
|
45
|
+
mouse_position = cls(
|
|
46
|
+
x=x,
|
|
47
|
+
y=y,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
mouse_position.additional_properties = d
|
|
51
|
+
return mouse_position
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def additional_keys(self) -> list[str]:
|
|
55
|
+
return list(self.additional_properties.keys())
|
|
56
|
+
|
|
57
|
+
def __getitem__(self, key: str) -> Any:
|
|
58
|
+
return self.additional_properties[key]
|
|
59
|
+
|
|
60
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
61
|
+
self.additional_properties[key] = value
|
|
62
|
+
|
|
63
|
+
def __delitem__(self, key: str) -> None:
|
|
64
|
+
del self.additional_properties[key]
|
|
65
|
+
|
|
66
|
+
def __contains__(self, key: str) -> bool:
|
|
67
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="PaginatedResponse")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class PaginatedResponse:
|
|
12
|
+
"""Paginated response wrapper
|
|
13
|
+
|
|
14
|
+
Attributes:
|
|
15
|
+
items (list[Any]):
|
|
16
|
+
total (int):
|
|
17
|
+
skip (int):
|
|
18
|
+
limit (int):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
items: list[Any]
|
|
22
|
+
total: int
|
|
23
|
+
skip: int
|
|
24
|
+
limit: int
|
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
|
+
|
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
|
28
|
+
items = self.items
|
|
29
|
+
|
|
30
|
+
total = self.total
|
|
31
|
+
|
|
32
|
+
skip = self.skip
|
|
33
|
+
|
|
34
|
+
limit = self.limit
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
field_dict.update(
|
|
39
|
+
{
|
|
40
|
+
"items": items,
|
|
41
|
+
"total": total,
|
|
42
|
+
"skip": skip,
|
|
43
|
+
"limit": limit,
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
items = cast(list[Any], d.pop("items"))
|
|
53
|
+
|
|
54
|
+
total = d.pop("total")
|
|
55
|
+
|
|
56
|
+
skip = d.pop("skip")
|
|
57
|
+
|
|
58
|
+
limit = d.pop("limit")
|
|
59
|
+
|
|
60
|
+
paginated_response = cls(
|
|
61
|
+
items=items,
|
|
62
|
+
total=total,
|
|
63
|
+
skip=skip,
|
|
64
|
+
limit=limit,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
paginated_response.additional_properties = d
|
|
68
|
+
return paginated_response
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def additional_keys(self) -> list[str]:
|
|
72
|
+
return list(self.additional_properties.keys())
|
|
73
|
+
|
|
74
|
+
def __getitem__(self, key: str) -> Any:
|
|
75
|
+
return self.additional_properties[key]
|
|
76
|
+
|
|
77
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
78
|
+
self.additional_properties[key] = value
|
|
79
|
+
|
|
80
|
+
def __delitem__(self, key: str) -> None:
|
|
81
|
+
del self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __contains__(self, key: str) -> bool:
|
|
84
|
+
return key in self.additional_properties
|