frameio 0.0.28__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.
- frameio/__init__.py +1158 -0
- frameio/account_permissions/__init__.py +4 -0
- frameio/account_permissions/client.py +193 -0
- frameio/account_permissions/raw_client.py +333 -0
- frameio/accounts/__init__.py +4 -0
- frameio/accounts/client.py +162 -0
- frameio/accounts/raw_client.py +309 -0
- frameio/client.py +439 -0
- frameio/comments/__init__.py +38 -0
- frameio/comments/client.py +654 -0
- frameio/comments/raw_client.py +1316 -0
- frameio/comments/types/__init__.py +40 -0
- frameio/comments/types/comments_show_request_include.py +5 -0
- frameio/comments/types/create_comment_params_data.py +33 -0
- frameio/comments/types/update_comment_params_data.py +33 -0
- frameio/core/__init__.py +122 -0
- frameio/core/api_error.py +23 -0
- frameio/core/client_wrapper.py +95 -0
- frameio/core/custom_pagination.py +152 -0
- frameio/core/datetime_utils.py +28 -0
- frameio/core/file.py +67 -0
- frameio/core/force_multipart.py +18 -0
- frameio/core/http_client.py +663 -0
- frameio/core/http_response.py +55 -0
- frameio/core/http_sse/__init__.py +42 -0
- frameio/core/http_sse/_api.py +112 -0
- frameio/core/http_sse/_decoders.py +61 -0
- frameio/core/http_sse/_exceptions.py +7 -0
- frameio/core/http_sse/_models.py +17 -0
- frameio/core/jsonable_encoder.py +100 -0
- frameio/core/pagination.py +82 -0
- frameio/core/pydantic_utilities.py +361 -0
- frameio/core/query_encoder.py +58 -0
- frameio/core/remove_none_from_dict.py +11 -0
- frameio/core/request_options.py +35 -0
- frameio/core/serialization.py +276 -0
- frameio/core/unchecked_base_model.py +376 -0
- frameio/environment.py +7 -0
- frameio/errors/__init__.py +53 -0
- frameio/errors/bad_request_error.py +11 -0
- frameio/errors/forbidden_error.py +11 -0
- frameio/errors/not_found_error.py +11 -0
- frameio/errors/too_many_requests_error.py +11 -0
- frameio/errors/unauthorized_error.py +11 -0
- frameio/errors/unprocessable_entity_error.py +10 -0
- frameio/files/__init__.py +58 -0
- frameio/files/client.py +1171 -0
- frameio/files/raw_client.py +2517 -0
- frameio/files/types/__init__.py +56 -0
- frameio/files/types/file_copy_params_data.py +15 -0
- frameio/files/types/file_create_local_upload_params_data.py +20 -0
- frameio/files/types/file_create_params_data.py +31 -0
- frameio/files/types/file_create_remote_upload_params_data.py +20 -0
- frameio/files/types/file_move_params_data.py +15 -0
- frameio/files/types/file_update_params_data.py +15 -0
- frameio/files/types/files_copy_request_copy_comments.py +5 -0
- frameio/folders/__init__.py +39 -0
- frameio/folders/client.py +1004 -0
- frameio/folders/raw_client.py +2074 -0
- frameio/folders/types/__init__.py +42 -0
- frameio/folders/types/folder_copy_params_data.py +15 -0
- frameio/folders/types/folder_create_params_data.py +15 -0
- frameio/folders/types/folder_move_params_data.py +15 -0
- frameio/folders/types/folder_update_params_data.py +15 -0
- frameio/metadata/__init__.py +37 -0
- frameio/metadata/client.py +293 -0
- frameio/metadata/raw_client.py +509 -0
- frameio/metadata/types/__init__.py +38 -0
- frameio/metadata/types/bulk_update_metadata_params_data.py +23 -0
- frameio/metadata/types/bulk_update_metadata_params_data_values_item.py +13 -0
- frameio/metadata_fields/__init__.py +103 -0
- frameio/metadata_fields/client.py +536 -0
- frameio/metadata_fields/raw_client.py +996 -0
- frameio/metadata_fields/types/__init__.py +105 -0
- frameio/metadata_fields/types/create_field_definition_params_data.py +112 -0
- frameio/metadata_fields/types/update_field_definition_params_data.py +118 -0
- frameio/project_permissions/__init__.py +4 -0
- frameio/project_permissions/client.py +426 -0
- frameio/project_permissions/raw_client.py +824 -0
- frameio/projects/__init__.py +38 -0
- frameio/projects/client.py +604 -0
- frameio/projects/raw_client.py +1286 -0
- frameio/projects/types/__init__.py +40 -0
- frameio/projects/types/project_params_data.py +20 -0
- frameio/projects/types/project_update_params_data.py +26 -0
- frameio/projects/types/project_update_params_data_status.py +5 -0
- frameio/py.typed +0 -0
- frameio/shares/__init__.py +64 -0
- frameio/shares/client.py +1217 -0
- frameio/shares/raw_client.py +2511 -0
- frameio/shares/types/__init__.py +61 -0
- frameio/shares/types/add_asset_params_data.py +15 -0
- frameio/shares/types/add_reviewers_to_share_params_data.py +18 -0
- frameio/shares/types/add_reviewers_to_share_params_data_reviewers.py +27 -0
- frameio/shares/types/create_share_params_data.py +26 -0
- frameio/shares/types/remove_reviewer_params_data.py +13 -0
- frameio/shares/types/remove_reviewer_params_data_reviewers.py +27 -0
- frameio/shares/types/update_share_params_data.py +34 -0
- frameio/shares/types/update_share_params_data_access.py +5 -0
- frameio/types/__init__.py +983 -0
- frameio/types/account.py +70 -0
- frameio/types/account_roles_item.py +5 -0
- frameio/types/account_user_role.py +23 -0
- frameio/types/account_user_role_role.py +5 -0
- frameio/types/account_user_roles_response.py +27 -0
- frameio/types/accounts_response.py +23 -0
- frameio/types/add_asset_response.py +13 -0
- frameio/types/add_asset_response_data.py +15 -0
- frameio/types/asset_common.py +48 -0
- frameio/types/asset_common_type.py +5 -0
- frameio/types/asset_common_with_includes.py +58 -0
- frameio/types/asset_common_with_includes_type.py +5 -0
- frameio/types/asset_include.py +5 -0
- frameio/types/asset_share_params.py +39 -0
- frameio/types/asset_share_params_access.py +5 -0
- frameio/types/asset_with_includes.py +76 -0
- frameio/types/assets_with_includes_response.py +23 -0
- frameio/types/bad_request.py +13 -0
- frameio/types/bad_request_errors_item.py +15 -0
- frameio/types/bad_request_errors_item_source.py +12 -0
- frameio/types/boolean_value.py +12 -0
- frameio/types/children_type.py +3 -0
- frameio/types/comment.py +59 -0
- frameio/types/comment_include.py +5 -0
- frameio/types/comment_response.py +13 -0
- frameio/types/comment_with_includes.py +17 -0
- frameio/types/comment_with_includes_response.py +13 -0
- frameio/types/comments_with_includes_response.py +23 -0
- frameio/types/date_definition.py +49 -0
- frameio/types/date_definition_field_configuration.py +21 -0
- frameio/types/date_definition_field_configuration_display_format.py +7 -0
- frameio/types/date_definition_field_configuration_time_format.py +5 -0
- frameio/types/date_definition_field_type.py +10 -0
- frameio/types/date_definition_params.py +17 -0
- frameio/types/date_definition_params_field_configuration.py +23 -0
- frameio/types/date_definition_params_field_configuration_display_format.py +7 -0
- frameio/types/date_definition_params_field_configuration_time_format.py +7 -0
- frameio/types/date_definition_with_includes.py +13 -0
- frameio/types/date_value.py +12 -0
- frameio/types/email.py +3 -0
- frameio/types/empty_json.py +5 -0
- frameio/types/field_definition.py +167 -0
- frameio/types/field_definition_include.py +5 -0
- frameio/types/field_definition_response.py +13 -0
- frameio/types/field_definition_with_includes.py +178 -0
- frameio/types/field_definitions_with_includes_response.py +27 -0
- frameio/types/field_value_common.py +29 -0
- frameio/types/file.py +60 -0
- frameio/types/file_copy_response.py +13 -0
- frameio/types/file_remote_upload_response.py +17 -0
- frameio/types/file_response.py +13 -0
- frameio/types/file_status.py +5 -0
- frameio/types/file_upload_status.py +41 -0
- frameio/types/file_upload_status_response.py +13 -0
- frameio/types/file_with_includes.py +25 -0
- frameio/types/file_with_includes_response.py +13 -0
- frameio/types/file_with_includes_status.py +5 -0
- frameio/types/file_with_media_links_include.py +19 -0
- frameio/types/file_with_upload_urls.py +16 -0
- frameio/types/file_with_upload_urls_response.py +13 -0
- frameio/types/folder.py +15 -0
- frameio/types/folder_copy_response.py +13 -0
- frameio/types/folder_response.py +13 -0
- frameio/types/folder_with_includes.py +63 -0
- frameio/types/folder_with_includes_response.py +13 -0
- frameio/types/folders_with_includes_response.py +23 -0
- frameio/types/forbidden.py +13 -0
- frameio/types/forbidden_errors_item.py +15 -0
- frameio/types/forbidden_errors_item_source.py +12 -0
- frameio/types/include.py +5 -0
- frameio/types/include_total_count.py +3 -0
- frameio/types/integer_value.py +12 -0
- frameio/types/json_error_response.py +13 -0
- frameio/types/json_error_response_errors_item.py +15 -0
- frameio/types/json_error_response_errors_item_source.py +12 -0
- frameio/types/links.py +22 -0
- frameio/types/long_text_definition.py +49 -0
- frameio/types/long_text_definition_field_configuration.py +10 -0
- frameio/types/long_text_definition_field_type.py +10 -0
- frameio/types/long_text_definition_params.py +15 -0
- frameio/types/long_text_definition_with_includes.py +13 -0
- frameio/types/media_link_common.py +17 -0
- frameio/types/media_links_collection.py +24 -0
- frameio/types/metadata_field.py +149 -0
- frameio/types/metadata_response.py +13 -0
- frameio/types/metadata_with_definition.py +21 -0
- frameio/types/multi_select_value.py +14 -0
- frameio/types/multi_user_value.py +20 -0
- frameio/types/multi_user_value_member_options_type.py +5 -0
- frameio/types/no_content.py +3 -0
- frameio/types/not_found.py +13 -0
- frameio/types/not_found_errors_item.py +15 -0
- frameio/types/not_found_errors_item_source.py +12 -0
- frameio/types/number_definition.py +43 -0
- frameio/types/number_definition_field_configuration.py +21 -0
- frameio/types/number_definition_field_configuration_number_format.py +7 -0
- frameio/types/number_definition_params.py +17 -0
- frameio/types/number_definition_params_field_configuration.py +23 -0
- frameio/types/number_definition_params_field_configuration_number_format.py +7 -0
- frameio/types/number_definition_with_includes.py +13 -0
- frameio/types/number_value.py +12 -0
- frameio/types/original_media_link.py +16 -0
- frameio/types/profile.py +34 -0
- frameio/types/profile_response.py +17 -0
- frameio/types/project.py +66 -0
- frameio/types/project_include.py +5 -0
- frameio/types/project_response.py +17 -0
- frameio/types/project_status.py +5 -0
- frameio/types/project_with_includes.py +18 -0
- frameio/types/project_with_includes_response.py +17 -0
- frameio/types/projects_with_includes_response.py +27 -0
- frameio/types/rating_definition.py +43 -0
- frameio/types/rating_definition_field_configuration.py +22 -0
- frameio/types/rating_definition_field_configuration_style.py +5 -0
- frameio/types/rating_definition_params.py +17 -0
- frameio/types/rating_definition_params_field_configuration.py +22 -0
- frameio/types/rating_definition_params_field_configuration_style.py +5 -0
- frameio/types/rating_definition_with_includes.py +13 -0
- frameio/types/remove_asset_response.py +13 -0
- frameio/types/remove_asset_response_data.py +15 -0
- frameio/types/rendition_media_link.py +19 -0
- frameio/types/request_after_opaque_cursor.py +5 -0
- frameio/types/request_page_size.py +3 -0
- frameio/types/select_definition.py +43 -0
- frameio/types/select_definition_field_configuration.py +18 -0
- frameio/types/select_definition_field_configuration_options_item.py +22 -0
- frameio/types/select_definition_params.py +17 -0
- frameio/types/select_definition_params_field_configuration.py +20 -0
- frameio/types/select_definition_params_field_configuration_options_item.py +20 -0
- frameio/types/select_definition_with_includes.py +13 -0
- frameio/types/select_multi_definition.py +49 -0
- frameio/types/select_multi_definition_field_configuration.py +18 -0
- frameio/types/select_multi_definition_field_configuration_options_item.py +22 -0
- frameio/types/select_multi_definition_field_type.py +10 -0
- frameio/types/select_multi_definition_params.py +17 -0
- frameio/types/select_multi_definition_params_field_configuration.py +20 -0
- frameio/types/select_multi_definition_params_field_configuration_options_item.py +20 -0
- frameio/types/select_multi_definition_with_includes.py +13 -0
- frameio/types/select_option.py +20 -0
- frameio/types/select_value.py +14 -0
- frameio/types/share.py +66 -0
- frameio/types/share_access.py +5 -0
- frameio/types/share_response.py +13 -0
- frameio/types/share_reviewers_response.py +27 -0
- frameio/types/shares_response.py +27 -0
- frameio/types/single_user_value.py +20 -0
- frameio/types/single_user_value_member_options_type.py +5 -0
- frameio/types/text_definition.py +49 -0
- frameio/types/text_definition_field_configuration.py +10 -0
- frameio/types/text_definition_field_type.py +10 -0
- frameio/types/text_definition_params.py +15 -0
- frameio/types/text_definition_with_includes.py +13 -0
- frameio/types/text_value.py +12 -0
- frameio/types/time_stamp.py +5 -0
- frameio/types/toggle_definition.py +43 -0
- frameio/types/toggle_definition_field_configuration.py +15 -0
- frameio/types/toggle_definition_params.py +17 -0
- frameio/types/toggle_definition_params_field_configuration.py +15 -0
- frameio/types/toggle_definition_with_includes.py +13 -0
- frameio/types/too_many_requests.py +13 -0
- frameio/types/too_many_requests_errors_item.py +15 -0
- frameio/types/too_many_requests_errors_item_source.py +12 -0
- frameio/types/unauthorized.py +13 -0
- frameio/types/unauthorized_errors_item.py +15 -0
- frameio/types/unauthorized_errors_item_source.py +12 -0
- frameio/types/unprocessable_entity.py +13 -0
- frameio/types/unprocessable_entity_errors_item.py +15 -0
- frameio/types/unprocessable_entity_errors_item_source.py +12 -0
- frameio/types/update_date_definition_params.py +17 -0
- frameio/types/update_date_definition_params_field_configuration.py +25 -0
- frameio/types/update_date_definition_params_field_configuration_display_format.py +7 -0
- frameio/types/update_date_definition_params_field_configuration_time_format.py +7 -0
- frameio/types/update_long_text_definition_params.py +15 -0
- frameio/types/update_number_definition_params.py +17 -0
- frameio/types/update_number_definition_params_field_configuration.py +25 -0
- frameio/types/update_number_definition_params_field_configuration_number_format.py +7 -0
- frameio/types/update_rating_definition_params.py +17 -0
- frameio/types/update_rating_definition_params_field_configuration.py +24 -0
- frameio/types/update_rating_definition_params_field_configuration_style.py +7 -0
- frameio/types/update_select_definition_params.py +17 -0
- frameio/types/update_select_definition_params_field_configuration.py +20 -0
- frameio/types/update_select_definition_params_field_configuration_options_item.py +20 -0
- frameio/types/update_select_multi_definition_params.py +19 -0
- frameio/types/update_select_multi_definition_params_field_configuration.py +20 -0
- frameio/types/update_select_multi_definition_params_field_configuration_options_item.py +20 -0
- frameio/types/update_text_definition_params.py +15 -0
- frameio/types/update_toggle_definition_params.py +17 -0
- frameio/types/update_toggle_definition_params_field_configuration.py +15 -0
- frameio/types/update_user_multi_definition_params.py +17 -0
- frameio/types/update_user_multi_definition_params_field_configuration.py +25 -0
- frameio/types/update_user_multi_definition_params_field_configuration_custom_members_item.py +20 -0
- frameio/types/update_user_multi_definition_params_field_configuration_custom_members_item_type.py +7 -0
- frameio/types/update_user_multi_definition_params_field_configuration_member_options_type.py +7 -0
- frameio/types/update_user_roles_params.py +17 -0
- frameio/types/update_user_roles_params_data.py +13 -0
- frameio/types/update_user_roles_params_data_role.py +7 -0
- frameio/types/update_user_roles_response.py +13 -0
- frameio/types/update_user_roles_response_data.py +13 -0
- frameio/types/update_user_roles_response_data_role.py +7 -0
- frameio/types/update_user_single_definition_params.py +17 -0
- frameio/types/update_user_single_definition_params_field_configuration.py +25 -0
- frameio/types/update_user_single_definition_params_field_configuration_custom_members_item.py +20 -0
- frameio/types/update_user_single_definition_params_field_configuration_custom_members_item_type.py +7 -0
- frameio/types/update_user_single_definition_params_field_configuration_member_options_type.py +7 -0
- frameio/types/upload_url.py +20 -0
- frameio/types/user.py +44 -0
- frameio/types/user_multi_definition.py +49 -0
- frameio/types/user_multi_definition_field_configuration.py +23 -0
- frameio/types/user_multi_definition_field_configuration_custom_members_item.py +20 -0
- frameio/types/user_multi_definition_field_configuration_custom_members_item_type.py +7 -0
- frameio/types/user_multi_definition_field_configuration_member_options_type.py +7 -0
- frameio/types/user_multi_definition_field_type.py +10 -0
- frameio/types/user_multi_definition_params.py +17 -0
- frameio/types/user_multi_definition_params_field_configuration.py +23 -0
- frameio/types/user_multi_definition_params_field_configuration_custom_members_item.py +20 -0
- frameio/types/user_multi_definition_params_field_configuration_custom_members_item_type.py +7 -0
- frameio/types/user_multi_definition_params_field_configuration_member_options_type.py +7 -0
- frameio/types/user_multi_definition_with_includes.py +13 -0
- frameio/types/user_role.py +19 -0
- frameio/types/user_role_role.py +7 -0
- frameio/types/user_roles_response.py +27 -0
- frameio/types/user_single_definition.py +49 -0
- frameio/types/user_single_definition_field_configuration.py +23 -0
- frameio/types/user_single_definition_field_configuration_custom_members_item.py +20 -0
- frameio/types/user_single_definition_field_configuration_custom_members_item_type.py +7 -0
- frameio/types/user_single_definition_field_configuration_member_options_type.py +7 -0
- frameio/types/user_single_definition_field_type.py +10 -0
- frameio/types/user_single_definition_params.py +17 -0
- frameio/types/user_single_definition_params_field_configuration.py +23 -0
- frameio/types/user_single_definition_params_field_configuration_custom_members_item.py +20 -0
- frameio/types/user_single_definition_params_field_configuration_custom_members_item_type.py +7 -0
- frameio/types/user_single_definition_params_field_configuration_member_options_type.py +7 -0
- frameio/types/user_single_definition_with_includes.py +13 -0
- frameio/types/user_value.py +18 -0
- frameio/types/user_value_type.py +5 -0
- frameio/types/uuid_.py +3 -0
- frameio/types/version_stack.py +50 -0
- frameio/types/version_stack_copy_response.py +13 -0
- frameio/types/version_stack_response.py +13 -0
- frameio/types/version_stack_with_includes.py +60 -0
- frameio/types/version_stack_with_includes_response.py +13 -0
- frameio/types/version_stacks_with_includes_response.py +19 -0
- frameio/types/webhook.py +36 -0
- frameio/types/webhook_create_response.py +17 -0
- frameio/types/webhook_create_response_data.py +15 -0
- frameio/types/webhook_events.py +5 -0
- frameio/types/webhook_response.py +13 -0
- frameio/types/webhook_with_includes.py +13 -0
- frameio/types/webhook_with_includes_response.py +13 -0
- frameio/types/webhooks_with_includes_response.py +23 -0
- frameio/types/workspace.py +40 -0
- frameio/types/workspace_include.py +5 -0
- frameio/types/workspace_params.py +17 -0
- frameio/types/workspace_params_data.py +15 -0
- frameio/types/workspace_response.py +17 -0
- frameio/types/workspace_with_includes.py +13 -0
- frameio/types/workspace_with_includes_response.py +17 -0
- frameio/types/workspaces_with_includes_response.py +27 -0
- frameio/users/__init__.py +4 -0
- frameio/users/client.py +100 -0
- frameio/users/raw_client.py +234 -0
- frameio/version.py +3 -0
- frameio/version_stacks/__init__.py +49 -0
- frameio/version_stacks/client.py +818 -0
- frameio/version_stacks/raw_client.py +1614 -0
- frameio/version_stacks/types/__init__.py +47 -0
- frameio/version_stacks/types/version_stack_copy_params_data.py +15 -0
- frameio/version_stacks/types/version_stack_create_params_data.py +19 -0
- frameio/version_stacks/types/version_stack_move_params_data.py +15 -0
- frameio/version_stacks/types/version_stacks_show_request_include.py +19 -0
- frameio/webhooks/__init__.py +34 -0
- frameio/webhooks/client.py +793 -0
- frameio/webhooks/raw_client.py +1347 -0
- frameio/webhooks/types/__init__.py +38 -0
- frameio/webhooks/types/webhook_create_params_data.py +18 -0
- frameio/webhooks/types/webhook_update_params_data.py +23 -0
- frameio/workspace_permissions/__init__.py +4 -0
- frameio/workspace_permissions/client.py +430 -0
- frameio/workspace_permissions/raw_client.py +824 -0
- frameio/workspaces/__init__.py +4 -0
- frameio/workspaces/client.py +563 -0
- frameio/workspaces/raw_client.py +1259 -0
- frameio-0.0.28.dist-info/METADATA +259 -0
- frameio-0.0.28.dist-info/RECORD +385 -0
- frameio-0.0.28.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,2074 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
12
|
+
from ..core.unchecked_base_model import construct_type
|
|
13
|
+
from ..errors.bad_request_error import BadRequestError
|
|
14
|
+
from ..errors.forbidden_error import ForbiddenError
|
|
15
|
+
from ..errors.not_found_error import NotFoundError
|
|
16
|
+
from ..errors.too_many_requests_error import TooManyRequestsError
|
|
17
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
|
18
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
19
|
+
from ..types.asset_include import AssetInclude
|
|
20
|
+
from ..types.assets_with_includes_response import AssetsWithIncludesResponse
|
|
21
|
+
from ..types.bad_request import BadRequest
|
|
22
|
+
from ..types.children_type import ChildrenType
|
|
23
|
+
from ..types.file_with_media_links_include import FileWithMediaLinksInclude
|
|
24
|
+
from ..types.folder_copy_response import FolderCopyResponse
|
|
25
|
+
from ..types.folder_response import FolderResponse
|
|
26
|
+
from ..types.folder_with_includes_response import FolderWithIncludesResponse
|
|
27
|
+
from ..types.folders_with_includes_response import FoldersWithIncludesResponse
|
|
28
|
+
from ..types.forbidden import Forbidden
|
|
29
|
+
from ..types.include_total_count import IncludeTotalCount
|
|
30
|
+
from ..types.not_found import NotFound
|
|
31
|
+
from ..types.request_after_opaque_cursor import RequestAfterOpaqueCursor
|
|
32
|
+
from ..types.request_page_size import RequestPageSize
|
|
33
|
+
from ..types.too_many_requests import TooManyRequests
|
|
34
|
+
from ..types.unauthorized import Unauthorized
|
|
35
|
+
from ..types.uuid_ import Uuid
|
|
36
|
+
from .types.folder_copy_params_data import FolderCopyParamsData
|
|
37
|
+
from .types.folder_create_params_data import FolderCreateParamsData
|
|
38
|
+
from .types.folder_move_params_data import FolderMoveParamsData
|
|
39
|
+
from .types.folder_update_params_data import FolderUpdateParamsData
|
|
40
|
+
|
|
41
|
+
# this is used as the default value for optional parameters
|
|
42
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class RawFoldersClient:
|
|
46
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
47
|
+
self._client_wrapper = client_wrapper
|
|
48
|
+
|
|
49
|
+
def show(
|
|
50
|
+
self,
|
|
51
|
+
account_id: Uuid,
|
|
52
|
+
folder_id: Uuid,
|
|
53
|
+
*,
|
|
54
|
+
include: typing.Optional[AssetInclude] = None,
|
|
55
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
56
|
+
) -> HttpResponse[FolderWithIncludesResponse]:
|
|
57
|
+
"""
|
|
58
|
+
Show folder details. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
59
|
+
|
|
60
|
+
Parameters
|
|
61
|
+
----------
|
|
62
|
+
account_id : Uuid
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
folder_id : Uuid
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
include : typing.Optional[AssetInclude]
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
request_options : typing.Optional[RequestOptions]
|
|
72
|
+
Request-specific configuration.
|
|
73
|
+
|
|
74
|
+
Returns
|
|
75
|
+
-------
|
|
76
|
+
HttpResponse[FolderWithIncludesResponse]
|
|
77
|
+
OK
|
|
78
|
+
"""
|
|
79
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
80
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}",
|
|
81
|
+
method="GET",
|
|
82
|
+
params={
|
|
83
|
+
"include": include,
|
|
84
|
+
},
|
|
85
|
+
request_options=request_options,
|
|
86
|
+
)
|
|
87
|
+
try:
|
|
88
|
+
if 200 <= _response.status_code < 300:
|
|
89
|
+
_data = typing.cast(
|
|
90
|
+
FolderWithIncludesResponse,
|
|
91
|
+
construct_type(
|
|
92
|
+
type_=FolderWithIncludesResponse, # type: ignore
|
|
93
|
+
object_=_response.json(),
|
|
94
|
+
),
|
|
95
|
+
)
|
|
96
|
+
return HttpResponse(response=_response, data=_data)
|
|
97
|
+
if _response.status_code == 400:
|
|
98
|
+
raise BadRequestError(
|
|
99
|
+
headers=dict(_response.headers),
|
|
100
|
+
body=typing.cast(
|
|
101
|
+
BadRequest,
|
|
102
|
+
construct_type(
|
|
103
|
+
type_=BadRequest, # type: ignore
|
|
104
|
+
object_=_response.json(),
|
|
105
|
+
),
|
|
106
|
+
),
|
|
107
|
+
)
|
|
108
|
+
if _response.status_code == 401:
|
|
109
|
+
raise UnauthorizedError(
|
|
110
|
+
headers=dict(_response.headers),
|
|
111
|
+
body=typing.cast(
|
|
112
|
+
Unauthorized,
|
|
113
|
+
construct_type(
|
|
114
|
+
type_=Unauthorized, # type: ignore
|
|
115
|
+
object_=_response.json(),
|
|
116
|
+
),
|
|
117
|
+
),
|
|
118
|
+
)
|
|
119
|
+
if _response.status_code == 403:
|
|
120
|
+
raise ForbiddenError(
|
|
121
|
+
headers=dict(_response.headers),
|
|
122
|
+
body=typing.cast(
|
|
123
|
+
Forbidden,
|
|
124
|
+
construct_type(
|
|
125
|
+
type_=Forbidden, # type: ignore
|
|
126
|
+
object_=_response.json(),
|
|
127
|
+
),
|
|
128
|
+
),
|
|
129
|
+
)
|
|
130
|
+
if _response.status_code == 404:
|
|
131
|
+
raise NotFoundError(
|
|
132
|
+
headers=dict(_response.headers),
|
|
133
|
+
body=typing.cast(
|
|
134
|
+
NotFound,
|
|
135
|
+
construct_type(
|
|
136
|
+
type_=NotFound, # type: ignore
|
|
137
|
+
object_=_response.json(),
|
|
138
|
+
),
|
|
139
|
+
),
|
|
140
|
+
)
|
|
141
|
+
if _response.status_code == 422:
|
|
142
|
+
raise UnprocessableEntityError(
|
|
143
|
+
headers=dict(_response.headers),
|
|
144
|
+
body=typing.cast(
|
|
145
|
+
typing.Any,
|
|
146
|
+
construct_type(
|
|
147
|
+
type_=typing.Any, # type: ignore
|
|
148
|
+
object_=_response.json(),
|
|
149
|
+
),
|
|
150
|
+
),
|
|
151
|
+
)
|
|
152
|
+
if _response.status_code == 429:
|
|
153
|
+
raise TooManyRequestsError(
|
|
154
|
+
headers=dict(_response.headers),
|
|
155
|
+
body=typing.cast(
|
|
156
|
+
TooManyRequests,
|
|
157
|
+
construct_type(
|
|
158
|
+
type_=TooManyRequests, # type: ignore
|
|
159
|
+
object_=_response.json(),
|
|
160
|
+
),
|
|
161
|
+
),
|
|
162
|
+
)
|
|
163
|
+
_response_json = _response.json()
|
|
164
|
+
except JSONDecodeError:
|
|
165
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
166
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
167
|
+
|
|
168
|
+
def delete(
|
|
169
|
+
self, account_id: Uuid, folder_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
|
|
170
|
+
) -> HttpResponse[None]:
|
|
171
|
+
"""
|
|
172
|
+
Delete folder by id. <br>Rate Limits: 60 calls per 1.00 minute(s) per account_user
|
|
173
|
+
|
|
174
|
+
Parameters
|
|
175
|
+
----------
|
|
176
|
+
account_id : Uuid
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
folder_id : Uuid
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
request_options : typing.Optional[RequestOptions]
|
|
183
|
+
Request-specific configuration.
|
|
184
|
+
|
|
185
|
+
Returns
|
|
186
|
+
-------
|
|
187
|
+
HttpResponse[None]
|
|
188
|
+
"""
|
|
189
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
190
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}",
|
|
191
|
+
method="DELETE",
|
|
192
|
+
request_options=request_options,
|
|
193
|
+
)
|
|
194
|
+
try:
|
|
195
|
+
if 200 <= _response.status_code < 300:
|
|
196
|
+
return HttpResponse(response=_response, data=None)
|
|
197
|
+
if _response.status_code == 400:
|
|
198
|
+
raise BadRequestError(
|
|
199
|
+
headers=dict(_response.headers),
|
|
200
|
+
body=typing.cast(
|
|
201
|
+
BadRequest,
|
|
202
|
+
construct_type(
|
|
203
|
+
type_=BadRequest, # type: ignore
|
|
204
|
+
object_=_response.json(),
|
|
205
|
+
),
|
|
206
|
+
),
|
|
207
|
+
)
|
|
208
|
+
if _response.status_code == 401:
|
|
209
|
+
raise UnauthorizedError(
|
|
210
|
+
headers=dict(_response.headers),
|
|
211
|
+
body=typing.cast(
|
|
212
|
+
Unauthorized,
|
|
213
|
+
construct_type(
|
|
214
|
+
type_=Unauthorized, # type: ignore
|
|
215
|
+
object_=_response.json(),
|
|
216
|
+
),
|
|
217
|
+
),
|
|
218
|
+
)
|
|
219
|
+
if _response.status_code == 403:
|
|
220
|
+
raise ForbiddenError(
|
|
221
|
+
headers=dict(_response.headers),
|
|
222
|
+
body=typing.cast(
|
|
223
|
+
Forbidden,
|
|
224
|
+
construct_type(
|
|
225
|
+
type_=Forbidden, # type: ignore
|
|
226
|
+
object_=_response.json(),
|
|
227
|
+
),
|
|
228
|
+
),
|
|
229
|
+
)
|
|
230
|
+
if _response.status_code == 404:
|
|
231
|
+
raise NotFoundError(
|
|
232
|
+
headers=dict(_response.headers),
|
|
233
|
+
body=typing.cast(
|
|
234
|
+
NotFound,
|
|
235
|
+
construct_type(
|
|
236
|
+
type_=NotFound, # type: ignore
|
|
237
|
+
object_=_response.json(),
|
|
238
|
+
),
|
|
239
|
+
),
|
|
240
|
+
)
|
|
241
|
+
if _response.status_code == 422:
|
|
242
|
+
raise UnprocessableEntityError(
|
|
243
|
+
headers=dict(_response.headers),
|
|
244
|
+
body=typing.cast(
|
|
245
|
+
typing.Any,
|
|
246
|
+
construct_type(
|
|
247
|
+
type_=typing.Any, # type: ignore
|
|
248
|
+
object_=_response.json(),
|
|
249
|
+
),
|
|
250
|
+
),
|
|
251
|
+
)
|
|
252
|
+
if _response.status_code == 429:
|
|
253
|
+
raise TooManyRequestsError(
|
|
254
|
+
headers=dict(_response.headers),
|
|
255
|
+
body=typing.cast(
|
|
256
|
+
TooManyRequests,
|
|
257
|
+
construct_type(
|
|
258
|
+
type_=TooManyRequests, # type: ignore
|
|
259
|
+
object_=_response.json(),
|
|
260
|
+
),
|
|
261
|
+
),
|
|
262
|
+
)
|
|
263
|
+
_response_json = _response.json()
|
|
264
|
+
except JSONDecodeError:
|
|
265
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
266
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
267
|
+
|
|
268
|
+
def update(
|
|
269
|
+
self,
|
|
270
|
+
account_id: Uuid,
|
|
271
|
+
folder_id: Uuid,
|
|
272
|
+
*,
|
|
273
|
+
data: FolderUpdateParamsData,
|
|
274
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
275
|
+
) -> HttpResponse[FolderResponse]:
|
|
276
|
+
"""
|
|
277
|
+
Update folder details. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
278
|
+
|
|
279
|
+
Parameters
|
|
280
|
+
----------
|
|
281
|
+
account_id : Uuid
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
folder_id : Uuid
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
data : FolderUpdateParamsData
|
|
288
|
+
|
|
289
|
+
request_options : typing.Optional[RequestOptions]
|
|
290
|
+
Request-specific configuration.
|
|
291
|
+
|
|
292
|
+
Returns
|
|
293
|
+
-------
|
|
294
|
+
HttpResponse[FolderResponse]
|
|
295
|
+
OK
|
|
296
|
+
"""
|
|
297
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
298
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}",
|
|
299
|
+
method="PATCH",
|
|
300
|
+
json={
|
|
301
|
+
"data": convert_and_respect_annotation_metadata(
|
|
302
|
+
object_=data, annotation=FolderUpdateParamsData, direction="write"
|
|
303
|
+
),
|
|
304
|
+
},
|
|
305
|
+
headers={
|
|
306
|
+
"content-type": "application/json",
|
|
307
|
+
},
|
|
308
|
+
request_options=request_options,
|
|
309
|
+
omit=OMIT,
|
|
310
|
+
)
|
|
311
|
+
try:
|
|
312
|
+
if 200 <= _response.status_code < 300:
|
|
313
|
+
_data = typing.cast(
|
|
314
|
+
FolderResponse,
|
|
315
|
+
construct_type(
|
|
316
|
+
type_=FolderResponse, # type: ignore
|
|
317
|
+
object_=_response.json(),
|
|
318
|
+
),
|
|
319
|
+
)
|
|
320
|
+
return HttpResponse(response=_response, data=_data)
|
|
321
|
+
if _response.status_code == 400:
|
|
322
|
+
raise BadRequestError(
|
|
323
|
+
headers=dict(_response.headers),
|
|
324
|
+
body=typing.cast(
|
|
325
|
+
BadRequest,
|
|
326
|
+
construct_type(
|
|
327
|
+
type_=BadRequest, # type: ignore
|
|
328
|
+
object_=_response.json(),
|
|
329
|
+
),
|
|
330
|
+
),
|
|
331
|
+
)
|
|
332
|
+
if _response.status_code == 401:
|
|
333
|
+
raise UnauthorizedError(
|
|
334
|
+
headers=dict(_response.headers),
|
|
335
|
+
body=typing.cast(
|
|
336
|
+
Unauthorized,
|
|
337
|
+
construct_type(
|
|
338
|
+
type_=Unauthorized, # type: ignore
|
|
339
|
+
object_=_response.json(),
|
|
340
|
+
),
|
|
341
|
+
),
|
|
342
|
+
)
|
|
343
|
+
if _response.status_code == 403:
|
|
344
|
+
raise ForbiddenError(
|
|
345
|
+
headers=dict(_response.headers),
|
|
346
|
+
body=typing.cast(
|
|
347
|
+
Forbidden,
|
|
348
|
+
construct_type(
|
|
349
|
+
type_=Forbidden, # type: ignore
|
|
350
|
+
object_=_response.json(),
|
|
351
|
+
),
|
|
352
|
+
),
|
|
353
|
+
)
|
|
354
|
+
if _response.status_code == 404:
|
|
355
|
+
raise NotFoundError(
|
|
356
|
+
headers=dict(_response.headers),
|
|
357
|
+
body=typing.cast(
|
|
358
|
+
NotFound,
|
|
359
|
+
construct_type(
|
|
360
|
+
type_=NotFound, # type: ignore
|
|
361
|
+
object_=_response.json(),
|
|
362
|
+
),
|
|
363
|
+
),
|
|
364
|
+
)
|
|
365
|
+
if _response.status_code == 422:
|
|
366
|
+
raise UnprocessableEntityError(
|
|
367
|
+
headers=dict(_response.headers),
|
|
368
|
+
body=typing.cast(
|
|
369
|
+
typing.Any,
|
|
370
|
+
construct_type(
|
|
371
|
+
type_=typing.Any, # type: ignore
|
|
372
|
+
object_=_response.json(),
|
|
373
|
+
),
|
|
374
|
+
),
|
|
375
|
+
)
|
|
376
|
+
if _response.status_code == 429:
|
|
377
|
+
raise TooManyRequestsError(
|
|
378
|
+
headers=dict(_response.headers),
|
|
379
|
+
body=typing.cast(
|
|
380
|
+
TooManyRequests,
|
|
381
|
+
construct_type(
|
|
382
|
+
type_=TooManyRequests, # type: ignore
|
|
383
|
+
object_=_response.json(),
|
|
384
|
+
),
|
|
385
|
+
),
|
|
386
|
+
)
|
|
387
|
+
_response_json = _response.json()
|
|
388
|
+
except JSONDecodeError:
|
|
389
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
390
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
391
|
+
|
|
392
|
+
def index(
|
|
393
|
+
self,
|
|
394
|
+
account_id: Uuid,
|
|
395
|
+
folder_id: Uuid,
|
|
396
|
+
*,
|
|
397
|
+
include: typing.Optional[FileWithMediaLinksInclude] = None,
|
|
398
|
+
type: typing.Optional[ChildrenType] = None,
|
|
399
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
400
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
401
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
402
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
403
|
+
) -> HttpResponse[AssetsWithIncludesResponse]:
|
|
404
|
+
"""
|
|
405
|
+
List the children in the given folder.
|
|
406
|
+
<br>
|
|
407
|
+
Use the `include` query parameter to selectively include additional properties in the response.
|
|
408
|
+
<br>
|
|
409
|
+
Note: if you include `media_links.original` and the user does not have permission to download files
|
|
410
|
+
in the corresponding project, then this endpoint will respond with a `403 Forbidden` error.
|
|
411
|
+
If the content is inaccessible because watermarking is required for this user and isn't supported by
|
|
412
|
+
the requested media_links, then the request will succeed but the unsupported media links will be set to null.
|
|
413
|
+
Similarly, if a requested transcode link does not exist for a particular file (e.g. including
|
|
414
|
+
`media_links.video_h264_180` on a static image file) or transoding process hasn't finished
|
|
415
|
+
(i.e. the file's `status` is "uploaded" rather than "transcoded"), then the a media link will also be set to
|
|
416
|
+
null in the response payload. In short, the client must handle null media links gracefully.
|
|
417
|
+
<br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
418
|
+
|
|
419
|
+
Parameters
|
|
420
|
+
----------
|
|
421
|
+
account_id : Uuid
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
folder_id : Uuid
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
include : typing.Optional[FileWithMediaLinksInclude]
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
type : typing.Optional[ChildrenType]
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
434
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
435
|
+
<br/>
|
|
436
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
437
|
+
|
|
438
|
+
page_size : typing.Optional[RequestPageSize]
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
request_options : typing.Optional[RequestOptions]
|
|
445
|
+
Request-specific configuration.
|
|
446
|
+
|
|
447
|
+
Returns
|
|
448
|
+
-------
|
|
449
|
+
HttpResponse[AssetsWithIncludesResponse]
|
|
450
|
+
OK
|
|
451
|
+
"""
|
|
452
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
453
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/children",
|
|
454
|
+
method="GET",
|
|
455
|
+
params={
|
|
456
|
+
"include": include,
|
|
457
|
+
"type": type,
|
|
458
|
+
"after": after,
|
|
459
|
+
"page_size": page_size,
|
|
460
|
+
"include_total_count": include_total_count,
|
|
461
|
+
},
|
|
462
|
+
request_options=request_options,
|
|
463
|
+
)
|
|
464
|
+
try:
|
|
465
|
+
if 200 <= _response.status_code < 300:
|
|
466
|
+
_data = typing.cast(
|
|
467
|
+
AssetsWithIncludesResponse,
|
|
468
|
+
construct_type(
|
|
469
|
+
type_=AssetsWithIncludesResponse, # type: ignore
|
|
470
|
+
object_=_response.json(),
|
|
471
|
+
),
|
|
472
|
+
)
|
|
473
|
+
return HttpResponse(response=_response, data=_data)
|
|
474
|
+
if _response.status_code == 400:
|
|
475
|
+
raise BadRequestError(
|
|
476
|
+
headers=dict(_response.headers),
|
|
477
|
+
body=typing.cast(
|
|
478
|
+
BadRequest,
|
|
479
|
+
construct_type(
|
|
480
|
+
type_=BadRequest, # type: ignore
|
|
481
|
+
object_=_response.json(),
|
|
482
|
+
),
|
|
483
|
+
),
|
|
484
|
+
)
|
|
485
|
+
if _response.status_code == 401:
|
|
486
|
+
raise UnauthorizedError(
|
|
487
|
+
headers=dict(_response.headers),
|
|
488
|
+
body=typing.cast(
|
|
489
|
+
Unauthorized,
|
|
490
|
+
construct_type(
|
|
491
|
+
type_=Unauthorized, # type: ignore
|
|
492
|
+
object_=_response.json(),
|
|
493
|
+
),
|
|
494
|
+
),
|
|
495
|
+
)
|
|
496
|
+
if _response.status_code == 403:
|
|
497
|
+
raise ForbiddenError(
|
|
498
|
+
headers=dict(_response.headers),
|
|
499
|
+
body=typing.cast(
|
|
500
|
+
Forbidden,
|
|
501
|
+
construct_type(
|
|
502
|
+
type_=Forbidden, # type: ignore
|
|
503
|
+
object_=_response.json(),
|
|
504
|
+
),
|
|
505
|
+
),
|
|
506
|
+
)
|
|
507
|
+
if _response.status_code == 404:
|
|
508
|
+
raise NotFoundError(
|
|
509
|
+
headers=dict(_response.headers),
|
|
510
|
+
body=typing.cast(
|
|
511
|
+
NotFound,
|
|
512
|
+
construct_type(
|
|
513
|
+
type_=NotFound, # type: ignore
|
|
514
|
+
object_=_response.json(),
|
|
515
|
+
),
|
|
516
|
+
),
|
|
517
|
+
)
|
|
518
|
+
if _response.status_code == 422:
|
|
519
|
+
raise UnprocessableEntityError(
|
|
520
|
+
headers=dict(_response.headers),
|
|
521
|
+
body=typing.cast(
|
|
522
|
+
typing.Any,
|
|
523
|
+
construct_type(
|
|
524
|
+
type_=typing.Any, # type: ignore
|
|
525
|
+
object_=_response.json(),
|
|
526
|
+
),
|
|
527
|
+
),
|
|
528
|
+
)
|
|
529
|
+
if _response.status_code == 429:
|
|
530
|
+
raise TooManyRequestsError(
|
|
531
|
+
headers=dict(_response.headers),
|
|
532
|
+
body=typing.cast(
|
|
533
|
+
TooManyRequests,
|
|
534
|
+
construct_type(
|
|
535
|
+
type_=TooManyRequests, # type: ignore
|
|
536
|
+
object_=_response.json(),
|
|
537
|
+
),
|
|
538
|
+
),
|
|
539
|
+
)
|
|
540
|
+
_response_json = _response.json()
|
|
541
|
+
except JSONDecodeError:
|
|
542
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
543
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
544
|
+
|
|
545
|
+
def copy(
|
|
546
|
+
self,
|
|
547
|
+
account_id: Uuid,
|
|
548
|
+
folder_id: Uuid,
|
|
549
|
+
*,
|
|
550
|
+
copy_metadata: typing.Optional[bool] = None,
|
|
551
|
+
data: typing.Optional[FolderCopyParamsData] = OMIT,
|
|
552
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
553
|
+
) -> HttpResponse[FolderCopyResponse]:
|
|
554
|
+
"""
|
|
555
|
+
Copy folder. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
556
|
+
|
|
557
|
+
Parameters
|
|
558
|
+
----------
|
|
559
|
+
account_id : Uuid
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
folder_id : Uuid
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
copy_metadata : typing.Optional[bool]
|
|
566
|
+
Whether to copy metadata values along with the folder
|
|
567
|
+
|
|
568
|
+
data : typing.Optional[FolderCopyParamsData]
|
|
569
|
+
|
|
570
|
+
request_options : typing.Optional[RequestOptions]
|
|
571
|
+
Request-specific configuration.
|
|
572
|
+
|
|
573
|
+
Returns
|
|
574
|
+
-------
|
|
575
|
+
HttpResponse[FolderCopyResponse]
|
|
576
|
+
OK
|
|
577
|
+
"""
|
|
578
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
579
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/copy",
|
|
580
|
+
method="POST",
|
|
581
|
+
params={
|
|
582
|
+
"copy_metadata": copy_metadata,
|
|
583
|
+
},
|
|
584
|
+
json={
|
|
585
|
+
"data": convert_and_respect_annotation_metadata(
|
|
586
|
+
object_=data, annotation=FolderCopyParamsData, direction="write"
|
|
587
|
+
),
|
|
588
|
+
},
|
|
589
|
+
headers={
|
|
590
|
+
"content-type": "application/json",
|
|
591
|
+
},
|
|
592
|
+
request_options=request_options,
|
|
593
|
+
omit=OMIT,
|
|
594
|
+
)
|
|
595
|
+
try:
|
|
596
|
+
if 200 <= _response.status_code < 300:
|
|
597
|
+
_data = typing.cast(
|
|
598
|
+
FolderCopyResponse,
|
|
599
|
+
construct_type(
|
|
600
|
+
type_=FolderCopyResponse, # type: ignore
|
|
601
|
+
object_=_response.json(),
|
|
602
|
+
),
|
|
603
|
+
)
|
|
604
|
+
return HttpResponse(response=_response, data=_data)
|
|
605
|
+
if _response.status_code == 400:
|
|
606
|
+
raise BadRequestError(
|
|
607
|
+
headers=dict(_response.headers),
|
|
608
|
+
body=typing.cast(
|
|
609
|
+
BadRequest,
|
|
610
|
+
construct_type(
|
|
611
|
+
type_=BadRequest, # type: ignore
|
|
612
|
+
object_=_response.json(),
|
|
613
|
+
),
|
|
614
|
+
),
|
|
615
|
+
)
|
|
616
|
+
if _response.status_code == 401:
|
|
617
|
+
raise UnauthorizedError(
|
|
618
|
+
headers=dict(_response.headers),
|
|
619
|
+
body=typing.cast(
|
|
620
|
+
Unauthorized,
|
|
621
|
+
construct_type(
|
|
622
|
+
type_=Unauthorized, # type: ignore
|
|
623
|
+
object_=_response.json(),
|
|
624
|
+
),
|
|
625
|
+
),
|
|
626
|
+
)
|
|
627
|
+
if _response.status_code == 403:
|
|
628
|
+
raise ForbiddenError(
|
|
629
|
+
headers=dict(_response.headers),
|
|
630
|
+
body=typing.cast(
|
|
631
|
+
Forbidden,
|
|
632
|
+
construct_type(
|
|
633
|
+
type_=Forbidden, # type: ignore
|
|
634
|
+
object_=_response.json(),
|
|
635
|
+
),
|
|
636
|
+
),
|
|
637
|
+
)
|
|
638
|
+
if _response.status_code == 404:
|
|
639
|
+
raise NotFoundError(
|
|
640
|
+
headers=dict(_response.headers),
|
|
641
|
+
body=typing.cast(
|
|
642
|
+
NotFound,
|
|
643
|
+
construct_type(
|
|
644
|
+
type_=NotFound, # type: ignore
|
|
645
|
+
object_=_response.json(),
|
|
646
|
+
),
|
|
647
|
+
),
|
|
648
|
+
)
|
|
649
|
+
if _response.status_code == 422:
|
|
650
|
+
raise UnprocessableEntityError(
|
|
651
|
+
headers=dict(_response.headers),
|
|
652
|
+
body=typing.cast(
|
|
653
|
+
typing.Any,
|
|
654
|
+
construct_type(
|
|
655
|
+
type_=typing.Any, # type: ignore
|
|
656
|
+
object_=_response.json(),
|
|
657
|
+
),
|
|
658
|
+
),
|
|
659
|
+
)
|
|
660
|
+
if _response.status_code == 429:
|
|
661
|
+
raise TooManyRequestsError(
|
|
662
|
+
headers=dict(_response.headers),
|
|
663
|
+
body=typing.cast(
|
|
664
|
+
TooManyRequests,
|
|
665
|
+
construct_type(
|
|
666
|
+
type_=TooManyRequests, # type: ignore
|
|
667
|
+
object_=_response.json(),
|
|
668
|
+
),
|
|
669
|
+
),
|
|
670
|
+
)
|
|
671
|
+
_response_json = _response.json()
|
|
672
|
+
except JSONDecodeError:
|
|
673
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
674
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
675
|
+
|
|
676
|
+
def list(
|
|
677
|
+
self,
|
|
678
|
+
account_id: Uuid,
|
|
679
|
+
folder_id: Uuid,
|
|
680
|
+
*,
|
|
681
|
+
include: typing.Optional[AssetInclude] = None,
|
|
682
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
683
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
684
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
685
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
686
|
+
) -> HttpResponse[FoldersWithIncludesResponse]:
|
|
687
|
+
"""
|
|
688
|
+
List folders in a given folder. <br>Rate Limits: 5 calls per 1 second(s) per account_user
|
|
689
|
+
|
|
690
|
+
Parameters
|
|
691
|
+
----------
|
|
692
|
+
account_id : Uuid
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
folder_id : Uuid
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
include : typing.Optional[AssetInclude]
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
702
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
703
|
+
<br/>
|
|
704
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
705
|
+
|
|
706
|
+
page_size : typing.Optional[RequestPageSize]
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
request_options : typing.Optional[RequestOptions]
|
|
713
|
+
Request-specific configuration.
|
|
714
|
+
|
|
715
|
+
Returns
|
|
716
|
+
-------
|
|
717
|
+
HttpResponse[FoldersWithIncludesResponse]
|
|
718
|
+
OK
|
|
719
|
+
"""
|
|
720
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
721
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/folders",
|
|
722
|
+
method="GET",
|
|
723
|
+
params={
|
|
724
|
+
"include": include,
|
|
725
|
+
"after": after,
|
|
726
|
+
"page_size": page_size,
|
|
727
|
+
"include_total_count": include_total_count,
|
|
728
|
+
},
|
|
729
|
+
request_options=request_options,
|
|
730
|
+
)
|
|
731
|
+
try:
|
|
732
|
+
if 200 <= _response.status_code < 300:
|
|
733
|
+
_data = typing.cast(
|
|
734
|
+
FoldersWithIncludesResponse,
|
|
735
|
+
construct_type(
|
|
736
|
+
type_=FoldersWithIncludesResponse, # type: ignore
|
|
737
|
+
object_=_response.json(),
|
|
738
|
+
),
|
|
739
|
+
)
|
|
740
|
+
return HttpResponse(response=_response, data=_data)
|
|
741
|
+
if _response.status_code == 400:
|
|
742
|
+
raise BadRequestError(
|
|
743
|
+
headers=dict(_response.headers),
|
|
744
|
+
body=typing.cast(
|
|
745
|
+
BadRequest,
|
|
746
|
+
construct_type(
|
|
747
|
+
type_=BadRequest, # type: ignore
|
|
748
|
+
object_=_response.json(),
|
|
749
|
+
),
|
|
750
|
+
),
|
|
751
|
+
)
|
|
752
|
+
if _response.status_code == 401:
|
|
753
|
+
raise UnauthorizedError(
|
|
754
|
+
headers=dict(_response.headers),
|
|
755
|
+
body=typing.cast(
|
|
756
|
+
Unauthorized,
|
|
757
|
+
construct_type(
|
|
758
|
+
type_=Unauthorized, # type: ignore
|
|
759
|
+
object_=_response.json(),
|
|
760
|
+
),
|
|
761
|
+
),
|
|
762
|
+
)
|
|
763
|
+
if _response.status_code == 403:
|
|
764
|
+
raise ForbiddenError(
|
|
765
|
+
headers=dict(_response.headers),
|
|
766
|
+
body=typing.cast(
|
|
767
|
+
Forbidden,
|
|
768
|
+
construct_type(
|
|
769
|
+
type_=Forbidden, # type: ignore
|
|
770
|
+
object_=_response.json(),
|
|
771
|
+
),
|
|
772
|
+
),
|
|
773
|
+
)
|
|
774
|
+
if _response.status_code == 404:
|
|
775
|
+
raise NotFoundError(
|
|
776
|
+
headers=dict(_response.headers),
|
|
777
|
+
body=typing.cast(
|
|
778
|
+
NotFound,
|
|
779
|
+
construct_type(
|
|
780
|
+
type_=NotFound, # type: ignore
|
|
781
|
+
object_=_response.json(),
|
|
782
|
+
),
|
|
783
|
+
),
|
|
784
|
+
)
|
|
785
|
+
if _response.status_code == 422:
|
|
786
|
+
raise UnprocessableEntityError(
|
|
787
|
+
headers=dict(_response.headers),
|
|
788
|
+
body=typing.cast(
|
|
789
|
+
typing.Any,
|
|
790
|
+
construct_type(
|
|
791
|
+
type_=typing.Any, # type: ignore
|
|
792
|
+
object_=_response.json(),
|
|
793
|
+
),
|
|
794
|
+
),
|
|
795
|
+
)
|
|
796
|
+
if _response.status_code == 429:
|
|
797
|
+
raise TooManyRequestsError(
|
|
798
|
+
headers=dict(_response.headers),
|
|
799
|
+
body=typing.cast(
|
|
800
|
+
TooManyRequests,
|
|
801
|
+
construct_type(
|
|
802
|
+
type_=TooManyRequests, # type: ignore
|
|
803
|
+
object_=_response.json(),
|
|
804
|
+
),
|
|
805
|
+
),
|
|
806
|
+
)
|
|
807
|
+
_response_json = _response.json()
|
|
808
|
+
except JSONDecodeError:
|
|
809
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
810
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
811
|
+
|
|
812
|
+
def create(
|
|
813
|
+
self,
|
|
814
|
+
account_id: Uuid,
|
|
815
|
+
folder_id: Uuid,
|
|
816
|
+
*,
|
|
817
|
+
data: FolderCreateParamsData,
|
|
818
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
819
|
+
) -> HttpResponse[FolderResponse]:
|
|
820
|
+
"""
|
|
821
|
+
Create a new folder inside the given <i>folder_id</i> path param. <br>Rate Limits: 3 calls per 1 second(s) per account_user
|
|
822
|
+
|
|
823
|
+
Parameters
|
|
824
|
+
----------
|
|
825
|
+
account_id : Uuid
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
folder_id : Uuid
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
data : FolderCreateParamsData
|
|
832
|
+
|
|
833
|
+
request_options : typing.Optional[RequestOptions]
|
|
834
|
+
Request-specific configuration.
|
|
835
|
+
|
|
836
|
+
Returns
|
|
837
|
+
-------
|
|
838
|
+
HttpResponse[FolderResponse]
|
|
839
|
+
Created
|
|
840
|
+
"""
|
|
841
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
842
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/folders",
|
|
843
|
+
method="POST",
|
|
844
|
+
json={
|
|
845
|
+
"data": convert_and_respect_annotation_metadata(
|
|
846
|
+
object_=data, annotation=FolderCreateParamsData, direction="write"
|
|
847
|
+
),
|
|
848
|
+
},
|
|
849
|
+
headers={
|
|
850
|
+
"content-type": "application/json",
|
|
851
|
+
},
|
|
852
|
+
request_options=request_options,
|
|
853
|
+
omit=OMIT,
|
|
854
|
+
)
|
|
855
|
+
try:
|
|
856
|
+
if 200 <= _response.status_code < 300:
|
|
857
|
+
_data = typing.cast(
|
|
858
|
+
FolderResponse,
|
|
859
|
+
construct_type(
|
|
860
|
+
type_=FolderResponse, # type: ignore
|
|
861
|
+
object_=_response.json(),
|
|
862
|
+
),
|
|
863
|
+
)
|
|
864
|
+
return HttpResponse(response=_response, data=_data)
|
|
865
|
+
if _response.status_code == 400:
|
|
866
|
+
raise BadRequestError(
|
|
867
|
+
headers=dict(_response.headers),
|
|
868
|
+
body=typing.cast(
|
|
869
|
+
BadRequest,
|
|
870
|
+
construct_type(
|
|
871
|
+
type_=BadRequest, # type: ignore
|
|
872
|
+
object_=_response.json(),
|
|
873
|
+
),
|
|
874
|
+
),
|
|
875
|
+
)
|
|
876
|
+
if _response.status_code == 401:
|
|
877
|
+
raise UnauthorizedError(
|
|
878
|
+
headers=dict(_response.headers),
|
|
879
|
+
body=typing.cast(
|
|
880
|
+
Unauthorized,
|
|
881
|
+
construct_type(
|
|
882
|
+
type_=Unauthorized, # type: ignore
|
|
883
|
+
object_=_response.json(),
|
|
884
|
+
),
|
|
885
|
+
),
|
|
886
|
+
)
|
|
887
|
+
if _response.status_code == 403:
|
|
888
|
+
raise ForbiddenError(
|
|
889
|
+
headers=dict(_response.headers),
|
|
890
|
+
body=typing.cast(
|
|
891
|
+
Forbidden,
|
|
892
|
+
construct_type(
|
|
893
|
+
type_=Forbidden, # type: ignore
|
|
894
|
+
object_=_response.json(),
|
|
895
|
+
),
|
|
896
|
+
),
|
|
897
|
+
)
|
|
898
|
+
if _response.status_code == 404:
|
|
899
|
+
raise NotFoundError(
|
|
900
|
+
headers=dict(_response.headers),
|
|
901
|
+
body=typing.cast(
|
|
902
|
+
NotFound,
|
|
903
|
+
construct_type(
|
|
904
|
+
type_=NotFound, # type: ignore
|
|
905
|
+
object_=_response.json(),
|
|
906
|
+
),
|
|
907
|
+
),
|
|
908
|
+
)
|
|
909
|
+
if _response.status_code == 422:
|
|
910
|
+
raise UnprocessableEntityError(
|
|
911
|
+
headers=dict(_response.headers),
|
|
912
|
+
body=typing.cast(
|
|
913
|
+
typing.Any,
|
|
914
|
+
construct_type(
|
|
915
|
+
type_=typing.Any, # type: ignore
|
|
916
|
+
object_=_response.json(),
|
|
917
|
+
),
|
|
918
|
+
),
|
|
919
|
+
)
|
|
920
|
+
if _response.status_code == 429:
|
|
921
|
+
raise TooManyRequestsError(
|
|
922
|
+
headers=dict(_response.headers),
|
|
923
|
+
body=typing.cast(
|
|
924
|
+
TooManyRequests,
|
|
925
|
+
construct_type(
|
|
926
|
+
type_=TooManyRequests, # type: ignore
|
|
927
|
+
object_=_response.json(),
|
|
928
|
+
),
|
|
929
|
+
),
|
|
930
|
+
)
|
|
931
|
+
_response_json = _response.json()
|
|
932
|
+
except JSONDecodeError:
|
|
933
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
934
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
935
|
+
|
|
936
|
+
def move(
|
|
937
|
+
self,
|
|
938
|
+
account_id: Uuid,
|
|
939
|
+
folder_id: Uuid,
|
|
940
|
+
*,
|
|
941
|
+
data: FolderMoveParamsData,
|
|
942
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
943
|
+
) -> HttpResponse[FolderResponse]:
|
|
944
|
+
"""
|
|
945
|
+
Move folder to a folder. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
946
|
+
|
|
947
|
+
Parameters
|
|
948
|
+
----------
|
|
949
|
+
account_id : Uuid
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
folder_id : Uuid
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
data : FolderMoveParamsData
|
|
956
|
+
|
|
957
|
+
request_options : typing.Optional[RequestOptions]
|
|
958
|
+
Request-specific configuration.
|
|
959
|
+
|
|
960
|
+
Returns
|
|
961
|
+
-------
|
|
962
|
+
HttpResponse[FolderResponse]
|
|
963
|
+
OK
|
|
964
|
+
"""
|
|
965
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
966
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/move",
|
|
967
|
+
method="PATCH",
|
|
968
|
+
json={
|
|
969
|
+
"data": convert_and_respect_annotation_metadata(
|
|
970
|
+
object_=data, annotation=FolderMoveParamsData, direction="write"
|
|
971
|
+
),
|
|
972
|
+
},
|
|
973
|
+
headers={
|
|
974
|
+
"content-type": "application/json",
|
|
975
|
+
},
|
|
976
|
+
request_options=request_options,
|
|
977
|
+
omit=OMIT,
|
|
978
|
+
)
|
|
979
|
+
try:
|
|
980
|
+
if 200 <= _response.status_code < 300:
|
|
981
|
+
_data = typing.cast(
|
|
982
|
+
FolderResponse,
|
|
983
|
+
construct_type(
|
|
984
|
+
type_=FolderResponse, # type: ignore
|
|
985
|
+
object_=_response.json(),
|
|
986
|
+
),
|
|
987
|
+
)
|
|
988
|
+
return HttpResponse(response=_response, data=_data)
|
|
989
|
+
if _response.status_code == 400:
|
|
990
|
+
raise BadRequestError(
|
|
991
|
+
headers=dict(_response.headers),
|
|
992
|
+
body=typing.cast(
|
|
993
|
+
BadRequest,
|
|
994
|
+
construct_type(
|
|
995
|
+
type_=BadRequest, # type: ignore
|
|
996
|
+
object_=_response.json(),
|
|
997
|
+
),
|
|
998
|
+
),
|
|
999
|
+
)
|
|
1000
|
+
if _response.status_code == 401:
|
|
1001
|
+
raise UnauthorizedError(
|
|
1002
|
+
headers=dict(_response.headers),
|
|
1003
|
+
body=typing.cast(
|
|
1004
|
+
Unauthorized,
|
|
1005
|
+
construct_type(
|
|
1006
|
+
type_=Unauthorized, # type: ignore
|
|
1007
|
+
object_=_response.json(),
|
|
1008
|
+
),
|
|
1009
|
+
),
|
|
1010
|
+
)
|
|
1011
|
+
if _response.status_code == 403:
|
|
1012
|
+
raise ForbiddenError(
|
|
1013
|
+
headers=dict(_response.headers),
|
|
1014
|
+
body=typing.cast(
|
|
1015
|
+
Forbidden,
|
|
1016
|
+
construct_type(
|
|
1017
|
+
type_=Forbidden, # type: ignore
|
|
1018
|
+
object_=_response.json(),
|
|
1019
|
+
),
|
|
1020
|
+
),
|
|
1021
|
+
)
|
|
1022
|
+
if _response.status_code == 404:
|
|
1023
|
+
raise NotFoundError(
|
|
1024
|
+
headers=dict(_response.headers),
|
|
1025
|
+
body=typing.cast(
|
|
1026
|
+
NotFound,
|
|
1027
|
+
construct_type(
|
|
1028
|
+
type_=NotFound, # type: ignore
|
|
1029
|
+
object_=_response.json(),
|
|
1030
|
+
),
|
|
1031
|
+
),
|
|
1032
|
+
)
|
|
1033
|
+
if _response.status_code == 422:
|
|
1034
|
+
raise UnprocessableEntityError(
|
|
1035
|
+
headers=dict(_response.headers),
|
|
1036
|
+
body=typing.cast(
|
|
1037
|
+
typing.Any,
|
|
1038
|
+
construct_type(
|
|
1039
|
+
type_=typing.Any, # type: ignore
|
|
1040
|
+
object_=_response.json(),
|
|
1041
|
+
),
|
|
1042
|
+
),
|
|
1043
|
+
)
|
|
1044
|
+
if _response.status_code == 429:
|
|
1045
|
+
raise TooManyRequestsError(
|
|
1046
|
+
headers=dict(_response.headers),
|
|
1047
|
+
body=typing.cast(
|
|
1048
|
+
TooManyRequests,
|
|
1049
|
+
construct_type(
|
|
1050
|
+
type_=TooManyRequests, # type: ignore
|
|
1051
|
+
object_=_response.json(),
|
|
1052
|
+
),
|
|
1053
|
+
),
|
|
1054
|
+
)
|
|
1055
|
+
_response_json = _response.json()
|
|
1056
|
+
except JSONDecodeError:
|
|
1057
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1058
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
class AsyncRawFoldersClient:
|
|
1062
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
1063
|
+
self._client_wrapper = client_wrapper
|
|
1064
|
+
|
|
1065
|
+
async def show(
|
|
1066
|
+
self,
|
|
1067
|
+
account_id: Uuid,
|
|
1068
|
+
folder_id: Uuid,
|
|
1069
|
+
*,
|
|
1070
|
+
include: typing.Optional[AssetInclude] = None,
|
|
1071
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1072
|
+
) -> AsyncHttpResponse[FolderWithIncludesResponse]:
|
|
1073
|
+
"""
|
|
1074
|
+
Show folder details. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
1075
|
+
|
|
1076
|
+
Parameters
|
|
1077
|
+
----------
|
|
1078
|
+
account_id : Uuid
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
folder_id : Uuid
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
include : typing.Optional[AssetInclude]
|
|
1085
|
+
|
|
1086
|
+
|
|
1087
|
+
request_options : typing.Optional[RequestOptions]
|
|
1088
|
+
Request-specific configuration.
|
|
1089
|
+
|
|
1090
|
+
Returns
|
|
1091
|
+
-------
|
|
1092
|
+
AsyncHttpResponse[FolderWithIncludesResponse]
|
|
1093
|
+
OK
|
|
1094
|
+
"""
|
|
1095
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1096
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}",
|
|
1097
|
+
method="GET",
|
|
1098
|
+
params={
|
|
1099
|
+
"include": include,
|
|
1100
|
+
},
|
|
1101
|
+
request_options=request_options,
|
|
1102
|
+
)
|
|
1103
|
+
try:
|
|
1104
|
+
if 200 <= _response.status_code < 300:
|
|
1105
|
+
_data = typing.cast(
|
|
1106
|
+
FolderWithIncludesResponse,
|
|
1107
|
+
construct_type(
|
|
1108
|
+
type_=FolderWithIncludesResponse, # type: ignore
|
|
1109
|
+
object_=_response.json(),
|
|
1110
|
+
),
|
|
1111
|
+
)
|
|
1112
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1113
|
+
if _response.status_code == 400:
|
|
1114
|
+
raise BadRequestError(
|
|
1115
|
+
headers=dict(_response.headers),
|
|
1116
|
+
body=typing.cast(
|
|
1117
|
+
BadRequest,
|
|
1118
|
+
construct_type(
|
|
1119
|
+
type_=BadRequest, # type: ignore
|
|
1120
|
+
object_=_response.json(),
|
|
1121
|
+
),
|
|
1122
|
+
),
|
|
1123
|
+
)
|
|
1124
|
+
if _response.status_code == 401:
|
|
1125
|
+
raise UnauthorizedError(
|
|
1126
|
+
headers=dict(_response.headers),
|
|
1127
|
+
body=typing.cast(
|
|
1128
|
+
Unauthorized,
|
|
1129
|
+
construct_type(
|
|
1130
|
+
type_=Unauthorized, # type: ignore
|
|
1131
|
+
object_=_response.json(),
|
|
1132
|
+
),
|
|
1133
|
+
),
|
|
1134
|
+
)
|
|
1135
|
+
if _response.status_code == 403:
|
|
1136
|
+
raise ForbiddenError(
|
|
1137
|
+
headers=dict(_response.headers),
|
|
1138
|
+
body=typing.cast(
|
|
1139
|
+
Forbidden,
|
|
1140
|
+
construct_type(
|
|
1141
|
+
type_=Forbidden, # type: ignore
|
|
1142
|
+
object_=_response.json(),
|
|
1143
|
+
),
|
|
1144
|
+
),
|
|
1145
|
+
)
|
|
1146
|
+
if _response.status_code == 404:
|
|
1147
|
+
raise NotFoundError(
|
|
1148
|
+
headers=dict(_response.headers),
|
|
1149
|
+
body=typing.cast(
|
|
1150
|
+
NotFound,
|
|
1151
|
+
construct_type(
|
|
1152
|
+
type_=NotFound, # type: ignore
|
|
1153
|
+
object_=_response.json(),
|
|
1154
|
+
),
|
|
1155
|
+
),
|
|
1156
|
+
)
|
|
1157
|
+
if _response.status_code == 422:
|
|
1158
|
+
raise UnprocessableEntityError(
|
|
1159
|
+
headers=dict(_response.headers),
|
|
1160
|
+
body=typing.cast(
|
|
1161
|
+
typing.Any,
|
|
1162
|
+
construct_type(
|
|
1163
|
+
type_=typing.Any, # type: ignore
|
|
1164
|
+
object_=_response.json(),
|
|
1165
|
+
),
|
|
1166
|
+
),
|
|
1167
|
+
)
|
|
1168
|
+
if _response.status_code == 429:
|
|
1169
|
+
raise TooManyRequestsError(
|
|
1170
|
+
headers=dict(_response.headers),
|
|
1171
|
+
body=typing.cast(
|
|
1172
|
+
TooManyRequests,
|
|
1173
|
+
construct_type(
|
|
1174
|
+
type_=TooManyRequests, # type: ignore
|
|
1175
|
+
object_=_response.json(),
|
|
1176
|
+
),
|
|
1177
|
+
),
|
|
1178
|
+
)
|
|
1179
|
+
_response_json = _response.json()
|
|
1180
|
+
except JSONDecodeError:
|
|
1181
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1182
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1183
|
+
|
|
1184
|
+
async def delete(
|
|
1185
|
+
self, account_id: Uuid, folder_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
|
|
1186
|
+
) -> AsyncHttpResponse[None]:
|
|
1187
|
+
"""
|
|
1188
|
+
Delete folder by id. <br>Rate Limits: 60 calls per 1.00 minute(s) per account_user
|
|
1189
|
+
|
|
1190
|
+
Parameters
|
|
1191
|
+
----------
|
|
1192
|
+
account_id : Uuid
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
folder_id : Uuid
|
|
1196
|
+
|
|
1197
|
+
|
|
1198
|
+
request_options : typing.Optional[RequestOptions]
|
|
1199
|
+
Request-specific configuration.
|
|
1200
|
+
|
|
1201
|
+
Returns
|
|
1202
|
+
-------
|
|
1203
|
+
AsyncHttpResponse[None]
|
|
1204
|
+
"""
|
|
1205
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1206
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}",
|
|
1207
|
+
method="DELETE",
|
|
1208
|
+
request_options=request_options,
|
|
1209
|
+
)
|
|
1210
|
+
try:
|
|
1211
|
+
if 200 <= _response.status_code < 300:
|
|
1212
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
1213
|
+
if _response.status_code == 400:
|
|
1214
|
+
raise BadRequestError(
|
|
1215
|
+
headers=dict(_response.headers),
|
|
1216
|
+
body=typing.cast(
|
|
1217
|
+
BadRequest,
|
|
1218
|
+
construct_type(
|
|
1219
|
+
type_=BadRequest, # type: ignore
|
|
1220
|
+
object_=_response.json(),
|
|
1221
|
+
),
|
|
1222
|
+
),
|
|
1223
|
+
)
|
|
1224
|
+
if _response.status_code == 401:
|
|
1225
|
+
raise UnauthorizedError(
|
|
1226
|
+
headers=dict(_response.headers),
|
|
1227
|
+
body=typing.cast(
|
|
1228
|
+
Unauthorized,
|
|
1229
|
+
construct_type(
|
|
1230
|
+
type_=Unauthorized, # type: ignore
|
|
1231
|
+
object_=_response.json(),
|
|
1232
|
+
),
|
|
1233
|
+
),
|
|
1234
|
+
)
|
|
1235
|
+
if _response.status_code == 403:
|
|
1236
|
+
raise ForbiddenError(
|
|
1237
|
+
headers=dict(_response.headers),
|
|
1238
|
+
body=typing.cast(
|
|
1239
|
+
Forbidden,
|
|
1240
|
+
construct_type(
|
|
1241
|
+
type_=Forbidden, # type: ignore
|
|
1242
|
+
object_=_response.json(),
|
|
1243
|
+
),
|
|
1244
|
+
),
|
|
1245
|
+
)
|
|
1246
|
+
if _response.status_code == 404:
|
|
1247
|
+
raise NotFoundError(
|
|
1248
|
+
headers=dict(_response.headers),
|
|
1249
|
+
body=typing.cast(
|
|
1250
|
+
NotFound,
|
|
1251
|
+
construct_type(
|
|
1252
|
+
type_=NotFound, # type: ignore
|
|
1253
|
+
object_=_response.json(),
|
|
1254
|
+
),
|
|
1255
|
+
),
|
|
1256
|
+
)
|
|
1257
|
+
if _response.status_code == 422:
|
|
1258
|
+
raise UnprocessableEntityError(
|
|
1259
|
+
headers=dict(_response.headers),
|
|
1260
|
+
body=typing.cast(
|
|
1261
|
+
typing.Any,
|
|
1262
|
+
construct_type(
|
|
1263
|
+
type_=typing.Any, # type: ignore
|
|
1264
|
+
object_=_response.json(),
|
|
1265
|
+
),
|
|
1266
|
+
),
|
|
1267
|
+
)
|
|
1268
|
+
if _response.status_code == 429:
|
|
1269
|
+
raise TooManyRequestsError(
|
|
1270
|
+
headers=dict(_response.headers),
|
|
1271
|
+
body=typing.cast(
|
|
1272
|
+
TooManyRequests,
|
|
1273
|
+
construct_type(
|
|
1274
|
+
type_=TooManyRequests, # type: ignore
|
|
1275
|
+
object_=_response.json(),
|
|
1276
|
+
),
|
|
1277
|
+
),
|
|
1278
|
+
)
|
|
1279
|
+
_response_json = _response.json()
|
|
1280
|
+
except JSONDecodeError:
|
|
1281
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1282
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1283
|
+
|
|
1284
|
+
async def update(
|
|
1285
|
+
self,
|
|
1286
|
+
account_id: Uuid,
|
|
1287
|
+
folder_id: Uuid,
|
|
1288
|
+
*,
|
|
1289
|
+
data: FolderUpdateParamsData,
|
|
1290
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1291
|
+
) -> AsyncHttpResponse[FolderResponse]:
|
|
1292
|
+
"""
|
|
1293
|
+
Update folder details. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
1294
|
+
|
|
1295
|
+
Parameters
|
|
1296
|
+
----------
|
|
1297
|
+
account_id : Uuid
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
folder_id : Uuid
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
data : FolderUpdateParamsData
|
|
1304
|
+
|
|
1305
|
+
request_options : typing.Optional[RequestOptions]
|
|
1306
|
+
Request-specific configuration.
|
|
1307
|
+
|
|
1308
|
+
Returns
|
|
1309
|
+
-------
|
|
1310
|
+
AsyncHttpResponse[FolderResponse]
|
|
1311
|
+
OK
|
|
1312
|
+
"""
|
|
1313
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1314
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}",
|
|
1315
|
+
method="PATCH",
|
|
1316
|
+
json={
|
|
1317
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1318
|
+
object_=data, annotation=FolderUpdateParamsData, direction="write"
|
|
1319
|
+
),
|
|
1320
|
+
},
|
|
1321
|
+
headers={
|
|
1322
|
+
"content-type": "application/json",
|
|
1323
|
+
},
|
|
1324
|
+
request_options=request_options,
|
|
1325
|
+
omit=OMIT,
|
|
1326
|
+
)
|
|
1327
|
+
try:
|
|
1328
|
+
if 200 <= _response.status_code < 300:
|
|
1329
|
+
_data = typing.cast(
|
|
1330
|
+
FolderResponse,
|
|
1331
|
+
construct_type(
|
|
1332
|
+
type_=FolderResponse, # type: ignore
|
|
1333
|
+
object_=_response.json(),
|
|
1334
|
+
),
|
|
1335
|
+
)
|
|
1336
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1337
|
+
if _response.status_code == 400:
|
|
1338
|
+
raise BadRequestError(
|
|
1339
|
+
headers=dict(_response.headers),
|
|
1340
|
+
body=typing.cast(
|
|
1341
|
+
BadRequest,
|
|
1342
|
+
construct_type(
|
|
1343
|
+
type_=BadRequest, # type: ignore
|
|
1344
|
+
object_=_response.json(),
|
|
1345
|
+
),
|
|
1346
|
+
),
|
|
1347
|
+
)
|
|
1348
|
+
if _response.status_code == 401:
|
|
1349
|
+
raise UnauthorizedError(
|
|
1350
|
+
headers=dict(_response.headers),
|
|
1351
|
+
body=typing.cast(
|
|
1352
|
+
Unauthorized,
|
|
1353
|
+
construct_type(
|
|
1354
|
+
type_=Unauthorized, # type: ignore
|
|
1355
|
+
object_=_response.json(),
|
|
1356
|
+
),
|
|
1357
|
+
),
|
|
1358
|
+
)
|
|
1359
|
+
if _response.status_code == 403:
|
|
1360
|
+
raise ForbiddenError(
|
|
1361
|
+
headers=dict(_response.headers),
|
|
1362
|
+
body=typing.cast(
|
|
1363
|
+
Forbidden,
|
|
1364
|
+
construct_type(
|
|
1365
|
+
type_=Forbidden, # type: ignore
|
|
1366
|
+
object_=_response.json(),
|
|
1367
|
+
),
|
|
1368
|
+
),
|
|
1369
|
+
)
|
|
1370
|
+
if _response.status_code == 404:
|
|
1371
|
+
raise NotFoundError(
|
|
1372
|
+
headers=dict(_response.headers),
|
|
1373
|
+
body=typing.cast(
|
|
1374
|
+
NotFound,
|
|
1375
|
+
construct_type(
|
|
1376
|
+
type_=NotFound, # type: ignore
|
|
1377
|
+
object_=_response.json(),
|
|
1378
|
+
),
|
|
1379
|
+
),
|
|
1380
|
+
)
|
|
1381
|
+
if _response.status_code == 422:
|
|
1382
|
+
raise UnprocessableEntityError(
|
|
1383
|
+
headers=dict(_response.headers),
|
|
1384
|
+
body=typing.cast(
|
|
1385
|
+
typing.Any,
|
|
1386
|
+
construct_type(
|
|
1387
|
+
type_=typing.Any, # type: ignore
|
|
1388
|
+
object_=_response.json(),
|
|
1389
|
+
),
|
|
1390
|
+
),
|
|
1391
|
+
)
|
|
1392
|
+
if _response.status_code == 429:
|
|
1393
|
+
raise TooManyRequestsError(
|
|
1394
|
+
headers=dict(_response.headers),
|
|
1395
|
+
body=typing.cast(
|
|
1396
|
+
TooManyRequests,
|
|
1397
|
+
construct_type(
|
|
1398
|
+
type_=TooManyRequests, # type: ignore
|
|
1399
|
+
object_=_response.json(),
|
|
1400
|
+
),
|
|
1401
|
+
),
|
|
1402
|
+
)
|
|
1403
|
+
_response_json = _response.json()
|
|
1404
|
+
except JSONDecodeError:
|
|
1405
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1406
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1407
|
+
|
|
1408
|
+
async def index(
|
|
1409
|
+
self,
|
|
1410
|
+
account_id: Uuid,
|
|
1411
|
+
folder_id: Uuid,
|
|
1412
|
+
*,
|
|
1413
|
+
include: typing.Optional[FileWithMediaLinksInclude] = None,
|
|
1414
|
+
type: typing.Optional[ChildrenType] = None,
|
|
1415
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
1416
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
1417
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
1418
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1419
|
+
) -> AsyncHttpResponse[AssetsWithIncludesResponse]:
|
|
1420
|
+
"""
|
|
1421
|
+
List the children in the given folder.
|
|
1422
|
+
<br>
|
|
1423
|
+
Use the `include` query parameter to selectively include additional properties in the response.
|
|
1424
|
+
<br>
|
|
1425
|
+
Note: if you include `media_links.original` and the user does not have permission to download files
|
|
1426
|
+
in the corresponding project, then this endpoint will respond with a `403 Forbidden` error.
|
|
1427
|
+
If the content is inaccessible because watermarking is required for this user and isn't supported by
|
|
1428
|
+
the requested media_links, then the request will succeed but the unsupported media links will be set to null.
|
|
1429
|
+
Similarly, if a requested transcode link does not exist for a particular file (e.g. including
|
|
1430
|
+
`media_links.video_h264_180` on a static image file) or transoding process hasn't finished
|
|
1431
|
+
(i.e. the file's `status` is "uploaded" rather than "transcoded"), then the a media link will also be set to
|
|
1432
|
+
null in the response payload. In short, the client must handle null media links gracefully.
|
|
1433
|
+
<br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
1434
|
+
|
|
1435
|
+
Parameters
|
|
1436
|
+
----------
|
|
1437
|
+
account_id : Uuid
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
folder_id : Uuid
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
include : typing.Optional[FileWithMediaLinksInclude]
|
|
1444
|
+
|
|
1445
|
+
|
|
1446
|
+
type : typing.Optional[ChildrenType]
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
1450
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
1451
|
+
<br/>
|
|
1452
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
1453
|
+
|
|
1454
|
+
page_size : typing.Optional[RequestPageSize]
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
request_options : typing.Optional[RequestOptions]
|
|
1461
|
+
Request-specific configuration.
|
|
1462
|
+
|
|
1463
|
+
Returns
|
|
1464
|
+
-------
|
|
1465
|
+
AsyncHttpResponse[AssetsWithIncludesResponse]
|
|
1466
|
+
OK
|
|
1467
|
+
"""
|
|
1468
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1469
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/children",
|
|
1470
|
+
method="GET",
|
|
1471
|
+
params={
|
|
1472
|
+
"include": include,
|
|
1473
|
+
"type": type,
|
|
1474
|
+
"after": after,
|
|
1475
|
+
"page_size": page_size,
|
|
1476
|
+
"include_total_count": include_total_count,
|
|
1477
|
+
},
|
|
1478
|
+
request_options=request_options,
|
|
1479
|
+
)
|
|
1480
|
+
try:
|
|
1481
|
+
if 200 <= _response.status_code < 300:
|
|
1482
|
+
_data = typing.cast(
|
|
1483
|
+
AssetsWithIncludesResponse,
|
|
1484
|
+
construct_type(
|
|
1485
|
+
type_=AssetsWithIncludesResponse, # type: ignore
|
|
1486
|
+
object_=_response.json(),
|
|
1487
|
+
),
|
|
1488
|
+
)
|
|
1489
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1490
|
+
if _response.status_code == 400:
|
|
1491
|
+
raise BadRequestError(
|
|
1492
|
+
headers=dict(_response.headers),
|
|
1493
|
+
body=typing.cast(
|
|
1494
|
+
BadRequest,
|
|
1495
|
+
construct_type(
|
|
1496
|
+
type_=BadRequest, # type: ignore
|
|
1497
|
+
object_=_response.json(),
|
|
1498
|
+
),
|
|
1499
|
+
),
|
|
1500
|
+
)
|
|
1501
|
+
if _response.status_code == 401:
|
|
1502
|
+
raise UnauthorizedError(
|
|
1503
|
+
headers=dict(_response.headers),
|
|
1504
|
+
body=typing.cast(
|
|
1505
|
+
Unauthorized,
|
|
1506
|
+
construct_type(
|
|
1507
|
+
type_=Unauthorized, # type: ignore
|
|
1508
|
+
object_=_response.json(),
|
|
1509
|
+
),
|
|
1510
|
+
),
|
|
1511
|
+
)
|
|
1512
|
+
if _response.status_code == 403:
|
|
1513
|
+
raise ForbiddenError(
|
|
1514
|
+
headers=dict(_response.headers),
|
|
1515
|
+
body=typing.cast(
|
|
1516
|
+
Forbidden,
|
|
1517
|
+
construct_type(
|
|
1518
|
+
type_=Forbidden, # type: ignore
|
|
1519
|
+
object_=_response.json(),
|
|
1520
|
+
),
|
|
1521
|
+
),
|
|
1522
|
+
)
|
|
1523
|
+
if _response.status_code == 404:
|
|
1524
|
+
raise NotFoundError(
|
|
1525
|
+
headers=dict(_response.headers),
|
|
1526
|
+
body=typing.cast(
|
|
1527
|
+
NotFound,
|
|
1528
|
+
construct_type(
|
|
1529
|
+
type_=NotFound, # type: ignore
|
|
1530
|
+
object_=_response.json(),
|
|
1531
|
+
),
|
|
1532
|
+
),
|
|
1533
|
+
)
|
|
1534
|
+
if _response.status_code == 422:
|
|
1535
|
+
raise UnprocessableEntityError(
|
|
1536
|
+
headers=dict(_response.headers),
|
|
1537
|
+
body=typing.cast(
|
|
1538
|
+
typing.Any,
|
|
1539
|
+
construct_type(
|
|
1540
|
+
type_=typing.Any, # type: ignore
|
|
1541
|
+
object_=_response.json(),
|
|
1542
|
+
),
|
|
1543
|
+
),
|
|
1544
|
+
)
|
|
1545
|
+
if _response.status_code == 429:
|
|
1546
|
+
raise TooManyRequestsError(
|
|
1547
|
+
headers=dict(_response.headers),
|
|
1548
|
+
body=typing.cast(
|
|
1549
|
+
TooManyRequests,
|
|
1550
|
+
construct_type(
|
|
1551
|
+
type_=TooManyRequests, # type: ignore
|
|
1552
|
+
object_=_response.json(),
|
|
1553
|
+
),
|
|
1554
|
+
),
|
|
1555
|
+
)
|
|
1556
|
+
_response_json = _response.json()
|
|
1557
|
+
except JSONDecodeError:
|
|
1558
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1559
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1560
|
+
|
|
1561
|
+
async def copy(
|
|
1562
|
+
self,
|
|
1563
|
+
account_id: Uuid,
|
|
1564
|
+
folder_id: Uuid,
|
|
1565
|
+
*,
|
|
1566
|
+
copy_metadata: typing.Optional[bool] = None,
|
|
1567
|
+
data: typing.Optional[FolderCopyParamsData] = OMIT,
|
|
1568
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1569
|
+
) -> AsyncHttpResponse[FolderCopyResponse]:
|
|
1570
|
+
"""
|
|
1571
|
+
Copy folder. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
1572
|
+
|
|
1573
|
+
Parameters
|
|
1574
|
+
----------
|
|
1575
|
+
account_id : Uuid
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
folder_id : Uuid
|
|
1579
|
+
|
|
1580
|
+
|
|
1581
|
+
copy_metadata : typing.Optional[bool]
|
|
1582
|
+
Whether to copy metadata values along with the folder
|
|
1583
|
+
|
|
1584
|
+
data : typing.Optional[FolderCopyParamsData]
|
|
1585
|
+
|
|
1586
|
+
request_options : typing.Optional[RequestOptions]
|
|
1587
|
+
Request-specific configuration.
|
|
1588
|
+
|
|
1589
|
+
Returns
|
|
1590
|
+
-------
|
|
1591
|
+
AsyncHttpResponse[FolderCopyResponse]
|
|
1592
|
+
OK
|
|
1593
|
+
"""
|
|
1594
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1595
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/copy",
|
|
1596
|
+
method="POST",
|
|
1597
|
+
params={
|
|
1598
|
+
"copy_metadata": copy_metadata,
|
|
1599
|
+
},
|
|
1600
|
+
json={
|
|
1601
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1602
|
+
object_=data, annotation=FolderCopyParamsData, direction="write"
|
|
1603
|
+
),
|
|
1604
|
+
},
|
|
1605
|
+
headers={
|
|
1606
|
+
"content-type": "application/json",
|
|
1607
|
+
},
|
|
1608
|
+
request_options=request_options,
|
|
1609
|
+
omit=OMIT,
|
|
1610
|
+
)
|
|
1611
|
+
try:
|
|
1612
|
+
if 200 <= _response.status_code < 300:
|
|
1613
|
+
_data = typing.cast(
|
|
1614
|
+
FolderCopyResponse,
|
|
1615
|
+
construct_type(
|
|
1616
|
+
type_=FolderCopyResponse, # type: ignore
|
|
1617
|
+
object_=_response.json(),
|
|
1618
|
+
),
|
|
1619
|
+
)
|
|
1620
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1621
|
+
if _response.status_code == 400:
|
|
1622
|
+
raise BadRequestError(
|
|
1623
|
+
headers=dict(_response.headers),
|
|
1624
|
+
body=typing.cast(
|
|
1625
|
+
BadRequest,
|
|
1626
|
+
construct_type(
|
|
1627
|
+
type_=BadRequest, # type: ignore
|
|
1628
|
+
object_=_response.json(),
|
|
1629
|
+
),
|
|
1630
|
+
),
|
|
1631
|
+
)
|
|
1632
|
+
if _response.status_code == 401:
|
|
1633
|
+
raise UnauthorizedError(
|
|
1634
|
+
headers=dict(_response.headers),
|
|
1635
|
+
body=typing.cast(
|
|
1636
|
+
Unauthorized,
|
|
1637
|
+
construct_type(
|
|
1638
|
+
type_=Unauthorized, # type: ignore
|
|
1639
|
+
object_=_response.json(),
|
|
1640
|
+
),
|
|
1641
|
+
),
|
|
1642
|
+
)
|
|
1643
|
+
if _response.status_code == 403:
|
|
1644
|
+
raise ForbiddenError(
|
|
1645
|
+
headers=dict(_response.headers),
|
|
1646
|
+
body=typing.cast(
|
|
1647
|
+
Forbidden,
|
|
1648
|
+
construct_type(
|
|
1649
|
+
type_=Forbidden, # type: ignore
|
|
1650
|
+
object_=_response.json(),
|
|
1651
|
+
),
|
|
1652
|
+
),
|
|
1653
|
+
)
|
|
1654
|
+
if _response.status_code == 404:
|
|
1655
|
+
raise NotFoundError(
|
|
1656
|
+
headers=dict(_response.headers),
|
|
1657
|
+
body=typing.cast(
|
|
1658
|
+
NotFound,
|
|
1659
|
+
construct_type(
|
|
1660
|
+
type_=NotFound, # type: ignore
|
|
1661
|
+
object_=_response.json(),
|
|
1662
|
+
),
|
|
1663
|
+
),
|
|
1664
|
+
)
|
|
1665
|
+
if _response.status_code == 422:
|
|
1666
|
+
raise UnprocessableEntityError(
|
|
1667
|
+
headers=dict(_response.headers),
|
|
1668
|
+
body=typing.cast(
|
|
1669
|
+
typing.Any,
|
|
1670
|
+
construct_type(
|
|
1671
|
+
type_=typing.Any, # type: ignore
|
|
1672
|
+
object_=_response.json(),
|
|
1673
|
+
),
|
|
1674
|
+
),
|
|
1675
|
+
)
|
|
1676
|
+
if _response.status_code == 429:
|
|
1677
|
+
raise TooManyRequestsError(
|
|
1678
|
+
headers=dict(_response.headers),
|
|
1679
|
+
body=typing.cast(
|
|
1680
|
+
TooManyRequests,
|
|
1681
|
+
construct_type(
|
|
1682
|
+
type_=TooManyRequests, # type: ignore
|
|
1683
|
+
object_=_response.json(),
|
|
1684
|
+
),
|
|
1685
|
+
),
|
|
1686
|
+
)
|
|
1687
|
+
_response_json = _response.json()
|
|
1688
|
+
except JSONDecodeError:
|
|
1689
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1690
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1691
|
+
|
|
1692
|
+
async def list(
|
|
1693
|
+
self,
|
|
1694
|
+
account_id: Uuid,
|
|
1695
|
+
folder_id: Uuid,
|
|
1696
|
+
*,
|
|
1697
|
+
include: typing.Optional[AssetInclude] = None,
|
|
1698
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
1699
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
1700
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
1701
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1702
|
+
) -> AsyncHttpResponse[FoldersWithIncludesResponse]:
|
|
1703
|
+
"""
|
|
1704
|
+
List folders in a given folder. <br>Rate Limits: 5 calls per 1 second(s) per account_user
|
|
1705
|
+
|
|
1706
|
+
Parameters
|
|
1707
|
+
----------
|
|
1708
|
+
account_id : Uuid
|
|
1709
|
+
|
|
1710
|
+
|
|
1711
|
+
folder_id : Uuid
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
include : typing.Optional[AssetInclude]
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
1718
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
1719
|
+
<br/>
|
|
1720
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
1721
|
+
|
|
1722
|
+
page_size : typing.Optional[RequestPageSize]
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
1726
|
+
|
|
1727
|
+
|
|
1728
|
+
request_options : typing.Optional[RequestOptions]
|
|
1729
|
+
Request-specific configuration.
|
|
1730
|
+
|
|
1731
|
+
Returns
|
|
1732
|
+
-------
|
|
1733
|
+
AsyncHttpResponse[FoldersWithIncludesResponse]
|
|
1734
|
+
OK
|
|
1735
|
+
"""
|
|
1736
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1737
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/folders",
|
|
1738
|
+
method="GET",
|
|
1739
|
+
params={
|
|
1740
|
+
"include": include,
|
|
1741
|
+
"after": after,
|
|
1742
|
+
"page_size": page_size,
|
|
1743
|
+
"include_total_count": include_total_count,
|
|
1744
|
+
},
|
|
1745
|
+
request_options=request_options,
|
|
1746
|
+
)
|
|
1747
|
+
try:
|
|
1748
|
+
if 200 <= _response.status_code < 300:
|
|
1749
|
+
_data = typing.cast(
|
|
1750
|
+
FoldersWithIncludesResponse,
|
|
1751
|
+
construct_type(
|
|
1752
|
+
type_=FoldersWithIncludesResponse, # type: ignore
|
|
1753
|
+
object_=_response.json(),
|
|
1754
|
+
),
|
|
1755
|
+
)
|
|
1756
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1757
|
+
if _response.status_code == 400:
|
|
1758
|
+
raise BadRequestError(
|
|
1759
|
+
headers=dict(_response.headers),
|
|
1760
|
+
body=typing.cast(
|
|
1761
|
+
BadRequest,
|
|
1762
|
+
construct_type(
|
|
1763
|
+
type_=BadRequest, # type: ignore
|
|
1764
|
+
object_=_response.json(),
|
|
1765
|
+
),
|
|
1766
|
+
),
|
|
1767
|
+
)
|
|
1768
|
+
if _response.status_code == 401:
|
|
1769
|
+
raise UnauthorizedError(
|
|
1770
|
+
headers=dict(_response.headers),
|
|
1771
|
+
body=typing.cast(
|
|
1772
|
+
Unauthorized,
|
|
1773
|
+
construct_type(
|
|
1774
|
+
type_=Unauthorized, # type: ignore
|
|
1775
|
+
object_=_response.json(),
|
|
1776
|
+
),
|
|
1777
|
+
),
|
|
1778
|
+
)
|
|
1779
|
+
if _response.status_code == 403:
|
|
1780
|
+
raise ForbiddenError(
|
|
1781
|
+
headers=dict(_response.headers),
|
|
1782
|
+
body=typing.cast(
|
|
1783
|
+
Forbidden,
|
|
1784
|
+
construct_type(
|
|
1785
|
+
type_=Forbidden, # type: ignore
|
|
1786
|
+
object_=_response.json(),
|
|
1787
|
+
),
|
|
1788
|
+
),
|
|
1789
|
+
)
|
|
1790
|
+
if _response.status_code == 404:
|
|
1791
|
+
raise NotFoundError(
|
|
1792
|
+
headers=dict(_response.headers),
|
|
1793
|
+
body=typing.cast(
|
|
1794
|
+
NotFound,
|
|
1795
|
+
construct_type(
|
|
1796
|
+
type_=NotFound, # type: ignore
|
|
1797
|
+
object_=_response.json(),
|
|
1798
|
+
),
|
|
1799
|
+
),
|
|
1800
|
+
)
|
|
1801
|
+
if _response.status_code == 422:
|
|
1802
|
+
raise UnprocessableEntityError(
|
|
1803
|
+
headers=dict(_response.headers),
|
|
1804
|
+
body=typing.cast(
|
|
1805
|
+
typing.Any,
|
|
1806
|
+
construct_type(
|
|
1807
|
+
type_=typing.Any, # type: ignore
|
|
1808
|
+
object_=_response.json(),
|
|
1809
|
+
),
|
|
1810
|
+
),
|
|
1811
|
+
)
|
|
1812
|
+
if _response.status_code == 429:
|
|
1813
|
+
raise TooManyRequestsError(
|
|
1814
|
+
headers=dict(_response.headers),
|
|
1815
|
+
body=typing.cast(
|
|
1816
|
+
TooManyRequests,
|
|
1817
|
+
construct_type(
|
|
1818
|
+
type_=TooManyRequests, # type: ignore
|
|
1819
|
+
object_=_response.json(),
|
|
1820
|
+
),
|
|
1821
|
+
),
|
|
1822
|
+
)
|
|
1823
|
+
_response_json = _response.json()
|
|
1824
|
+
except JSONDecodeError:
|
|
1825
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1826
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1827
|
+
|
|
1828
|
+
async def create(
|
|
1829
|
+
self,
|
|
1830
|
+
account_id: Uuid,
|
|
1831
|
+
folder_id: Uuid,
|
|
1832
|
+
*,
|
|
1833
|
+
data: FolderCreateParamsData,
|
|
1834
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1835
|
+
) -> AsyncHttpResponse[FolderResponse]:
|
|
1836
|
+
"""
|
|
1837
|
+
Create a new folder inside the given <i>folder_id</i> path param. <br>Rate Limits: 3 calls per 1 second(s) per account_user
|
|
1838
|
+
|
|
1839
|
+
Parameters
|
|
1840
|
+
----------
|
|
1841
|
+
account_id : Uuid
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
folder_id : Uuid
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
data : FolderCreateParamsData
|
|
1848
|
+
|
|
1849
|
+
request_options : typing.Optional[RequestOptions]
|
|
1850
|
+
Request-specific configuration.
|
|
1851
|
+
|
|
1852
|
+
Returns
|
|
1853
|
+
-------
|
|
1854
|
+
AsyncHttpResponse[FolderResponse]
|
|
1855
|
+
Created
|
|
1856
|
+
"""
|
|
1857
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1858
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/folders",
|
|
1859
|
+
method="POST",
|
|
1860
|
+
json={
|
|
1861
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1862
|
+
object_=data, annotation=FolderCreateParamsData, direction="write"
|
|
1863
|
+
),
|
|
1864
|
+
},
|
|
1865
|
+
headers={
|
|
1866
|
+
"content-type": "application/json",
|
|
1867
|
+
},
|
|
1868
|
+
request_options=request_options,
|
|
1869
|
+
omit=OMIT,
|
|
1870
|
+
)
|
|
1871
|
+
try:
|
|
1872
|
+
if 200 <= _response.status_code < 300:
|
|
1873
|
+
_data = typing.cast(
|
|
1874
|
+
FolderResponse,
|
|
1875
|
+
construct_type(
|
|
1876
|
+
type_=FolderResponse, # type: ignore
|
|
1877
|
+
object_=_response.json(),
|
|
1878
|
+
),
|
|
1879
|
+
)
|
|
1880
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1881
|
+
if _response.status_code == 400:
|
|
1882
|
+
raise BadRequestError(
|
|
1883
|
+
headers=dict(_response.headers),
|
|
1884
|
+
body=typing.cast(
|
|
1885
|
+
BadRequest,
|
|
1886
|
+
construct_type(
|
|
1887
|
+
type_=BadRequest, # type: ignore
|
|
1888
|
+
object_=_response.json(),
|
|
1889
|
+
),
|
|
1890
|
+
),
|
|
1891
|
+
)
|
|
1892
|
+
if _response.status_code == 401:
|
|
1893
|
+
raise UnauthorizedError(
|
|
1894
|
+
headers=dict(_response.headers),
|
|
1895
|
+
body=typing.cast(
|
|
1896
|
+
Unauthorized,
|
|
1897
|
+
construct_type(
|
|
1898
|
+
type_=Unauthorized, # type: ignore
|
|
1899
|
+
object_=_response.json(),
|
|
1900
|
+
),
|
|
1901
|
+
),
|
|
1902
|
+
)
|
|
1903
|
+
if _response.status_code == 403:
|
|
1904
|
+
raise ForbiddenError(
|
|
1905
|
+
headers=dict(_response.headers),
|
|
1906
|
+
body=typing.cast(
|
|
1907
|
+
Forbidden,
|
|
1908
|
+
construct_type(
|
|
1909
|
+
type_=Forbidden, # type: ignore
|
|
1910
|
+
object_=_response.json(),
|
|
1911
|
+
),
|
|
1912
|
+
),
|
|
1913
|
+
)
|
|
1914
|
+
if _response.status_code == 404:
|
|
1915
|
+
raise NotFoundError(
|
|
1916
|
+
headers=dict(_response.headers),
|
|
1917
|
+
body=typing.cast(
|
|
1918
|
+
NotFound,
|
|
1919
|
+
construct_type(
|
|
1920
|
+
type_=NotFound, # type: ignore
|
|
1921
|
+
object_=_response.json(),
|
|
1922
|
+
),
|
|
1923
|
+
),
|
|
1924
|
+
)
|
|
1925
|
+
if _response.status_code == 422:
|
|
1926
|
+
raise UnprocessableEntityError(
|
|
1927
|
+
headers=dict(_response.headers),
|
|
1928
|
+
body=typing.cast(
|
|
1929
|
+
typing.Any,
|
|
1930
|
+
construct_type(
|
|
1931
|
+
type_=typing.Any, # type: ignore
|
|
1932
|
+
object_=_response.json(),
|
|
1933
|
+
),
|
|
1934
|
+
),
|
|
1935
|
+
)
|
|
1936
|
+
if _response.status_code == 429:
|
|
1937
|
+
raise TooManyRequestsError(
|
|
1938
|
+
headers=dict(_response.headers),
|
|
1939
|
+
body=typing.cast(
|
|
1940
|
+
TooManyRequests,
|
|
1941
|
+
construct_type(
|
|
1942
|
+
type_=TooManyRequests, # type: ignore
|
|
1943
|
+
object_=_response.json(),
|
|
1944
|
+
),
|
|
1945
|
+
),
|
|
1946
|
+
)
|
|
1947
|
+
_response_json = _response.json()
|
|
1948
|
+
except JSONDecodeError:
|
|
1949
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1950
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1951
|
+
|
|
1952
|
+
async def move(
|
|
1953
|
+
self,
|
|
1954
|
+
account_id: Uuid,
|
|
1955
|
+
folder_id: Uuid,
|
|
1956
|
+
*,
|
|
1957
|
+
data: FolderMoveParamsData,
|
|
1958
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1959
|
+
) -> AsyncHttpResponse[FolderResponse]:
|
|
1960
|
+
"""
|
|
1961
|
+
Move folder to a folder. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
1962
|
+
|
|
1963
|
+
Parameters
|
|
1964
|
+
----------
|
|
1965
|
+
account_id : Uuid
|
|
1966
|
+
|
|
1967
|
+
|
|
1968
|
+
folder_id : Uuid
|
|
1969
|
+
|
|
1970
|
+
|
|
1971
|
+
data : FolderMoveParamsData
|
|
1972
|
+
|
|
1973
|
+
request_options : typing.Optional[RequestOptions]
|
|
1974
|
+
Request-specific configuration.
|
|
1975
|
+
|
|
1976
|
+
Returns
|
|
1977
|
+
-------
|
|
1978
|
+
AsyncHttpResponse[FolderResponse]
|
|
1979
|
+
OK
|
|
1980
|
+
"""
|
|
1981
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1982
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/folders/{jsonable_encoder(folder_id)}/move",
|
|
1983
|
+
method="PATCH",
|
|
1984
|
+
json={
|
|
1985
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1986
|
+
object_=data, annotation=FolderMoveParamsData, direction="write"
|
|
1987
|
+
),
|
|
1988
|
+
},
|
|
1989
|
+
headers={
|
|
1990
|
+
"content-type": "application/json",
|
|
1991
|
+
},
|
|
1992
|
+
request_options=request_options,
|
|
1993
|
+
omit=OMIT,
|
|
1994
|
+
)
|
|
1995
|
+
try:
|
|
1996
|
+
if 200 <= _response.status_code < 300:
|
|
1997
|
+
_data = typing.cast(
|
|
1998
|
+
FolderResponse,
|
|
1999
|
+
construct_type(
|
|
2000
|
+
type_=FolderResponse, # type: ignore
|
|
2001
|
+
object_=_response.json(),
|
|
2002
|
+
),
|
|
2003
|
+
)
|
|
2004
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2005
|
+
if _response.status_code == 400:
|
|
2006
|
+
raise BadRequestError(
|
|
2007
|
+
headers=dict(_response.headers),
|
|
2008
|
+
body=typing.cast(
|
|
2009
|
+
BadRequest,
|
|
2010
|
+
construct_type(
|
|
2011
|
+
type_=BadRequest, # type: ignore
|
|
2012
|
+
object_=_response.json(),
|
|
2013
|
+
),
|
|
2014
|
+
),
|
|
2015
|
+
)
|
|
2016
|
+
if _response.status_code == 401:
|
|
2017
|
+
raise UnauthorizedError(
|
|
2018
|
+
headers=dict(_response.headers),
|
|
2019
|
+
body=typing.cast(
|
|
2020
|
+
Unauthorized,
|
|
2021
|
+
construct_type(
|
|
2022
|
+
type_=Unauthorized, # type: ignore
|
|
2023
|
+
object_=_response.json(),
|
|
2024
|
+
),
|
|
2025
|
+
),
|
|
2026
|
+
)
|
|
2027
|
+
if _response.status_code == 403:
|
|
2028
|
+
raise ForbiddenError(
|
|
2029
|
+
headers=dict(_response.headers),
|
|
2030
|
+
body=typing.cast(
|
|
2031
|
+
Forbidden,
|
|
2032
|
+
construct_type(
|
|
2033
|
+
type_=Forbidden, # type: ignore
|
|
2034
|
+
object_=_response.json(),
|
|
2035
|
+
),
|
|
2036
|
+
),
|
|
2037
|
+
)
|
|
2038
|
+
if _response.status_code == 404:
|
|
2039
|
+
raise NotFoundError(
|
|
2040
|
+
headers=dict(_response.headers),
|
|
2041
|
+
body=typing.cast(
|
|
2042
|
+
NotFound,
|
|
2043
|
+
construct_type(
|
|
2044
|
+
type_=NotFound, # type: ignore
|
|
2045
|
+
object_=_response.json(),
|
|
2046
|
+
),
|
|
2047
|
+
),
|
|
2048
|
+
)
|
|
2049
|
+
if _response.status_code == 422:
|
|
2050
|
+
raise UnprocessableEntityError(
|
|
2051
|
+
headers=dict(_response.headers),
|
|
2052
|
+
body=typing.cast(
|
|
2053
|
+
typing.Any,
|
|
2054
|
+
construct_type(
|
|
2055
|
+
type_=typing.Any, # type: ignore
|
|
2056
|
+
object_=_response.json(),
|
|
2057
|
+
),
|
|
2058
|
+
),
|
|
2059
|
+
)
|
|
2060
|
+
if _response.status_code == 429:
|
|
2061
|
+
raise TooManyRequestsError(
|
|
2062
|
+
headers=dict(_response.headers),
|
|
2063
|
+
body=typing.cast(
|
|
2064
|
+
TooManyRequests,
|
|
2065
|
+
construct_type(
|
|
2066
|
+
type_=TooManyRequests, # type: ignore
|
|
2067
|
+
object_=_response.json(),
|
|
2068
|
+
),
|
|
2069
|
+
),
|
|
2070
|
+
)
|
|
2071
|
+
_response_json = _response.json()
|
|
2072
|
+
except JSONDecodeError:
|
|
2073
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2074
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|