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,2511 @@
|
|
|
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.pagination import AsyncPager, SyncPager
|
|
11
|
+
from ..core.request_options import RequestOptions
|
|
12
|
+
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
13
|
+
from ..core.unchecked_base_model import construct_type
|
|
14
|
+
from ..errors.bad_request_error import BadRequestError
|
|
15
|
+
from ..errors.forbidden_error import ForbiddenError
|
|
16
|
+
from ..errors.not_found_error import NotFoundError
|
|
17
|
+
from ..errors.too_many_requests_error import TooManyRequestsError
|
|
18
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
|
19
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
20
|
+
from ..types.add_asset_response import AddAssetResponse
|
|
21
|
+
from ..types.bad_request import BadRequest
|
|
22
|
+
from ..types.forbidden import Forbidden
|
|
23
|
+
from ..types.include_total_count import IncludeTotalCount
|
|
24
|
+
from ..types.not_found import NotFound
|
|
25
|
+
from ..types.remove_asset_response import RemoveAssetResponse
|
|
26
|
+
from ..types.request_after_opaque_cursor import RequestAfterOpaqueCursor
|
|
27
|
+
from ..types.request_page_size import RequestPageSize
|
|
28
|
+
from ..types.share import Share
|
|
29
|
+
from ..types.share_response import ShareResponse
|
|
30
|
+
from ..types.share_reviewers_response import ShareReviewersResponse
|
|
31
|
+
from ..types.shares_response import SharesResponse
|
|
32
|
+
from ..types.too_many_requests import TooManyRequests
|
|
33
|
+
from ..types.unauthorized import Unauthorized
|
|
34
|
+
from ..types.user import User
|
|
35
|
+
from ..types.uuid_ import Uuid
|
|
36
|
+
from .types.add_asset_params_data import AddAssetParamsData
|
|
37
|
+
from .types.add_reviewers_to_share_params_data import AddReviewersToShareParamsData
|
|
38
|
+
from .types.create_share_params_data import CreateShareParamsData
|
|
39
|
+
from .types.remove_reviewer_params_data import RemoveReviewerParamsData
|
|
40
|
+
from .types.update_share_params_data import UpdateShareParamsData
|
|
41
|
+
|
|
42
|
+
# this is used as the default value for optional parameters
|
|
43
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class RawSharesClient:
|
|
47
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
48
|
+
self._client_wrapper = client_wrapper
|
|
49
|
+
|
|
50
|
+
def show(
|
|
51
|
+
self, account_id: Uuid, share_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
|
|
52
|
+
) -> HttpResponse[ShareResponse]:
|
|
53
|
+
"""
|
|
54
|
+
Show a single Share. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
55
|
+
|
|
56
|
+
Parameters
|
|
57
|
+
----------
|
|
58
|
+
account_id : Uuid
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
share_id : Uuid
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
request_options : typing.Optional[RequestOptions]
|
|
65
|
+
Request-specific configuration.
|
|
66
|
+
|
|
67
|
+
Returns
|
|
68
|
+
-------
|
|
69
|
+
HttpResponse[ShareResponse]
|
|
70
|
+
OK
|
|
71
|
+
"""
|
|
72
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
73
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}",
|
|
74
|
+
method="GET",
|
|
75
|
+
request_options=request_options,
|
|
76
|
+
)
|
|
77
|
+
try:
|
|
78
|
+
if 200 <= _response.status_code < 300:
|
|
79
|
+
_data = typing.cast(
|
|
80
|
+
ShareResponse,
|
|
81
|
+
construct_type(
|
|
82
|
+
type_=ShareResponse, # type: ignore
|
|
83
|
+
object_=_response.json(),
|
|
84
|
+
),
|
|
85
|
+
)
|
|
86
|
+
return HttpResponse(response=_response, data=_data)
|
|
87
|
+
if _response.status_code == 400:
|
|
88
|
+
raise BadRequestError(
|
|
89
|
+
headers=dict(_response.headers),
|
|
90
|
+
body=typing.cast(
|
|
91
|
+
BadRequest,
|
|
92
|
+
construct_type(
|
|
93
|
+
type_=BadRequest, # type: ignore
|
|
94
|
+
object_=_response.json(),
|
|
95
|
+
),
|
|
96
|
+
),
|
|
97
|
+
)
|
|
98
|
+
if _response.status_code == 401:
|
|
99
|
+
raise UnauthorizedError(
|
|
100
|
+
headers=dict(_response.headers),
|
|
101
|
+
body=typing.cast(
|
|
102
|
+
Unauthorized,
|
|
103
|
+
construct_type(
|
|
104
|
+
type_=Unauthorized, # type: ignore
|
|
105
|
+
object_=_response.json(),
|
|
106
|
+
),
|
|
107
|
+
),
|
|
108
|
+
)
|
|
109
|
+
if _response.status_code == 403:
|
|
110
|
+
raise ForbiddenError(
|
|
111
|
+
headers=dict(_response.headers),
|
|
112
|
+
body=typing.cast(
|
|
113
|
+
Forbidden,
|
|
114
|
+
construct_type(
|
|
115
|
+
type_=Forbidden, # type: ignore
|
|
116
|
+
object_=_response.json(),
|
|
117
|
+
),
|
|
118
|
+
),
|
|
119
|
+
)
|
|
120
|
+
if _response.status_code == 404:
|
|
121
|
+
raise NotFoundError(
|
|
122
|
+
headers=dict(_response.headers),
|
|
123
|
+
body=typing.cast(
|
|
124
|
+
NotFound,
|
|
125
|
+
construct_type(
|
|
126
|
+
type_=NotFound, # type: ignore
|
|
127
|
+
object_=_response.json(),
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
|
+
)
|
|
131
|
+
if _response.status_code == 422:
|
|
132
|
+
raise UnprocessableEntityError(
|
|
133
|
+
headers=dict(_response.headers),
|
|
134
|
+
body=typing.cast(
|
|
135
|
+
typing.Any,
|
|
136
|
+
construct_type(
|
|
137
|
+
type_=typing.Any, # type: ignore
|
|
138
|
+
object_=_response.json(),
|
|
139
|
+
),
|
|
140
|
+
),
|
|
141
|
+
)
|
|
142
|
+
if _response.status_code == 429:
|
|
143
|
+
raise TooManyRequestsError(
|
|
144
|
+
headers=dict(_response.headers),
|
|
145
|
+
body=typing.cast(
|
|
146
|
+
TooManyRequests,
|
|
147
|
+
construct_type(
|
|
148
|
+
type_=TooManyRequests, # type: ignore
|
|
149
|
+
object_=_response.json(),
|
|
150
|
+
),
|
|
151
|
+
),
|
|
152
|
+
)
|
|
153
|
+
_response_json = _response.json()
|
|
154
|
+
except JSONDecodeError:
|
|
155
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
156
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
157
|
+
|
|
158
|
+
def delete(
|
|
159
|
+
self, account_id: Uuid, share_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
|
|
160
|
+
) -> HttpResponse[None]:
|
|
161
|
+
"""
|
|
162
|
+
Delete a share. <br>Rate Limits: 60 calls per 1.00 minute(s) per account_user
|
|
163
|
+
|
|
164
|
+
Parameters
|
|
165
|
+
----------
|
|
166
|
+
account_id : Uuid
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
share_id : Uuid
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
request_options : typing.Optional[RequestOptions]
|
|
173
|
+
Request-specific configuration.
|
|
174
|
+
|
|
175
|
+
Returns
|
|
176
|
+
-------
|
|
177
|
+
HttpResponse[None]
|
|
178
|
+
"""
|
|
179
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
180
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}",
|
|
181
|
+
method="DELETE",
|
|
182
|
+
request_options=request_options,
|
|
183
|
+
)
|
|
184
|
+
try:
|
|
185
|
+
if 200 <= _response.status_code < 300:
|
|
186
|
+
return HttpResponse(response=_response, data=None)
|
|
187
|
+
if _response.status_code == 400:
|
|
188
|
+
raise BadRequestError(
|
|
189
|
+
headers=dict(_response.headers),
|
|
190
|
+
body=typing.cast(
|
|
191
|
+
BadRequest,
|
|
192
|
+
construct_type(
|
|
193
|
+
type_=BadRequest, # type: ignore
|
|
194
|
+
object_=_response.json(),
|
|
195
|
+
),
|
|
196
|
+
),
|
|
197
|
+
)
|
|
198
|
+
if _response.status_code == 401:
|
|
199
|
+
raise UnauthorizedError(
|
|
200
|
+
headers=dict(_response.headers),
|
|
201
|
+
body=typing.cast(
|
|
202
|
+
Unauthorized,
|
|
203
|
+
construct_type(
|
|
204
|
+
type_=Unauthorized, # type: ignore
|
|
205
|
+
object_=_response.json(),
|
|
206
|
+
),
|
|
207
|
+
),
|
|
208
|
+
)
|
|
209
|
+
if _response.status_code == 403:
|
|
210
|
+
raise ForbiddenError(
|
|
211
|
+
headers=dict(_response.headers),
|
|
212
|
+
body=typing.cast(
|
|
213
|
+
Forbidden,
|
|
214
|
+
construct_type(
|
|
215
|
+
type_=Forbidden, # type: ignore
|
|
216
|
+
object_=_response.json(),
|
|
217
|
+
),
|
|
218
|
+
),
|
|
219
|
+
)
|
|
220
|
+
if _response.status_code == 404:
|
|
221
|
+
raise NotFoundError(
|
|
222
|
+
headers=dict(_response.headers),
|
|
223
|
+
body=typing.cast(
|
|
224
|
+
NotFound,
|
|
225
|
+
construct_type(
|
|
226
|
+
type_=NotFound, # type: ignore
|
|
227
|
+
object_=_response.json(),
|
|
228
|
+
),
|
|
229
|
+
),
|
|
230
|
+
)
|
|
231
|
+
if _response.status_code == 422:
|
|
232
|
+
raise UnprocessableEntityError(
|
|
233
|
+
headers=dict(_response.headers),
|
|
234
|
+
body=typing.cast(
|
|
235
|
+
typing.Any,
|
|
236
|
+
construct_type(
|
|
237
|
+
type_=typing.Any, # type: ignore
|
|
238
|
+
object_=_response.json(),
|
|
239
|
+
),
|
|
240
|
+
),
|
|
241
|
+
)
|
|
242
|
+
if _response.status_code == 429:
|
|
243
|
+
raise TooManyRequestsError(
|
|
244
|
+
headers=dict(_response.headers),
|
|
245
|
+
body=typing.cast(
|
|
246
|
+
TooManyRequests,
|
|
247
|
+
construct_type(
|
|
248
|
+
type_=TooManyRequests, # type: ignore
|
|
249
|
+
object_=_response.json(),
|
|
250
|
+
),
|
|
251
|
+
),
|
|
252
|
+
)
|
|
253
|
+
_response_json = _response.json()
|
|
254
|
+
except JSONDecodeError:
|
|
255
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
256
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
257
|
+
|
|
258
|
+
def update(
|
|
259
|
+
self,
|
|
260
|
+
account_id: Uuid,
|
|
261
|
+
share_id: Uuid,
|
|
262
|
+
*,
|
|
263
|
+
data: UpdateShareParamsData,
|
|
264
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
265
|
+
) -> HttpResponse[ShareResponse]:
|
|
266
|
+
"""
|
|
267
|
+
Update share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
268
|
+
|
|
269
|
+
Parameters
|
|
270
|
+
----------
|
|
271
|
+
account_id : Uuid
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
share_id : Uuid
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
data : UpdateShareParamsData
|
|
278
|
+
|
|
279
|
+
request_options : typing.Optional[RequestOptions]
|
|
280
|
+
Request-specific configuration.
|
|
281
|
+
|
|
282
|
+
Returns
|
|
283
|
+
-------
|
|
284
|
+
HttpResponse[ShareResponse]
|
|
285
|
+
OK
|
|
286
|
+
"""
|
|
287
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
288
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}",
|
|
289
|
+
method="PATCH",
|
|
290
|
+
json={
|
|
291
|
+
"data": convert_and_respect_annotation_metadata(
|
|
292
|
+
object_=data, annotation=UpdateShareParamsData, direction="write"
|
|
293
|
+
),
|
|
294
|
+
},
|
|
295
|
+
headers={
|
|
296
|
+
"content-type": "application/json",
|
|
297
|
+
},
|
|
298
|
+
request_options=request_options,
|
|
299
|
+
omit=OMIT,
|
|
300
|
+
)
|
|
301
|
+
try:
|
|
302
|
+
if 200 <= _response.status_code < 300:
|
|
303
|
+
_data = typing.cast(
|
|
304
|
+
ShareResponse,
|
|
305
|
+
construct_type(
|
|
306
|
+
type_=ShareResponse, # type: ignore
|
|
307
|
+
object_=_response.json(),
|
|
308
|
+
),
|
|
309
|
+
)
|
|
310
|
+
return HttpResponse(response=_response, data=_data)
|
|
311
|
+
if _response.status_code == 400:
|
|
312
|
+
raise BadRequestError(
|
|
313
|
+
headers=dict(_response.headers),
|
|
314
|
+
body=typing.cast(
|
|
315
|
+
BadRequest,
|
|
316
|
+
construct_type(
|
|
317
|
+
type_=BadRequest, # type: ignore
|
|
318
|
+
object_=_response.json(),
|
|
319
|
+
),
|
|
320
|
+
),
|
|
321
|
+
)
|
|
322
|
+
if _response.status_code == 401:
|
|
323
|
+
raise UnauthorizedError(
|
|
324
|
+
headers=dict(_response.headers),
|
|
325
|
+
body=typing.cast(
|
|
326
|
+
Unauthorized,
|
|
327
|
+
construct_type(
|
|
328
|
+
type_=Unauthorized, # type: ignore
|
|
329
|
+
object_=_response.json(),
|
|
330
|
+
),
|
|
331
|
+
),
|
|
332
|
+
)
|
|
333
|
+
if _response.status_code == 403:
|
|
334
|
+
raise ForbiddenError(
|
|
335
|
+
headers=dict(_response.headers),
|
|
336
|
+
body=typing.cast(
|
|
337
|
+
Forbidden,
|
|
338
|
+
construct_type(
|
|
339
|
+
type_=Forbidden, # type: ignore
|
|
340
|
+
object_=_response.json(),
|
|
341
|
+
),
|
|
342
|
+
),
|
|
343
|
+
)
|
|
344
|
+
if _response.status_code == 404:
|
|
345
|
+
raise NotFoundError(
|
|
346
|
+
headers=dict(_response.headers),
|
|
347
|
+
body=typing.cast(
|
|
348
|
+
NotFound,
|
|
349
|
+
construct_type(
|
|
350
|
+
type_=NotFound, # type: ignore
|
|
351
|
+
object_=_response.json(),
|
|
352
|
+
),
|
|
353
|
+
),
|
|
354
|
+
)
|
|
355
|
+
if _response.status_code == 422:
|
|
356
|
+
raise UnprocessableEntityError(
|
|
357
|
+
headers=dict(_response.headers),
|
|
358
|
+
body=typing.cast(
|
|
359
|
+
typing.Any,
|
|
360
|
+
construct_type(
|
|
361
|
+
type_=typing.Any, # type: ignore
|
|
362
|
+
object_=_response.json(),
|
|
363
|
+
),
|
|
364
|
+
),
|
|
365
|
+
)
|
|
366
|
+
if _response.status_code == 429:
|
|
367
|
+
raise TooManyRequestsError(
|
|
368
|
+
headers=dict(_response.headers),
|
|
369
|
+
body=typing.cast(
|
|
370
|
+
TooManyRequests,
|
|
371
|
+
construct_type(
|
|
372
|
+
type_=TooManyRequests, # type: ignore
|
|
373
|
+
object_=_response.json(),
|
|
374
|
+
),
|
|
375
|
+
),
|
|
376
|
+
)
|
|
377
|
+
_response_json = _response.json()
|
|
378
|
+
except JSONDecodeError:
|
|
379
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
380
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
381
|
+
|
|
382
|
+
def list_reviewers(
|
|
383
|
+
self,
|
|
384
|
+
account_id: Uuid,
|
|
385
|
+
share_id: Uuid,
|
|
386
|
+
*,
|
|
387
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
388
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
389
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
390
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
391
|
+
) -> SyncPager[User, ShareReviewersResponse]:
|
|
392
|
+
"""
|
|
393
|
+
List share reviewers. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
394
|
+
|
|
395
|
+
Parameters
|
|
396
|
+
----------
|
|
397
|
+
account_id : Uuid
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
share_id : Uuid
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
404
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
405
|
+
<br/>
|
|
406
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
407
|
+
|
|
408
|
+
page_size : typing.Optional[RequestPageSize]
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
request_options : typing.Optional[RequestOptions]
|
|
415
|
+
Request-specific configuration.
|
|
416
|
+
|
|
417
|
+
Returns
|
|
418
|
+
-------
|
|
419
|
+
SyncPager[User, ShareReviewersResponse]
|
|
420
|
+
OK
|
|
421
|
+
"""
|
|
422
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
423
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/reviewers",
|
|
424
|
+
method="GET",
|
|
425
|
+
params={
|
|
426
|
+
"after": after,
|
|
427
|
+
"page_size": page_size,
|
|
428
|
+
"include_total_count": include_total_count,
|
|
429
|
+
},
|
|
430
|
+
request_options=request_options,
|
|
431
|
+
)
|
|
432
|
+
try:
|
|
433
|
+
if 200 <= _response.status_code < 300:
|
|
434
|
+
_parsed_response = typing.cast(
|
|
435
|
+
ShareReviewersResponse,
|
|
436
|
+
construct_type(
|
|
437
|
+
type_=ShareReviewersResponse, # type: ignore
|
|
438
|
+
object_=_response.json(),
|
|
439
|
+
),
|
|
440
|
+
)
|
|
441
|
+
_items = _parsed_response.data
|
|
442
|
+
_has_next = False
|
|
443
|
+
_get_next = None
|
|
444
|
+
if _parsed_response.links is not None:
|
|
445
|
+
_parsed_next = _parsed_response.links.next
|
|
446
|
+
_has_next = _parsed_next is not None and _parsed_next != ""
|
|
447
|
+
_get_next = lambda: self.list_reviewers(
|
|
448
|
+
account_id,
|
|
449
|
+
share_id,
|
|
450
|
+
after=_parsed_next,
|
|
451
|
+
page_size=page_size,
|
|
452
|
+
include_total_count=include_total_count,
|
|
453
|
+
request_options=request_options,
|
|
454
|
+
)
|
|
455
|
+
return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
|
|
456
|
+
if _response.status_code == 400:
|
|
457
|
+
raise BadRequestError(
|
|
458
|
+
headers=dict(_response.headers),
|
|
459
|
+
body=typing.cast(
|
|
460
|
+
BadRequest,
|
|
461
|
+
construct_type(
|
|
462
|
+
type_=BadRequest, # type: ignore
|
|
463
|
+
object_=_response.json(),
|
|
464
|
+
),
|
|
465
|
+
),
|
|
466
|
+
)
|
|
467
|
+
if _response.status_code == 401:
|
|
468
|
+
raise UnauthorizedError(
|
|
469
|
+
headers=dict(_response.headers),
|
|
470
|
+
body=typing.cast(
|
|
471
|
+
Unauthorized,
|
|
472
|
+
construct_type(
|
|
473
|
+
type_=Unauthorized, # type: ignore
|
|
474
|
+
object_=_response.json(),
|
|
475
|
+
),
|
|
476
|
+
),
|
|
477
|
+
)
|
|
478
|
+
if _response.status_code == 403:
|
|
479
|
+
raise ForbiddenError(
|
|
480
|
+
headers=dict(_response.headers),
|
|
481
|
+
body=typing.cast(
|
|
482
|
+
Forbidden,
|
|
483
|
+
construct_type(
|
|
484
|
+
type_=Forbidden, # type: ignore
|
|
485
|
+
object_=_response.json(),
|
|
486
|
+
),
|
|
487
|
+
),
|
|
488
|
+
)
|
|
489
|
+
if _response.status_code == 404:
|
|
490
|
+
raise NotFoundError(
|
|
491
|
+
headers=dict(_response.headers),
|
|
492
|
+
body=typing.cast(
|
|
493
|
+
NotFound,
|
|
494
|
+
construct_type(
|
|
495
|
+
type_=NotFound, # type: ignore
|
|
496
|
+
object_=_response.json(),
|
|
497
|
+
),
|
|
498
|
+
),
|
|
499
|
+
)
|
|
500
|
+
if _response.status_code == 422:
|
|
501
|
+
raise UnprocessableEntityError(
|
|
502
|
+
headers=dict(_response.headers),
|
|
503
|
+
body=typing.cast(
|
|
504
|
+
typing.Any,
|
|
505
|
+
construct_type(
|
|
506
|
+
type_=typing.Any, # type: ignore
|
|
507
|
+
object_=_response.json(),
|
|
508
|
+
),
|
|
509
|
+
),
|
|
510
|
+
)
|
|
511
|
+
if _response.status_code == 429:
|
|
512
|
+
raise TooManyRequestsError(
|
|
513
|
+
headers=dict(_response.headers),
|
|
514
|
+
body=typing.cast(
|
|
515
|
+
TooManyRequests,
|
|
516
|
+
construct_type(
|
|
517
|
+
type_=TooManyRequests, # type: ignore
|
|
518
|
+
object_=_response.json(),
|
|
519
|
+
),
|
|
520
|
+
),
|
|
521
|
+
)
|
|
522
|
+
_response_json = _response.json()
|
|
523
|
+
except JSONDecodeError:
|
|
524
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
525
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
526
|
+
|
|
527
|
+
def add_reviewers(
|
|
528
|
+
self,
|
|
529
|
+
account_id: Uuid,
|
|
530
|
+
share_id: Uuid,
|
|
531
|
+
*,
|
|
532
|
+
data: AddReviewersToShareParamsData,
|
|
533
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
534
|
+
) -> HttpResponse[None]:
|
|
535
|
+
"""
|
|
536
|
+
Add reviewers to secure share by three identifier types: `adobe_user_id`, `email`, and `user_id`.
|
|
537
|
+
<br>
|
|
538
|
+
A request can only include one identifier type parameter.
|
|
539
|
+
<br>
|
|
540
|
+
`email` is the only identifier able to add reviewers to a Share who don't have a Frame account member on the account where the Share belongs.
|
|
541
|
+
<br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
542
|
+
|
|
543
|
+
Parameters
|
|
544
|
+
----------
|
|
545
|
+
account_id : Uuid
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
share_id : Uuid
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
data : AddReviewersToShareParamsData
|
|
552
|
+
|
|
553
|
+
request_options : typing.Optional[RequestOptions]
|
|
554
|
+
Request-specific configuration.
|
|
555
|
+
|
|
556
|
+
Returns
|
|
557
|
+
-------
|
|
558
|
+
HttpResponse[None]
|
|
559
|
+
"""
|
|
560
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
561
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/reviewers",
|
|
562
|
+
method="POST",
|
|
563
|
+
json={
|
|
564
|
+
"data": convert_and_respect_annotation_metadata(
|
|
565
|
+
object_=data, annotation=AddReviewersToShareParamsData, direction="write"
|
|
566
|
+
),
|
|
567
|
+
},
|
|
568
|
+
headers={
|
|
569
|
+
"content-type": "application/json",
|
|
570
|
+
},
|
|
571
|
+
request_options=request_options,
|
|
572
|
+
omit=OMIT,
|
|
573
|
+
)
|
|
574
|
+
try:
|
|
575
|
+
if 200 <= _response.status_code < 300:
|
|
576
|
+
return HttpResponse(response=_response, data=None)
|
|
577
|
+
if _response.status_code == 400:
|
|
578
|
+
raise BadRequestError(
|
|
579
|
+
headers=dict(_response.headers),
|
|
580
|
+
body=typing.cast(
|
|
581
|
+
BadRequest,
|
|
582
|
+
construct_type(
|
|
583
|
+
type_=BadRequest, # type: ignore
|
|
584
|
+
object_=_response.json(),
|
|
585
|
+
),
|
|
586
|
+
),
|
|
587
|
+
)
|
|
588
|
+
if _response.status_code == 401:
|
|
589
|
+
raise UnauthorizedError(
|
|
590
|
+
headers=dict(_response.headers),
|
|
591
|
+
body=typing.cast(
|
|
592
|
+
Unauthorized,
|
|
593
|
+
construct_type(
|
|
594
|
+
type_=Unauthorized, # type: ignore
|
|
595
|
+
object_=_response.json(),
|
|
596
|
+
),
|
|
597
|
+
),
|
|
598
|
+
)
|
|
599
|
+
if _response.status_code == 403:
|
|
600
|
+
raise ForbiddenError(
|
|
601
|
+
headers=dict(_response.headers),
|
|
602
|
+
body=typing.cast(
|
|
603
|
+
Forbidden,
|
|
604
|
+
construct_type(
|
|
605
|
+
type_=Forbidden, # type: ignore
|
|
606
|
+
object_=_response.json(),
|
|
607
|
+
),
|
|
608
|
+
),
|
|
609
|
+
)
|
|
610
|
+
if _response.status_code == 404:
|
|
611
|
+
raise NotFoundError(
|
|
612
|
+
headers=dict(_response.headers),
|
|
613
|
+
body=typing.cast(
|
|
614
|
+
NotFound,
|
|
615
|
+
construct_type(
|
|
616
|
+
type_=NotFound, # type: ignore
|
|
617
|
+
object_=_response.json(),
|
|
618
|
+
),
|
|
619
|
+
),
|
|
620
|
+
)
|
|
621
|
+
if _response.status_code == 422:
|
|
622
|
+
raise UnprocessableEntityError(
|
|
623
|
+
headers=dict(_response.headers),
|
|
624
|
+
body=typing.cast(
|
|
625
|
+
typing.Any,
|
|
626
|
+
construct_type(
|
|
627
|
+
type_=typing.Any, # type: ignore
|
|
628
|
+
object_=_response.json(),
|
|
629
|
+
),
|
|
630
|
+
),
|
|
631
|
+
)
|
|
632
|
+
if _response.status_code == 429:
|
|
633
|
+
raise TooManyRequestsError(
|
|
634
|
+
headers=dict(_response.headers),
|
|
635
|
+
body=typing.cast(
|
|
636
|
+
TooManyRequests,
|
|
637
|
+
construct_type(
|
|
638
|
+
type_=TooManyRequests, # type: ignore
|
|
639
|
+
object_=_response.json(),
|
|
640
|
+
),
|
|
641
|
+
),
|
|
642
|
+
)
|
|
643
|
+
_response_json = _response.json()
|
|
644
|
+
except JSONDecodeError:
|
|
645
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
646
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
647
|
+
|
|
648
|
+
def remove_reviewers(
|
|
649
|
+
self,
|
|
650
|
+
account_id: Uuid,
|
|
651
|
+
share_id: Uuid,
|
|
652
|
+
*,
|
|
653
|
+
data: RemoveReviewerParamsData,
|
|
654
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
655
|
+
) -> HttpResponse[None]:
|
|
656
|
+
"""
|
|
657
|
+
Removes reviewers from secure Share by three identifier types: `adobe_user_id`, `email`, and `user_id`.
|
|
658
|
+
<br>
|
|
659
|
+
A request can only include one identifier type parameter.
|
|
660
|
+
<br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
661
|
+
|
|
662
|
+
Parameters
|
|
663
|
+
----------
|
|
664
|
+
account_id : Uuid
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
share_id : Uuid
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
data : RemoveReviewerParamsData
|
|
671
|
+
|
|
672
|
+
request_options : typing.Optional[RequestOptions]
|
|
673
|
+
Request-specific configuration.
|
|
674
|
+
|
|
675
|
+
Returns
|
|
676
|
+
-------
|
|
677
|
+
HttpResponse[None]
|
|
678
|
+
"""
|
|
679
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
680
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/reviewers",
|
|
681
|
+
method="DELETE",
|
|
682
|
+
json={
|
|
683
|
+
"data": convert_and_respect_annotation_metadata(
|
|
684
|
+
object_=data, annotation=RemoveReviewerParamsData, direction="write"
|
|
685
|
+
),
|
|
686
|
+
},
|
|
687
|
+
headers={
|
|
688
|
+
"content-type": "application/json",
|
|
689
|
+
},
|
|
690
|
+
request_options=request_options,
|
|
691
|
+
omit=OMIT,
|
|
692
|
+
)
|
|
693
|
+
try:
|
|
694
|
+
if 200 <= _response.status_code < 300:
|
|
695
|
+
return HttpResponse(response=_response, data=None)
|
|
696
|
+
if _response.status_code == 400:
|
|
697
|
+
raise BadRequestError(
|
|
698
|
+
headers=dict(_response.headers),
|
|
699
|
+
body=typing.cast(
|
|
700
|
+
BadRequest,
|
|
701
|
+
construct_type(
|
|
702
|
+
type_=BadRequest, # type: ignore
|
|
703
|
+
object_=_response.json(),
|
|
704
|
+
),
|
|
705
|
+
),
|
|
706
|
+
)
|
|
707
|
+
if _response.status_code == 401:
|
|
708
|
+
raise UnauthorizedError(
|
|
709
|
+
headers=dict(_response.headers),
|
|
710
|
+
body=typing.cast(
|
|
711
|
+
Unauthorized,
|
|
712
|
+
construct_type(
|
|
713
|
+
type_=Unauthorized, # type: ignore
|
|
714
|
+
object_=_response.json(),
|
|
715
|
+
),
|
|
716
|
+
),
|
|
717
|
+
)
|
|
718
|
+
if _response.status_code == 403:
|
|
719
|
+
raise ForbiddenError(
|
|
720
|
+
headers=dict(_response.headers),
|
|
721
|
+
body=typing.cast(
|
|
722
|
+
Forbidden,
|
|
723
|
+
construct_type(
|
|
724
|
+
type_=Forbidden, # type: ignore
|
|
725
|
+
object_=_response.json(),
|
|
726
|
+
),
|
|
727
|
+
),
|
|
728
|
+
)
|
|
729
|
+
if _response.status_code == 404:
|
|
730
|
+
raise NotFoundError(
|
|
731
|
+
headers=dict(_response.headers),
|
|
732
|
+
body=typing.cast(
|
|
733
|
+
NotFound,
|
|
734
|
+
construct_type(
|
|
735
|
+
type_=NotFound, # type: ignore
|
|
736
|
+
object_=_response.json(),
|
|
737
|
+
),
|
|
738
|
+
),
|
|
739
|
+
)
|
|
740
|
+
if _response.status_code == 422:
|
|
741
|
+
raise UnprocessableEntityError(
|
|
742
|
+
headers=dict(_response.headers),
|
|
743
|
+
body=typing.cast(
|
|
744
|
+
typing.Any,
|
|
745
|
+
construct_type(
|
|
746
|
+
type_=typing.Any, # type: ignore
|
|
747
|
+
object_=_response.json(),
|
|
748
|
+
),
|
|
749
|
+
),
|
|
750
|
+
)
|
|
751
|
+
if _response.status_code == 429:
|
|
752
|
+
raise TooManyRequestsError(
|
|
753
|
+
headers=dict(_response.headers),
|
|
754
|
+
body=typing.cast(
|
|
755
|
+
TooManyRequests,
|
|
756
|
+
construct_type(
|
|
757
|
+
type_=TooManyRequests, # type: ignore
|
|
758
|
+
object_=_response.json(),
|
|
759
|
+
),
|
|
760
|
+
),
|
|
761
|
+
)
|
|
762
|
+
_response_json = _response.json()
|
|
763
|
+
except JSONDecodeError:
|
|
764
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
765
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
766
|
+
|
|
767
|
+
def remove_asset(
|
|
768
|
+
self,
|
|
769
|
+
account_id: Uuid,
|
|
770
|
+
share_id: Uuid,
|
|
771
|
+
asset_id: Uuid,
|
|
772
|
+
*,
|
|
773
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
774
|
+
) -> HttpResponse[RemoveAssetResponse]:
|
|
775
|
+
"""
|
|
776
|
+
Remove an asset currently in the share from that share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
777
|
+
|
|
778
|
+
Parameters
|
|
779
|
+
----------
|
|
780
|
+
account_id : Uuid
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
share_id : Uuid
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
asset_id : Uuid
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
request_options : typing.Optional[RequestOptions]
|
|
790
|
+
Request-specific configuration.
|
|
791
|
+
|
|
792
|
+
Returns
|
|
793
|
+
-------
|
|
794
|
+
HttpResponse[RemoveAssetResponse]
|
|
795
|
+
OK
|
|
796
|
+
"""
|
|
797
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
798
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/assets/{jsonable_encoder(asset_id)}",
|
|
799
|
+
method="DELETE",
|
|
800
|
+
request_options=request_options,
|
|
801
|
+
)
|
|
802
|
+
try:
|
|
803
|
+
if 200 <= _response.status_code < 300:
|
|
804
|
+
_data = typing.cast(
|
|
805
|
+
RemoveAssetResponse,
|
|
806
|
+
construct_type(
|
|
807
|
+
type_=RemoveAssetResponse, # type: ignore
|
|
808
|
+
object_=_response.json(),
|
|
809
|
+
),
|
|
810
|
+
)
|
|
811
|
+
return HttpResponse(response=_response, data=_data)
|
|
812
|
+
if _response.status_code == 400:
|
|
813
|
+
raise BadRequestError(
|
|
814
|
+
headers=dict(_response.headers),
|
|
815
|
+
body=typing.cast(
|
|
816
|
+
BadRequest,
|
|
817
|
+
construct_type(
|
|
818
|
+
type_=BadRequest, # type: ignore
|
|
819
|
+
object_=_response.json(),
|
|
820
|
+
),
|
|
821
|
+
),
|
|
822
|
+
)
|
|
823
|
+
if _response.status_code == 401:
|
|
824
|
+
raise UnauthorizedError(
|
|
825
|
+
headers=dict(_response.headers),
|
|
826
|
+
body=typing.cast(
|
|
827
|
+
Unauthorized,
|
|
828
|
+
construct_type(
|
|
829
|
+
type_=Unauthorized, # type: ignore
|
|
830
|
+
object_=_response.json(),
|
|
831
|
+
),
|
|
832
|
+
),
|
|
833
|
+
)
|
|
834
|
+
if _response.status_code == 403:
|
|
835
|
+
raise ForbiddenError(
|
|
836
|
+
headers=dict(_response.headers),
|
|
837
|
+
body=typing.cast(
|
|
838
|
+
Forbidden,
|
|
839
|
+
construct_type(
|
|
840
|
+
type_=Forbidden, # type: ignore
|
|
841
|
+
object_=_response.json(),
|
|
842
|
+
),
|
|
843
|
+
),
|
|
844
|
+
)
|
|
845
|
+
if _response.status_code == 404:
|
|
846
|
+
raise NotFoundError(
|
|
847
|
+
headers=dict(_response.headers),
|
|
848
|
+
body=typing.cast(
|
|
849
|
+
NotFound,
|
|
850
|
+
construct_type(
|
|
851
|
+
type_=NotFound, # type: ignore
|
|
852
|
+
object_=_response.json(),
|
|
853
|
+
),
|
|
854
|
+
),
|
|
855
|
+
)
|
|
856
|
+
if _response.status_code == 422:
|
|
857
|
+
raise UnprocessableEntityError(
|
|
858
|
+
headers=dict(_response.headers),
|
|
859
|
+
body=typing.cast(
|
|
860
|
+
typing.Any,
|
|
861
|
+
construct_type(
|
|
862
|
+
type_=typing.Any, # type: ignore
|
|
863
|
+
object_=_response.json(),
|
|
864
|
+
),
|
|
865
|
+
),
|
|
866
|
+
)
|
|
867
|
+
if _response.status_code == 429:
|
|
868
|
+
raise TooManyRequestsError(
|
|
869
|
+
headers=dict(_response.headers),
|
|
870
|
+
body=typing.cast(
|
|
871
|
+
TooManyRequests,
|
|
872
|
+
construct_type(
|
|
873
|
+
type_=TooManyRequests, # type: ignore
|
|
874
|
+
object_=_response.json(),
|
|
875
|
+
),
|
|
876
|
+
),
|
|
877
|
+
)
|
|
878
|
+
_response_json = _response.json()
|
|
879
|
+
except JSONDecodeError:
|
|
880
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
881
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
882
|
+
|
|
883
|
+
def add_asset(
|
|
884
|
+
self,
|
|
885
|
+
account_id: Uuid,
|
|
886
|
+
share_id: Uuid,
|
|
887
|
+
*,
|
|
888
|
+
data: AddAssetParamsData,
|
|
889
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
890
|
+
) -> HttpResponse[AddAssetResponse]:
|
|
891
|
+
"""
|
|
892
|
+
Add new asset share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
893
|
+
|
|
894
|
+
Parameters
|
|
895
|
+
----------
|
|
896
|
+
account_id : Uuid
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
share_id : Uuid
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
data : AddAssetParamsData
|
|
903
|
+
|
|
904
|
+
request_options : typing.Optional[RequestOptions]
|
|
905
|
+
Request-specific configuration.
|
|
906
|
+
|
|
907
|
+
Returns
|
|
908
|
+
-------
|
|
909
|
+
HttpResponse[AddAssetResponse]
|
|
910
|
+
OK
|
|
911
|
+
"""
|
|
912
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
913
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/assets",
|
|
914
|
+
method="POST",
|
|
915
|
+
json={
|
|
916
|
+
"data": convert_and_respect_annotation_metadata(
|
|
917
|
+
object_=data, annotation=AddAssetParamsData, direction="write"
|
|
918
|
+
),
|
|
919
|
+
},
|
|
920
|
+
headers={
|
|
921
|
+
"content-type": "application/json",
|
|
922
|
+
},
|
|
923
|
+
request_options=request_options,
|
|
924
|
+
omit=OMIT,
|
|
925
|
+
)
|
|
926
|
+
try:
|
|
927
|
+
if 200 <= _response.status_code < 300:
|
|
928
|
+
_data = typing.cast(
|
|
929
|
+
AddAssetResponse,
|
|
930
|
+
construct_type(
|
|
931
|
+
type_=AddAssetResponse, # type: ignore
|
|
932
|
+
object_=_response.json(),
|
|
933
|
+
),
|
|
934
|
+
)
|
|
935
|
+
return HttpResponse(response=_response, data=_data)
|
|
936
|
+
if _response.status_code == 400:
|
|
937
|
+
raise BadRequestError(
|
|
938
|
+
headers=dict(_response.headers),
|
|
939
|
+
body=typing.cast(
|
|
940
|
+
BadRequest,
|
|
941
|
+
construct_type(
|
|
942
|
+
type_=BadRequest, # type: ignore
|
|
943
|
+
object_=_response.json(),
|
|
944
|
+
),
|
|
945
|
+
),
|
|
946
|
+
)
|
|
947
|
+
if _response.status_code == 401:
|
|
948
|
+
raise UnauthorizedError(
|
|
949
|
+
headers=dict(_response.headers),
|
|
950
|
+
body=typing.cast(
|
|
951
|
+
Unauthorized,
|
|
952
|
+
construct_type(
|
|
953
|
+
type_=Unauthorized, # type: ignore
|
|
954
|
+
object_=_response.json(),
|
|
955
|
+
),
|
|
956
|
+
),
|
|
957
|
+
)
|
|
958
|
+
if _response.status_code == 403:
|
|
959
|
+
raise ForbiddenError(
|
|
960
|
+
headers=dict(_response.headers),
|
|
961
|
+
body=typing.cast(
|
|
962
|
+
Forbidden,
|
|
963
|
+
construct_type(
|
|
964
|
+
type_=Forbidden, # type: ignore
|
|
965
|
+
object_=_response.json(),
|
|
966
|
+
),
|
|
967
|
+
),
|
|
968
|
+
)
|
|
969
|
+
if _response.status_code == 404:
|
|
970
|
+
raise NotFoundError(
|
|
971
|
+
headers=dict(_response.headers),
|
|
972
|
+
body=typing.cast(
|
|
973
|
+
NotFound,
|
|
974
|
+
construct_type(
|
|
975
|
+
type_=NotFound, # type: ignore
|
|
976
|
+
object_=_response.json(),
|
|
977
|
+
),
|
|
978
|
+
),
|
|
979
|
+
)
|
|
980
|
+
if _response.status_code == 422:
|
|
981
|
+
raise UnprocessableEntityError(
|
|
982
|
+
headers=dict(_response.headers),
|
|
983
|
+
body=typing.cast(
|
|
984
|
+
typing.Any,
|
|
985
|
+
construct_type(
|
|
986
|
+
type_=typing.Any, # type: ignore
|
|
987
|
+
object_=_response.json(),
|
|
988
|
+
),
|
|
989
|
+
),
|
|
990
|
+
)
|
|
991
|
+
if _response.status_code == 429:
|
|
992
|
+
raise TooManyRequestsError(
|
|
993
|
+
headers=dict(_response.headers),
|
|
994
|
+
body=typing.cast(
|
|
995
|
+
TooManyRequests,
|
|
996
|
+
construct_type(
|
|
997
|
+
type_=TooManyRequests, # type: ignore
|
|
998
|
+
object_=_response.json(),
|
|
999
|
+
),
|
|
1000
|
+
),
|
|
1001
|
+
)
|
|
1002
|
+
_response_json = _response.json()
|
|
1003
|
+
except JSONDecodeError:
|
|
1004
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1005
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1006
|
+
|
|
1007
|
+
def index(
|
|
1008
|
+
self,
|
|
1009
|
+
account_id: Uuid,
|
|
1010
|
+
project_id: Uuid,
|
|
1011
|
+
*,
|
|
1012
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
1013
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
1014
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
1015
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1016
|
+
) -> SyncPager[Share, SharesResponse]:
|
|
1017
|
+
"""
|
|
1018
|
+
List shares on a project. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
1019
|
+
|
|
1020
|
+
Parameters
|
|
1021
|
+
----------
|
|
1022
|
+
account_id : Uuid
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
project_id : Uuid
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
1029
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
1030
|
+
<br/>
|
|
1031
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
1032
|
+
|
|
1033
|
+
page_size : typing.Optional[RequestPageSize]
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
request_options : typing.Optional[RequestOptions]
|
|
1040
|
+
Request-specific configuration.
|
|
1041
|
+
|
|
1042
|
+
Returns
|
|
1043
|
+
-------
|
|
1044
|
+
SyncPager[Share, SharesResponse]
|
|
1045
|
+
OK
|
|
1046
|
+
"""
|
|
1047
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1048
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}/shares",
|
|
1049
|
+
method="GET",
|
|
1050
|
+
params={
|
|
1051
|
+
"after": after,
|
|
1052
|
+
"page_size": page_size,
|
|
1053
|
+
"include_total_count": include_total_count,
|
|
1054
|
+
},
|
|
1055
|
+
request_options=request_options,
|
|
1056
|
+
)
|
|
1057
|
+
try:
|
|
1058
|
+
if 200 <= _response.status_code < 300:
|
|
1059
|
+
_parsed_response = typing.cast(
|
|
1060
|
+
SharesResponse,
|
|
1061
|
+
construct_type(
|
|
1062
|
+
type_=SharesResponse, # type: ignore
|
|
1063
|
+
object_=_response.json(),
|
|
1064
|
+
),
|
|
1065
|
+
)
|
|
1066
|
+
_items = _parsed_response.data
|
|
1067
|
+
_has_next = False
|
|
1068
|
+
_get_next = None
|
|
1069
|
+
if _parsed_response.links is not None:
|
|
1070
|
+
_parsed_next = _parsed_response.links.next
|
|
1071
|
+
_has_next = _parsed_next is not None and _parsed_next != ""
|
|
1072
|
+
_get_next = lambda: self.index(
|
|
1073
|
+
account_id,
|
|
1074
|
+
project_id,
|
|
1075
|
+
after=_parsed_next,
|
|
1076
|
+
page_size=page_size,
|
|
1077
|
+
include_total_count=include_total_count,
|
|
1078
|
+
request_options=request_options,
|
|
1079
|
+
)
|
|
1080
|
+
return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
|
|
1081
|
+
if _response.status_code == 400:
|
|
1082
|
+
raise BadRequestError(
|
|
1083
|
+
headers=dict(_response.headers),
|
|
1084
|
+
body=typing.cast(
|
|
1085
|
+
BadRequest,
|
|
1086
|
+
construct_type(
|
|
1087
|
+
type_=BadRequest, # type: ignore
|
|
1088
|
+
object_=_response.json(),
|
|
1089
|
+
),
|
|
1090
|
+
),
|
|
1091
|
+
)
|
|
1092
|
+
if _response.status_code == 401:
|
|
1093
|
+
raise UnauthorizedError(
|
|
1094
|
+
headers=dict(_response.headers),
|
|
1095
|
+
body=typing.cast(
|
|
1096
|
+
Unauthorized,
|
|
1097
|
+
construct_type(
|
|
1098
|
+
type_=Unauthorized, # type: ignore
|
|
1099
|
+
object_=_response.json(),
|
|
1100
|
+
),
|
|
1101
|
+
),
|
|
1102
|
+
)
|
|
1103
|
+
if _response.status_code == 403:
|
|
1104
|
+
raise ForbiddenError(
|
|
1105
|
+
headers=dict(_response.headers),
|
|
1106
|
+
body=typing.cast(
|
|
1107
|
+
Forbidden,
|
|
1108
|
+
construct_type(
|
|
1109
|
+
type_=Forbidden, # type: ignore
|
|
1110
|
+
object_=_response.json(),
|
|
1111
|
+
),
|
|
1112
|
+
),
|
|
1113
|
+
)
|
|
1114
|
+
if _response.status_code == 404:
|
|
1115
|
+
raise NotFoundError(
|
|
1116
|
+
headers=dict(_response.headers),
|
|
1117
|
+
body=typing.cast(
|
|
1118
|
+
NotFound,
|
|
1119
|
+
construct_type(
|
|
1120
|
+
type_=NotFound, # type: ignore
|
|
1121
|
+
object_=_response.json(),
|
|
1122
|
+
),
|
|
1123
|
+
),
|
|
1124
|
+
)
|
|
1125
|
+
if _response.status_code == 422:
|
|
1126
|
+
raise UnprocessableEntityError(
|
|
1127
|
+
headers=dict(_response.headers),
|
|
1128
|
+
body=typing.cast(
|
|
1129
|
+
typing.Any,
|
|
1130
|
+
construct_type(
|
|
1131
|
+
type_=typing.Any, # type: ignore
|
|
1132
|
+
object_=_response.json(),
|
|
1133
|
+
),
|
|
1134
|
+
),
|
|
1135
|
+
)
|
|
1136
|
+
if _response.status_code == 429:
|
|
1137
|
+
raise TooManyRequestsError(
|
|
1138
|
+
headers=dict(_response.headers),
|
|
1139
|
+
body=typing.cast(
|
|
1140
|
+
TooManyRequests,
|
|
1141
|
+
construct_type(
|
|
1142
|
+
type_=TooManyRequests, # type: ignore
|
|
1143
|
+
object_=_response.json(),
|
|
1144
|
+
),
|
|
1145
|
+
),
|
|
1146
|
+
)
|
|
1147
|
+
_response_json = _response.json()
|
|
1148
|
+
except JSONDecodeError:
|
|
1149
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1150
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1151
|
+
|
|
1152
|
+
def create(
|
|
1153
|
+
self,
|
|
1154
|
+
account_id: Uuid,
|
|
1155
|
+
project_id: Uuid,
|
|
1156
|
+
*,
|
|
1157
|
+
data: CreateShareParamsData,
|
|
1158
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1159
|
+
) -> HttpResponse[ShareResponse]:
|
|
1160
|
+
"""
|
|
1161
|
+
Create share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
1162
|
+
|
|
1163
|
+
Parameters
|
|
1164
|
+
----------
|
|
1165
|
+
account_id : Uuid
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
project_id : Uuid
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
data : CreateShareParamsData
|
|
1172
|
+
|
|
1173
|
+
request_options : typing.Optional[RequestOptions]
|
|
1174
|
+
Request-specific configuration.
|
|
1175
|
+
|
|
1176
|
+
Returns
|
|
1177
|
+
-------
|
|
1178
|
+
HttpResponse[ShareResponse]
|
|
1179
|
+
Created
|
|
1180
|
+
"""
|
|
1181
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1182
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}/shares",
|
|
1183
|
+
method="POST",
|
|
1184
|
+
json={
|
|
1185
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1186
|
+
object_=data, annotation=CreateShareParamsData, direction="write"
|
|
1187
|
+
),
|
|
1188
|
+
},
|
|
1189
|
+
headers={
|
|
1190
|
+
"content-type": "application/json",
|
|
1191
|
+
},
|
|
1192
|
+
request_options=request_options,
|
|
1193
|
+
omit=OMIT,
|
|
1194
|
+
)
|
|
1195
|
+
try:
|
|
1196
|
+
if 200 <= _response.status_code < 300:
|
|
1197
|
+
_data = typing.cast(
|
|
1198
|
+
ShareResponse,
|
|
1199
|
+
construct_type(
|
|
1200
|
+
type_=ShareResponse, # type: ignore
|
|
1201
|
+
object_=_response.json(),
|
|
1202
|
+
),
|
|
1203
|
+
)
|
|
1204
|
+
return HttpResponse(response=_response, data=_data)
|
|
1205
|
+
if _response.status_code == 400:
|
|
1206
|
+
raise BadRequestError(
|
|
1207
|
+
headers=dict(_response.headers),
|
|
1208
|
+
body=typing.cast(
|
|
1209
|
+
BadRequest,
|
|
1210
|
+
construct_type(
|
|
1211
|
+
type_=BadRequest, # type: ignore
|
|
1212
|
+
object_=_response.json(),
|
|
1213
|
+
),
|
|
1214
|
+
),
|
|
1215
|
+
)
|
|
1216
|
+
if _response.status_code == 401:
|
|
1217
|
+
raise UnauthorizedError(
|
|
1218
|
+
headers=dict(_response.headers),
|
|
1219
|
+
body=typing.cast(
|
|
1220
|
+
Unauthorized,
|
|
1221
|
+
construct_type(
|
|
1222
|
+
type_=Unauthorized, # type: ignore
|
|
1223
|
+
object_=_response.json(),
|
|
1224
|
+
),
|
|
1225
|
+
),
|
|
1226
|
+
)
|
|
1227
|
+
if _response.status_code == 403:
|
|
1228
|
+
raise ForbiddenError(
|
|
1229
|
+
headers=dict(_response.headers),
|
|
1230
|
+
body=typing.cast(
|
|
1231
|
+
Forbidden,
|
|
1232
|
+
construct_type(
|
|
1233
|
+
type_=Forbidden, # type: ignore
|
|
1234
|
+
object_=_response.json(),
|
|
1235
|
+
),
|
|
1236
|
+
),
|
|
1237
|
+
)
|
|
1238
|
+
if _response.status_code == 404:
|
|
1239
|
+
raise NotFoundError(
|
|
1240
|
+
headers=dict(_response.headers),
|
|
1241
|
+
body=typing.cast(
|
|
1242
|
+
NotFound,
|
|
1243
|
+
construct_type(
|
|
1244
|
+
type_=NotFound, # type: ignore
|
|
1245
|
+
object_=_response.json(),
|
|
1246
|
+
),
|
|
1247
|
+
),
|
|
1248
|
+
)
|
|
1249
|
+
if _response.status_code == 422:
|
|
1250
|
+
raise UnprocessableEntityError(
|
|
1251
|
+
headers=dict(_response.headers),
|
|
1252
|
+
body=typing.cast(
|
|
1253
|
+
typing.Any,
|
|
1254
|
+
construct_type(
|
|
1255
|
+
type_=typing.Any, # type: ignore
|
|
1256
|
+
object_=_response.json(),
|
|
1257
|
+
),
|
|
1258
|
+
),
|
|
1259
|
+
)
|
|
1260
|
+
if _response.status_code == 429:
|
|
1261
|
+
raise TooManyRequestsError(
|
|
1262
|
+
headers=dict(_response.headers),
|
|
1263
|
+
body=typing.cast(
|
|
1264
|
+
TooManyRequests,
|
|
1265
|
+
construct_type(
|
|
1266
|
+
type_=TooManyRequests, # type: ignore
|
|
1267
|
+
object_=_response.json(),
|
|
1268
|
+
),
|
|
1269
|
+
),
|
|
1270
|
+
)
|
|
1271
|
+
_response_json = _response.json()
|
|
1272
|
+
except JSONDecodeError:
|
|
1273
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1274
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
class AsyncRawSharesClient:
|
|
1278
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
1279
|
+
self._client_wrapper = client_wrapper
|
|
1280
|
+
|
|
1281
|
+
async def show(
|
|
1282
|
+
self, account_id: Uuid, share_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
|
|
1283
|
+
) -> AsyncHttpResponse[ShareResponse]:
|
|
1284
|
+
"""
|
|
1285
|
+
Show a single Share. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
1286
|
+
|
|
1287
|
+
Parameters
|
|
1288
|
+
----------
|
|
1289
|
+
account_id : Uuid
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
share_id : Uuid
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
request_options : typing.Optional[RequestOptions]
|
|
1296
|
+
Request-specific configuration.
|
|
1297
|
+
|
|
1298
|
+
Returns
|
|
1299
|
+
-------
|
|
1300
|
+
AsyncHttpResponse[ShareResponse]
|
|
1301
|
+
OK
|
|
1302
|
+
"""
|
|
1303
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1304
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}",
|
|
1305
|
+
method="GET",
|
|
1306
|
+
request_options=request_options,
|
|
1307
|
+
)
|
|
1308
|
+
try:
|
|
1309
|
+
if 200 <= _response.status_code < 300:
|
|
1310
|
+
_data = typing.cast(
|
|
1311
|
+
ShareResponse,
|
|
1312
|
+
construct_type(
|
|
1313
|
+
type_=ShareResponse, # type: ignore
|
|
1314
|
+
object_=_response.json(),
|
|
1315
|
+
),
|
|
1316
|
+
)
|
|
1317
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1318
|
+
if _response.status_code == 400:
|
|
1319
|
+
raise BadRequestError(
|
|
1320
|
+
headers=dict(_response.headers),
|
|
1321
|
+
body=typing.cast(
|
|
1322
|
+
BadRequest,
|
|
1323
|
+
construct_type(
|
|
1324
|
+
type_=BadRequest, # type: ignore
|
|
1325
|
+
object_=_response.json(),
|
|
1326
|
+
),
|
|
1327
|
+
),
|
|
1328
|
+
)
|
|
1329
|
+
if _response.status_code == 401:
|
|
1330
|
+
raise UnauthorizedError(
|
|
1331
|
+
headers=dict(_response.headers),
|
|
1332
|
+
body=typing.cast(
|
|
1333
|
+
Unauthorized,
|
|
1334
|
+
construct_type(
|
|
1335
|
+
type_=Unauthorized, # type: ignore
|
|
1336
|
+
object_=_response.json(),
|
|
1337
|
+
),
|
|
1338
|
+
),
|
|
1339
|
+
)
|
|
1340
|
+
if _response.status_code == 403:
|
|
1341
|
+
raise ForbiddenError(
|
|
1342
|
+
headers=dict(_response.headers),
|
|
1343
|
+
body=typing.cast(
|
|
1344
|
+
Forbidden,
|
|
1345
|
+
construct_type(
|
|
1346
|
+
type_=Forbidden, # type: ignore
|
|
1347
|
+
object_=_response.json(),
|
|
1348
|
+
),
|
|
1349
|
+
),
|
|
1350
|
+
)
|
|
1351
|
+
if _response.status_code == 404:
|
|
1352
|
+
raise NotFoundError(
|
|
1353
|
+
headers=dict(_response.headers),
|
|
1354
|
+
body=typing.cast(
|
|
1355
|
+
NotFound,
|
|
1356
|
+
construct_type(
|
|
1357
|
+
type_=NotFound, # type: ignore
|
|
1358
|
+
object_=_response.json(),
|
|
1359
|
+
),
|
|
1360
|
+
),
|
|
1361
|
+
)
|
|
1362
|
+
if _response.status_code == 422:
|
|
1363
|
+
raise UnprocessableEntityError(
|
|
1364
|
+
headers=dict(_response.headers),
|
|
1365
|
+
body=typing.cast(
|
|
1366
|
+
typing.Any,
|
|
1367
|
+
construct_type(
|
|
1368
|
+
type_=typing.Any, # type: ignore
|
|
1369
|
+
object_=_response.json(),
|
|
1370
|
+
),
|
|
1371
|
+
),
|
|
1372
|
+
)
|
|
1373
|
+
if _response.status_code == 429:
|
|
1374
|
+
raise TooManyRequestsError(
|
|
1375
|
+
headers=dict(_response.headers),
|
|
1376
|
+
body=typing.cast(
|
|
1377
|
+
TooManyRequests,
|
|
1378
|
+
construct_type(
|
|
1379
|
+
type_=TooManyRequests, # type: ignore
|
|
1380
|
+
object_=_response.json(),
|
|
1381
|
+
),
|
|
1382
|
+
),
|
|
1383
|
+
)
|
|
1384
|
+
_response_json = _response.json()
|
|
1385
|
+
except JSONDecodeError:
|
|
1386
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1387
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1388
|
+
|
|
1389
|
+
async def delete(
|
|
1390
|
+
self, account_id: Uuid, share_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
|
|
1391
|
+
) -> AsyncHttpResponse[None]:
|
|
1392
|
+
"""
|
|
1393
|
+
Delete a share. <br>Rate Limits: 60 calls per 1.00 minute(s) per account_user
|
|
1394
|
+
|
|
1395
|
+
Parameters
|
|
1396
|
+
----------
|
|
1397
|
+
account_id : Uuid
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
share_id : Uuid
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
request_options : typing.Optional[RequestOptions]
|
|
1404
|
+
Request-specific configuration.
|
|
1405
|
+
|
|
1406
|
+
Returns
|
|
1407
|
+
-------
|
|
1408
|
+
AsyncHttpResponse[None]
|
|
1409
|
+
"""
|
|
1410
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1411
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}",
|
|
1412
|
+
method="DELETE",
|
|
1413
|
+
request_options=request_options,
|
|
1414
|
+
)
|
|
1415
|
+
try:
|
|
1416
|
+
if 200 <= _response.status_code < 300:
|
|
1417
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
1418
|
+
if _response.status_code == 400:
|
|
1419
|
+
raise BadRequestError(
|
|
1420
|
+
headers=dict(_response.headers),
|
|
1421
|
+
body=typing.cast(
|
|
1422
|
+
BadRequest,
|
|
1423
|
+
construct_type(
|
|
1424
|
+
type_=BadRequest, # type: ignore
|
|
1425
|
+
object_=_response.json(),
|
|
1426
|
+
),
|
|
1427
|
+
),
|
|
1428
|
+
)
|
|
1429
|
+
if _response.status_code == 401:
|
|
1430
|
+
raise UnauthorizedError(
|
|
1431
|
+
headers=dict(_response.headers),
|
|
1432
|
+
body=typing.cast(
|
|
1433
|
+
Unauthorized,
|
|
1434
|
+
construct_type(
|
|
1435
|
+
type_=Unauthorized, # type: ignore
|
|
1436
|
+
object_=_response.json(),
|
|
1437
|
+
),
|
|
1438
|
+
),
|
|
1439
|
+
)
|
|
1440
|
+
if _response.status_code == 403:
|
|
1441
|
+
raise ForbiddenError(
|
|
1442
|
+
headers=dict(_response.headers),
|
|
1443
|
+
body=typing.cast(
|
|
1444
|
+
Forbidden,
|
|
1445
|
+
construct_type(
|
|
1446
|
+
type_=Forbidden, # type: ignore
|
|
1447
|
+
object_=_response.json(),
|
|
1448
|
+
),
|
|
1449
|
+
),
|
|
1450
|
+
)
|
|
1451
|
+
if _response.status_code == 404:
|
|
1452
|
+
raise NotFoundError(
|
|
1453
|
+
headers=dict(_response.headers),
|
|
1454
|
+
body=typing.cast(
|
|
1455
|
+
NotFound,
|
|
1456
|
+
construct_type(
|
|
1457
|
+
type_=NotFound, # type: ignore
|
|
1458
|
+
object_=_response.json(),
|
|
1459
|
+
),
|
|
1460
|
+
),
|
|
1461
|
+
)
|
|
1462
|
+
if _response.status_code == 422:
|
|
1463
|
+
raise UnprocessableEntityError(
|
|
1464
|
+
headers=dict(_response.headers),
|
|
1465
|
+
body=typing.cast(
|
|
1466
|
+
typing.Any,
|
|
1467
|
+
construct_type(
|
|
1468
|
+
type_=typing.Any, # type: ignore
|
|
1469
|
+
object_=_response.json(),
|
|
1470
|
+
),
|
|
1471
|
+
),
|
|
1472
|
+
)
|
|
1473
|
+
if _response.status_code == 429:
|
|
1474
|
+
raise TooManyRequestsError(
|
|
1475
|
+
headers=dict(_response.headers),
|
|
1476
|
+
body=typing.cast(
|
|
1477
|
+
TooManyRequests,
|
|
1478
|
+
construct_type(
|
|
1479
|
+
type_=TooManyRequests, # type: ignore
|
|
1480
|
+
object_=_response.json(),
|
|
1481
|
+
),
|
|
1482
|
+
),
|
|
1483
|
+
)
|
|
1484
|
+
_response_json = _response.json()
|
|
1485
|
+
except JSONDecodeError:
|
|
1486
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1487
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1488
|
+
|
|
1489
|
+
async def update(
|
|
1490
|
+
self,
|
|
1491
|
+
account_id: Uuid,
|
|
1492
|
+
share_id: Uuid,
|
|
1493
|
+
*,
|
|
1494
|
+
data: UpdateShareParamsData,
|
|
1495
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1496
|
+
) -> AsyncHttpResponse[ShareResponse]:
|
|
1497
|
+
"""
|
|
1498
|
+
Update share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
1499
|
+
|
|
1500
|
+
Parameters
|
|
1501
|
+
----------
|
|
1502
|
+
account_id : Uuid
|
|
1503
|
+
|
|
1504
|
+
|
|
1505
|
+
share_id : Uuid
|
|
1506
|
+
|
|
1507
|
+
|
|
1508
|
+
data : UpdateShareParamsData
|
|
1509
|
+
|
|
1510
|
+
request_options : typing.Optional[RequestOptions]
|
|
1511
|
+
Request-specific configuration.
|
|
1512
|
+
|
|
1513
|
+
Returns
|
|
1514
|
+
-------
|
|
1515
|
+
AsyncHttpResponse[ShareResponse]
|
|
1516
|
+
OK
|
|
1517
|
+
"""
|
|
1518
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1519
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}",
|
|
1520
|
+
method="PATCH",
|
|
1521
|
+
json={
|
|
1522
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1523
|
+
object_=data, annotation=UpdateShareParamsData, direction="write"
|
|
1524
|
+
),
|
|
1525
|
+
},
|
|
1526
|
+
headers={
|
|
1527
|
+
"content-type": "application/json",
|
|
1528
|
+
},
|
|
1529
|
+
request_options=request_options,
|
|
1530
|
+
omit=OMIT,
|
|
1531
|
+
)
|
|
1532
|
+
try:
|
|
1533
|
+
if 200 <= _response.status_code < 300:
|
|
1534
|
+
_data = typing.cast(
|
|
1535
|
+
ShareResponse,
|
|
1536
|
+
construct_type(
|
|
1537
|
+
type_=ShareResponse, # type: ignore
|
|
1538
|
+
object_=_response.json(),
|
|
1539
|
+
),
|
|
1540
|
+
)
|
|
1541
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1542
|
+
if _response.status_code == 400:
|
|
1543
|
+
raise BadRequestError(
|
|
1544
|
+
headers=dict(_response.headers),
|
|
1545
|
+
body=typing.cast(
|
|
1546
|
+
BadRequest,
|
|
1547
|
+
construct_type(
|
|
1548
|
+
type_=BadRequest, # type: ignore
|
|
1549
|
+
object_=_response.json(),
|
|
1550
|
+
),
|
|
1551
|
+
),
|
|
1552
|
+
)
|
|
1553
|
+
if _response.status_code == 401:
|
|
1554
|
+
raise UnauthorizedError(
|
|
1555
|
+
headers=dict(_response.headers),
|
|
1556
|
+
body=typing.cast(
|
|
1557
|
+
Unauthorized,
|
|
1558
|
+
construct_type(
|
|
1559
|
+
type_=Unauthorized, # type: ignore
|
|
1560
|
+
object_=_response.json(),
|
|
1561
|
+
),
|
|
1562
|
+
),
|
|
1563
|
+
)
|
|
1564
|
+
if _response.status_code == 403:
|
|
1565
|
+
raise ForbiddenError(
|
|
1566
|
+
headers=dict(_response.headers),
|
|
1567
|
+
body=typing.cast(
|
|
1568
|
+
Forbidden,
|
|
1569
|
+
construct_type(
|
|
1570
|
+
type_=Forbidden, # type: ignore
|
|
1571
|
+
object_=_response.json(),
|
|
1572
|
+
),
|
|
1573
|
+
),
|
|
1574
|
+
)
|
|
1575
|
+
if _response.status_code == 404:
|
|
1576
|
+
raise NotFoundError(
|
|
1577
|
+
headers=dict(_response.headers),
|
|
1578
|
+
body=typing.cast(
|
|
1579
|
+
NotFound,
|
|
1580
|
+
construct_type(
|
|
1581
|
+
type_=NotFound, # type: ignore
|
|
1582
|
+
object_=_response.json(),
|
|
1583
|
+
),
|
|
1584
|
+
),
|
|
1585
|
+
)
|
|
1586
|
+
if _response.status_code == 422:
|
|
1587
|
+
raise UnprocessableEntityError(
|
|
1588
|
+
headers=dict(_response.headers),
|
|
1589
|
+
body=typing.cast(
|
|
1590
|
+
typing.Any,
|
|
1591
|
+
construct_type(
|
|
1592
|
+
type_=typing.Any, # type: ignore
|
|
1593
|
+
object_=_response.json(),
|
|
1594
|
+
),
|
|
1595
|
+
),
|
|
1596
|
+
)
|
|
1597
|
+
if _response.status_code == 429:
|
|
1598
|
+
raise TooManyRequestsError(
|
|
1599
|
+
headers=dict(_response.headers),
|
|
1600
|
+
body=typing.cast(
|
|
1601
|
+
TooManyRequests,
|
|
1602
|
+
construct_type(
|
|
1603
|
+
type_=TooManyRequests, # type: ignore
|
|
1604
|
+
object_=_response.json(),
|
|
1605
|
+
),
|
|
1606
|
+
),
|
|
1607
|
+
)
|
|
1608
|
+
_response_json = _response.json()
|
|
1609
|
+
except JSONDecodeError:
|
|
1610
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1611
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1612
|
+
|
|
1613
|
+
async def list_reviewers(
|
|
1614
|
+
self,
|
|
1615
|
+
account_id: Uuid,
|
|
1616
|
+
share_id: Uuid,
|
|
1617
|
+
*,
|
|
1618
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
1619
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
1620
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
1621
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1622
|
+
) -> AsyncPager[User, ShareReviewersResponse]:
|
|
1623
|
+
"""
|
|
1624
|
+
List share reviewers. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
1625
|
+
|
|
1626
|
+
Parameters
|
|
1627
|
+
----------
|
|
1628
|
+
account_id : Uuid
|
|
1629
|
+
|
|
1630
|
+
|
|
1631
|
+
share_id : Uuid
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
1635
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
1636
|
+
<br/>
|
|
1637
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
1638
|
+
|
|
1639
|
+
page_size : typing.Optional[RequestPageSize]
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
request_options : typing.Optional[RequestOptions]
|
|
1646
|
+
Request-specific configuration.
|
|
1647
|
+
|
|
1648
|
+
Returns
|
|
1649
|
+
-------
|
|
1650
|
+
AsyncPager[User, ShareReviewersResponse]
|
|
1651
|
+
OK
|
|
1652
|
+
"""
|
|
1653
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1654
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/reviewers",
|
|
1655
|
+
method="GET",
|
|
1656
|
+
params={
|
|
1657
|
+
"after": after,
|
|
1658
|
+
"page_size": page_size,
|
|
1659
|
+
"include_total_count": include_total_count,
|
|
1660
|
+
},
|
|
1661
|
+
request_options=request_options,
|
|
1662
|
+
)
|
|
1663
|
+
try:
|
|
1664
|
+
if 200 <= _response.status_code < 300:
|
|
1665
|
+
_parsed_response = typing.cast(
|
|
1666
|
+
ShareReviewersResponse,
|
|
1667
|
+
construct_type(
|
|
1668
|
+
type_=ShareReviewersResponse, # type: ignore
|
|
1669
|
+
object_=_response.json(),
|
|
1670
|
+
),
|
|
1671
|
+
)
|
|
1672
|
+
_items = _parsed_response.data
|
|
1673
|
+
_has_next = False
|
|
1674
|
+
_get_next = None
|
|
1675
|
+
if _parsed_response.links is not None:
|
|
1676
|
+
_parsed_next = _parsed_response.links.next
|
|
1677
|
+
_has_next = _parsed_next is not None and _parsed_next != ""
|
|
1678
|
+
|
|
1679
|
+
async def _get_next():
|
|
1680
|
+
return await self.list_reviewers(
|
|
1681
|
+
account_id,
|
|
1682
|
+
share_id,
|
|
1683
|
+
after=_parsed_next,
|
|
1684
|
+
page_size=page_size,
|
|
1685
|
+
include_total_count=include_total_count,
|
|
1686
|
+
request_options=request_options,
|
|
1687
|
+
)
|
|
1688
|
+
|
|
1689
|
+
return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
|
|
1690
|
+
if _response.status_code == 400:
|
|
1691
|
+
raise BadRequestError(
|
|
1692
|
+
headers=dict(_response.headers),
|
|
1693
|
+
body=typing.cast(
|
|
1694
|
+
BadRequest,
|
|
1695
|
+
construct_type(
|
|
1696
|
+
type_=BadRequest, # type: ignore
|
|
1697
|
+
object_=_response.json(),
|
|
1698
|
+
),
|
|
1699
|
+
),
|
|
1700
|
+
)
|
|
1701
|
+
if _response.status_code == 401:
|
|
1702
|
+
raise UnauthorizedError(
|
|
1703
|
+
headers=dict(_response.headers),
|
|
1704
|
+
body=typing.cast(
|
|
1705
|
+
Unauthorized,
|
|
1706
|
+
construct_type(
|
|
1707
|
+
type_=Unauthorized, # type: ignore
|
|
1708
|
+
object_=_response.json(),
|
|
1709
|
+
),
|
|
1710
|
+
),
|
|
1711
|
+
)
|
|
1712
|
+
if _response.status_code == 403:
|
|
1713
|
+
raise ForbiddenError(
|
|
1714
|
+
headers=dict(_response.headers),
|
|
1715
|
+
body=typing.cast(
|
|
1716
|
+
Forbidden,
|
|
1717
|
+
construct_type(
|
|
1718
|
+
type_=Forbidden, # type: ignore
|
|
1719
|
+
object_=_response.json(),
|
|
1720
|
+
),
|
|
1721
|
+
),
|
|
1722
|
+
)
|
|
1723
|
+
if _response.status_code == 404:
|
|
1724
|
+
raise NotFoundError(
|
|
1725
|
+
headers=dict(_response.headers),
|
|
1726
|
+
body=typing.cast(
|
|
1727
|
+
NotFound,
|
|
1728
|
+
construct_type(
|
|
1729
|
+
type_=NotFound, # type: ignore
|
|
1730
|
+
object_=_response.json(),
|
|
1731
|
+
),
|
|
1732
|
+
),
|
|
1733
|
+
)
|
|
1734
|
+
if _response.status_code == 422:
|
|
1735
|
+
raise UnprocessableEntityError(
|
|
1736
|
+
headers=dict(_response.headers),
|
|
1737
|
+
body=typing.cast(
|
|
1738
|
+
typing.Any,
|
|
1739
|
+
construct_type(
|
|
1740
|
+
type_=typing.Any, # type: ignore
|
|
1741
|
+
object_=_response.json(),
|
|
1742
|
+
),
|
|
1743
|
+
),
|
|
1744
|
+
)
|
|
1745
|
+
if _response.status_code == 429:
|
|
1746
|
+
raise TooManyRequestsError(
|
|
1747
|
+
headers=dict(_response.headers),
|
|
1748
|
+
body=typing.cast(
|
|
1749
|
+
TooManyRequests,
|
|
1750
|
+
construct_type(
|
|
1751
|
+
type_=TooManyRequests, # type: ignore
|
|
1752
|
+
object_=_response.json(),
|
|
1753
|
+
),
|
|
1754
|
+
),
|
|
1755
|
+
)
|
|
1756
|
+
_response_json = _response.json()
|
|
1757
|
+
except JSONDecodeError:
|
|
1758
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1759
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1760
|
+
|
|
1761
|
+
async def add_reviewers(
|
|
1762
|
+
self,
|
|
1763
|
+
account_id: Uuid,
|
|
1764
|
+
share_id: Uuid,
|
|
1765
|
+
*,
|
|
1766
|
+
data: AddReviewersToShareParamsData,
|
|
1767
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1768
|
+
) -> AsyncHttpResponse[None]:
|
|
1769
|
+
"""
|
|
1770
|
+
Add reviewers to secure share by three identifier types: `adobe_user_id`, `email`, and `user_id`.
|
|
1771
|
+
<br>
|
|
1772
|
+
A request can only include one identifier type parameter.
|
|
1773
|
+
<br>
|
|
1774
|
+
`email` is the only identifier able to add reviewers to a Share who don't have a Frame account member on the account where the Share belongs.
|
|
1775
|
+
<br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
1776
|
+
|
|
1777
|
+
Parameters
|
|
1778
|
+
----------
|
|
1779
|
+
account_id : Uuid
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
share_id : Uuid
|
|
1783
|
+
|
|
1784
|
+
|
|
1785
|
+
data : AddReviewersToShareParamsData
|
|
1786
|
+
|
|
1787
|
+
request_options : typing.Optional[RequestOptions]
|
|
1788
|
+
Request-specific configuration.
|
|
1789
|
+
|
|
1790
|
+
Returns
|
|
1791
|
+
-------
|
|
1792
|
+
AsyncHttpResponse[None]
|
|
1793
|
+
"""
|
|
1794
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1795
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/reviewers",
|
|
1796
|
+
method="POST",
|
|
1797
|
+
json={
|
|
1798
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1799
|
+
object_=data, annotation=AddReviewersToShareParamsData, direction="write"
|
|
1800
|
+
),
|
|
1801
|
+
},
|
|
1802
|
+
headers={
|
|
1803
|
+
"content-type": "application/json",
|
|
1804
|
+
},
|
|
1805
|
+
request_options=request_options,
|
|
1806
|
+
omit=OMIT,
|
|
1807
|
+
)
|
|
1808
|
+
try:
|
|
1809
|
+
if 200 <= _response.status_code < 300:
|
|
1810
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
1811
|
+
if _response.status_code == 400:
|
|
1812
|
+
raise BadRequestError(
|
|
1813
|
+
headers=dict(_response.headers),
|
|
1814
|
+
body=typing.cast(
|
|
1815
|
+
BadRequest,
|
|
1816
|
+
construct_type(
|
|
1817
|
+
type_=BadRequest, # type: ignore
|
|
1818
|
+
object_=_response.json(),
|
|
1819
|
+
),
|
|
1820
|
+
),
|
|
1821
|
+
)
|
|
1822
|
+
if _response.status_code == 401:
|
|
1823
|
+
raise UnauthorizedError(
|
|
1824
|
+
headers=dict(_response.headers),
|
|
1825
|
+
body=typing.cast(
|
|
1826
|
+
Unauthorized,
|
|
1827
|
+
construct_type(
|
|
1828
|
+
type_=Unauthorized, # type: ignore
|
|
1829
|
+
object_=_response.json(),
|
|
1830
|
+
),
|
|
1831
|
+
),
|
|
1832
|
+
)
|
|
1833
|
+
if _response.status_code == 403:
|
|
1834
|
+
raise ForbiddenError(
|
|
1835
|
+
headers=dict(_response.headers),
|
|
1836
|
+
body=typing.cast(
|
|
1837
|
+
Forbidden,
|
|
1838
|
+
construct_type(
|
|
1839
|
+
type_=Forbidden, # type: ignore
|
|
1840
|
+
object_=_response.json(),
|
|
1841
|
+
),
|
|
1842
|
+
),
|
|
1843
|
+
)
|
|
1844
|
+
if _response.status_code == 404:
|
|
1845
|
+
raise NotFoundError(
|
|
1846
|
+
headers=dict(_response.headers),
|
|
1847
|
+
body=typing.cast(
|
|
1848
|
+
NotFound,
|
|
1849
|
+
construct_type(
|
|
1850
|
+
type_=NotFound, # type: ignore
|
|
1851
|
+
object_=_response.json(),
|
|
1852
|
+
),
|
|
1853
|
+
),
|
|
1854
|
+
)
|
|
1855
|
+
if _response.status_code == 422:
|
|
1856
|
+
raise UnprocessableEntityError(
|
|
1857
|
+
headers=dict(_response.headers),
|
|
1858
|
+
body=typing.cast(
|
|
1859
|
+
typing.Any,
|
|
1860
|
+
construct_type(
|
|
1861
|
+
type_=typing.Any, # type: ignore
|
|
1862
|
+
object_=_response.json(),
|
|
1863
|
+
),
|
|
1864
|
+
),
|
|
1865
|
+
)
|
|
1866
|
+
if _response.status_code == 429:
|
|
1867
|
+
raise TooManyRequestsError(
|
|
1868
|
+
headers=dict(_response.headers),
|
|
1869
|
+
body=typing.cast(
|
|
1870
|
+
TooManyRequests,
|
|
1871
|
+
construct_type(
|
|
1872
|
+
type_=TooManyRequests, # type: ignore
|
|
1873
|
+
object_=_response.json(),
|
|
1874
|
+
),
|
|
1875
|
+
),
|
|
1876
|
+
)
|
|
1877
|
+
_response_json = _response.json()
|
|
1878
|
+
except JSONDecodeError:
|
|
1879
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1880
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1881
|
+
|
|
1882
|
+
async def remove_reviewers(
|
|
1883
|
+
self,
|
|
1884
|
+
account_id: Uuid,
|
|
1885
|
+
share_id: Uuid,
|
|
1886
|
+
*,
|
|
1887
|
+
data: RemoveReviewerParamsData,
|
|
1888
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1889
|
+
) -> AsyncHttpResponse[None]:
|
|
1890
|
+
"""
|
|
1891
|
+
Removes reviewers from secure Share by three identifier types: `adobe_user_id`, `email`, and `user_id`.
|
|
1892
|
+
<br>
|
|
1893
|
+
A request can only include one identifier type parameter.
|
|
1894
|
+
<br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
1895
|
+
|
|
1896
|
+
Parameters
|
|
1897
|
+
----------
|
|
1898
|
+
account_id : Uuid
|
|
1899
|
+
|
|
1900
|
+
|
|
1901
|
+
share_id : Uuid
|
|
1902
|
+
|
|
1903
|
+
|
|
1904
|
+
data : RemoveReviewerParamsData
|
|
1905
|
+
|
|
1906
|
+
request_options : typing.Optional[RequestOptions]
|
|
1907
|
+
Request-specific configuration.
|
|
1908
|
+
|
|
1909
|
+
Returns
|
|
1910
|
+
-------
|
|
1911
|
+
AsyncHttpResponse[None]
|
|
1912
|
+
"""
|
|
1913
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1914
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/reviewers",
|
|
1915
|
+
method="DELETE",
|
|
1916
|
+
json={
|
|
1917
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1918
|
+
object_=data, annotation=RemoveReviewerParamsData, direction="write"
|
|
1919
|
+
),
|
|
1920
|
+
},
|
|
1921
|
+
headers={
|
|
1922
|
+
"content-type": "application/json",
|
|
1923
|
+
},
|
|
1924
|
+
request_options=request_options,
|
|
1925
|
+
omit=OMIT,
|
|
1926
|
+
)
|
|
1927
|
+
try:
|
|
1928
|
+
if 200 <= _response.status_code < 300:
|
|
1929
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
1930
|
+
if _response.status_code == 400:
|
|
1931
|
+
raise BadRequestError(
|
|
1932
|
+
headers=dict(_response.headers),
|
|
1933
|
+
body=typing.cast(
|
|
1934
|
+
BadRequest,
|
|
1935
|
+
construct_type(
|
|
1936
|
+
type_=BadRequest, # type: ignore
|
|
1937
|
+
object_=_response.json(),
|
|
1938
|
+
),
|
|
1939
|
+
),
|
|
1940
|
+
)
|
|
1941
|
+
if _response.status_code == 401:
|
|
1942
|
+
raise UnauthorizedError(
|
|
1943
|
+
headers=dict(_response.headers),
|
|
1944
|
+
body=typing.cast(
|
|
1945
|
+
Unauthorized,
|
|
1946
|
+
construct_type(
|
|
1947
|
+
type_=Unauthorized, # type: ignore
|
|
1948
|
+
object_=_response.json(),
|
|
1949
|
+
),
|
|
1950
|
+
),
|
|
1951
|
+
)
|
|
1952
|
+
if _response.status_code == 403:
|
|
1953
|
+
raise ForbiddenError(
|
|
1954
|
+
headers=dict(_response.headers),
|
|
1955
|
+
body=typing.cast(
|
|
1956
|
+
Forbidden,
|
|
1957
|
+
construct_type(
|
|
1958
|
+
type_=Forbidden, # type: ignore
|
|
1959
|
+
object_=_response.json(),
|
|
1960
|
+
),
|
|
1961
|
+
),
|
|
1962
|
+
)
|
|
1963
|
+
if _response.status_code == 404:
|
|
1964
|
+
raise NotFoundError(
|
|
1965
|
+
headers=dict(_response.headers),
|
|
1966
|
+
body=typing.cast(
|
|
1967
|
+
NotFound,
|
|
1968
|
+
construct_type(
|
|
1969
|
+
type_=NotFound, # type: ignore
|
|
1970
|
+
object_=_response.json(),
|
|
1971
|
+
),
|
|
1972
|
+
),
|
|
1973
|
+
)
|
|
1974
|
+
if _response.status_code == 422:
|
|
1975
|
+
raise UnprocessableEntityError(
|
|
1976
|
+
headers=dict(_response.headers),
|
|
1977
|
+
body=typing.cast(
|
|
1978
|
+
typing.Any,
|
|
1979
|
+
construct_type(
|
|
1980
|
+
type_=typing.Any, # type: ignore
|
|
1981
|
+
object_=_response.json(),
|
|
1982
|
+
),
|
|
1983
|
+
),
|
|
1984
|
+
)
|
|
1985
|
+
if _response.status_code == 429:
|
|
1986
|
+
raise TooManyRequestsError(
|
|
1987
|
+
headers=dict(_response.headers),
|
|
1988
|
+
body=typing.cast(
|
|
1989
|
+
TooManyRequests,
|
|
1990
|
+
construct_type(
|
|
1991
|
+
type_=TooManyRequests, # type: ignore
|
|
1992
|
+
object_=_response.json(),
|
|
1993
|
+
),
|
|
1994
|
+
),
|
|
1995
|
+
)
|
|
1996
|
+
_response_json = _response.json()
|
|
1997
|
+
except JSONDecodeError:
|
|
1998
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1999
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2000
|
+
|
|
2001
|
+
async def remove_asset(
|
|
2002
|
+
self,
|
|
2003
|
+
account_id: Uuid,
|
|
2004
|
+
share_id: Uuid,
|
|
2005
|
+
asset_id: Uuid,
|
|
2006
|
+
*,
|
|
2007
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2008
|
+
) -> AsyncHttpResponse[RemoveAssetResponse]:
|
|
2009
|
+
"""
|
|
2010
|
+
Remove an asset currently in the share from that share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
2011
|
+
|
|
2012
|
+
Parameters
|
|
2013
|
+
----------
|
|
2014
|
+
account_id : Uuid
|
|
2015
|
+
|
|
2016
|
+
|
|
2017
|
+
share_id : Uuid
|
|
2018
|
+
|
|
2019
|
+
|
|
2020
|
+
asset_id : Uuid
|
|
2021
|
+
|
|
2022
|
+
|
|
2023
|
+
request_options : typing.Optional[RequestOptions]
|
|
2024
|
+
Request-specific configuration.
|
|
2025
|
+
|
|
2026
|
+
Returns
|
|
2027
|
+
-------
|
|
2028
|
+
AsyncHttpResponse[RemoveAssetResponse]
|
|
2029
|
+
OK
|
|
2030
|
+
"""
|
|
2031
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2032
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/assets/{jsonable_encoder(asset_id)}",
|
|
2033
|
+
method="DELETE",
|
|
2034
|
+
request_options=request_options,
|
|
2035
|
+
)
|
|
2036
|
+
try:
|
|
2037
|
+
if 200 <= _response.status_code < 300:
|
|
2038
|
+
_data = typing.cast(
|
|
2039
|
+
RemoveAssetResponse,
|
|
2040
|
+
construct_type(
|
|
2041
|
+
type_=RemoveAssetResponse, # type: ignore
|
|
2042
|
+
object_=_response.json(),
|
|
2043
|
+
),
|
|
2044
|
+
)
|
|
2045
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2046
|
+
if _response.status_code == 400:
|
|
2047
|
+
raise BadRequestError(
|
|
2048
|
+
headers=dict(_response.headers),
|
|
2049
|
+
body=typing.cast(
|
|
2050
|
+
BadRequest,
|
|
2051
|
+
construct_type(
|
|
2052
|
+
type_=BadRequest, # type: ignore
|
|
2053
|
+
object_=_response.json(),
|
|
2054
|
+
),
|
|
2055
|
+
),
|
|
2056
|
+
)
|
|
2057
|
+
if _response.status_code == 401:
|
|
2058
|
+
raise UnauthorizedError(
|
|
2059
|
+
headers=dict(_response.headers),
|
|
2060
|
+
body=typing.cast(
|
|
2061
|
+
Unauthorized,
|
|
2062
|
+
construct_type(
|
|
2063
|
+
type_=Unauthorized, # type: ignore
|
|
2064
|
+
object_=_response.json(),
|
|
2065
|
+
),
|
|
2066
|
+
),
|
|
2067
|
+
)
|
|
2068
|
+
if _response.status_code == 403:
|
|
2069
|
+
raise ForbiddenError(
|
|
2070
|
+
headers=dict(_response.headers),
|
|
2071
|
+
body=typing.cast(
|
|
2072
|
+
Forbidden,
|
|
2073
|
+
construct_type(
|
|
2074
|
+
type_=Forbidden, # type: ignore
|
|
2075
|
+
object_=_response.json(),
|
|
2076
|
+
),
|
|
2077
|
+
),
|
|
2078
|
+
)
|
|
2079
|
+
if _response.status_code == 404:
|
|
2080
|
+
raise NotFoundError(
|
|
2081
|
+
headers=dict(_response.headers),
|
|
2082
|
+
body=typing.cast(
|
|
2083
|
+
NotFound,
|
|
2084
|
+
construct_type(
|
|
2085
|
+
type_=NotFound, # type: ignore
|
|
2086
|
+
object_=_response.json(),
|
|
2087
|
+
),
|
|
2088
|
+
),
|
|
2089
|
+
)
|
|
2090
|
+
if _response.status_code == 422:
|
|
2091
|
+
raise UnprocessableEntityError(
|
|
2092
|
+
headers=dict(_response.headers),
|
|
2093
|
+
body=typing.cast(
|
|
2094
|
+
typing.Any,
|
|
2095
|
+
construct_type(
|
|
2096
|
+
type_=typing.Any, # type: ignore
|
|
2097
|
+
object_=_response.json(),
|
|
2098
|
+
),
|
|
2099
|
+
),
|
|
2100
|
+
)
|
|
2101
|
+
if _response.status_code == 429:
|
|
2102
|
+
raise TooManyRequestsError(
|
|
2103
|
+
headers=dict(_response.headers),
|
|
2104
|
+
body=typing.cast(
|
|
2105
|
+
TooManyRequests,
|
|
2106
|
+
construct_type(
|
|
2107
|
+
type_=TooManyRequests, # type: ignore
|
|
2108
|
+
object_=_response.json(),
|
|
2109
|
+
),
|
|
2110
|
+
),
|
|
2111
|
+
)
|
|
2112
|
+
_response_json = _response.json()
|
|
2113
|
+
except JSONDecodeError:
|
|
2114
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2115
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2116
|
+
|
|
2117
|
+
async def add_asset(
|
|
2118
|
+
self,
|
|
2119
|
+
account_id: Uuid,
|
|
2120
|
+
share_id: Uuid,
|
|
2121
|
+
*,
|
|
2122
|
+
data: AddAssetParamsData,
|
|
2123
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2124
|
+
) -> AsyncHttpResponse[AddAssetResponse]:
|
|
2125
|
+
"""
|
|
2126
|
+
Add new asset share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
2127
|
+
|
|
2128
|
+
Parameters
|
|
2129
|
+
----------
|
|
2130
|
+
account_id : Uuid
|
|
2131
|
+
|
|
2132
|
+
|
|
2133
|
+
share_id : Uuid
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
data : AddAssetParamsData
|
|
2137
|
+
|
|
2138
|
+
request_options : typing.Optional[RequestOptions]
|
|
2139
|
+
Request-specific configuration.
|
|
2140
|
+
|
|
2141
|
+
Returns
|
|
2142
|
+
-------
|
|
2143
|
+
AsyncHttpResponse[AddAssetResponse]
|
|
2144
|
+
OK
|
|
2145
|
+
"""
|
|
2146
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2147
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/shares/{jsonable_encoder(share_id)}/assets",
|
|
2148
|
+
method="POST",
|
|
2149
|
+
json={
|
|
2150
|
+
"data": convert_and_respect_annotation_metadata(
|
|
2151
|
+
object_=data, annotation=AddAssetParamsData, direction="write"
|
|
2152
|
+
),
|
|
2153
|
+
},
|
|
2154
|
+
headers={
|
|
2155
|
+
"content-type": "application/json",
|
|
2156
|
+
},
|
|
2157
|
+
request_options=request_options,
|
|
2158
|
+
omit=OMIT,
|
|
2159
|
+
)
|
|
2160
|
+
try:
|
|
2161
|
+
if 200 <= _response.status_code < 300:
|
|
2162
|
+
_data = typing.cast(
|
|
2163
|
+
AddAssetResponse,
|
|
2164
|
+
construct_type(
|
|
2165
|
+
type_=AddAssetResponse, # type: ignore
|
|
2166
|
+
object_=_response.json(),
|
|
2167
|
+
),
|
|
2168
|
+
)
|
|
2169
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2170
|
+
if _response.status_code == 400:
|
|
2171
|
+
raise BadRequestError(
|
|
2172
|
+
headers=dict(_response.headers),
|
|
2173
|
+
body=typing.cast(
|
|
2174
|
+
BadRequest,
|
|
2175
|
+
construct_type(
|
|
2176
|
+
type_=BadRequest, # type: ignore
|
|
2177
|
+
object_=_response.json(),
|
|
2178
|
+
),
|
|
2179
|
+
),
|
|
2180
|
+
)
|
|
2181
|
+
if _response.status_code == 401:
|
|
2182
|
+
raise UnauthorizedError(
|
|
2183
|
+
headers=dict(_response.headers),
|
|
2184
|
+
body=typing.cast(
|
|
2185
|
+
Unauthorized,
|
|
2186
|
+
construct_type(
|
|
2187
|
+
type_=Unauthorized, # type: ignore
|
|
2188
|
+
object_=_response.json(),
|
|
2189
|
+
),
|
|
2190
|
+
),
|
|
2191
|
+
)
|
|
2192
|
+
if _response.status_code == 403:
|
|
2193
|
+
raise ForbiddenError(
|
|
2194
|
+
headers=dict(_response.headers),
|
|
2195
|
+
body=typing.cast(
|
|
2196
|
+
Forbidden,
|
|
2197
|
+
construct_type(
|
|
2198
|
+
type_=Forbidden, # type: ignore
|
|
2199
|
+
object_=_response.json(),
|
|
2200
|
+
),
|
|
2201
|
+
),
|
|
2202
|
+
)
|
|
2203
|
+
if _response.status_code == 404:
|
|
2204
|
+
raise NotFoundError(
|
|
2205
|
+
headers=dict(_response.headers),
|
|
2206
|
+
body=typing.cast(
|
|
2207
|
+
NotFound,
|
|
2208
|
+
construct_type(
|
|
2209
|
+
type_=NotFound, # type: ignore
|
|
2210
|
+
object_=_response.json(),
|
|
2211
|
+
),
|
|
2212
|
+
),
|
|
2213
|
+
)
|
|
2214
|
+
if _response.status_code == 422:
|
|
2215
|
+
raise UnprocessableEntityError(
|
|
2216
|
+
headers=dict(_response.headers),
|
|
2217
|
+
body=typing.cast(
|
|
2218
|
+
typing.Any,
|
|
2219
|
+
construct_type(
|
|
2220
|
+
type_=typing.Any, # type: ignore
|
|
2221
|
+
object_=_response.json(),
|
|
2222
|
+
),
|
|
2223
|
+
),
|
|
2224
|
+
)
|
|
2225
|
+
if _response.status_code == 429:
|
|
2226
|
+
raise TooManyRequestsError(
|
|
2227
|
+
headers=dict(_response.headers),
|
|
2228
|
+
body=typing.cast(
|
|
2229
|
+
TooManyRequests,
|
|
2230
|
+
construct_type(
|
|
2231
|
+
type_=TooManyRequests, # type: ignore
|
|
2232
|
+
object_=_response.json(),
|
|
2233
|
+
),
|
|
2234
|
+
),
|
|
2235
|
+
)
|
|
2236
|
+
_response_json = _response.json()
|
|
2237
|
+
except JSONDecodeError:
|
|
2238
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2239
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2240
|
+
|
|
2241
|
+
async def index(
|
|
2242
|
+
self,
|
|
2243
|
+
account_id: Uuid,
|
|
2244
|
+
project_id: Uuid,
|
|
2245
|
+
*,
|
|
2246
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
2247
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
2248
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
2249
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2250
|
+
) -> AsyncPager[Share, SharesResponse]:
|
|
2251
|
+
"""
|
|
2252
|
+
List shares on a project. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
2253
|
+
|
|
2254
|
+
Parameters
|
|
2255
|
+
----------
|
|
2256
|
+
account_id : Uuid
|
|
2257
|
+
|
|
2258
|
+
|
|
2259
|
+
project_id : Uuid
|
|
2260
|
+
|
|
2261
|
+
|
|
2262
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
2263
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
2264
|
+
<br/>
|
|
2265
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
2266
|
+
|
|
2267
|
+
page_size : typing.Optional[RequestPageSize]
|
|
2268
|
+
|
|
2269
|
+
|
|
2270
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
2271
|
+
|
|
2272
|
+
|
|
2273
|
+
request_options : typing.Optional[RequestOptions]
|
|
2274
|
+
Request-specific configuration.
|
|
2275
|
+
|
|
2276
|
+
Returns
|
|
2277
|
+
-------
|
|
2278
|
+
AsyncPager[Share, SharesResponse]
|
|
2279
|
+
OK
|
|
2280
|
+
"""
|
|
2281
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2282
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}/shares",
|
|
2283
|
+
method="GET",
|
|
2284
|
+
params={
|
|
2285
|
+
"after": after,
|
|
2286
|
+
"page_size": page_size,
|
|
2287
|
+
"include_total_count": include_total_count,
|
|
2288
|
+
},
|
|
2289
|
+
request_options=request_options,
|
|
2290
|
+
)
|
|
2291
|
+
try:
|
|
2292
|
+
if 200 <= _response.status_code < 300:
|
|
2293
|
+
_parsed_response = typing.cast(
|
|
2294
|
+
SharesResponse,
|
|
2295
|
+
construct_type(
|
|
2296
|
+
type_=SharesResponse, # type: ignore
|
|
2297
|
+
object_=_response.json(),
|
|
2298
|
+
),
|
|
2299
|
+
)
|
|
2300
|
+
_items = _parsed_response.data
|
|
2301
|
+
_has_next = False
|
|
2302
|
+
_get_next = None
|
|
2303
|
+
if _parsed_response.links is not None:
|
|
2304
|
+
_parsed_next = _parsed_response.links.next
|
|
2305
|
+
_has_next = _parsed_next is not None and _parsed_next != ""
|
|
2306
|
+
|
|
2307
|
+
async def _get_next():
|
|
2308
|
+
return await self.index(
|
|
2309
|
+
account_id,
|
|
2310
|
+
project_id,
|
|
2311
|
+
after=_parsed_next,
|
|
2312
|
+
page_size=page_size,
|
|
2313
|
+
include_total_count=include_total_count,
|
|
2314
|
+
request_options=request_options,
|
|
2315
|
+
)
|
|
2316
|
+
|
|
2317
|
+
return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
|
|
2318
|
+
if _response.status_code == 400:
|
|
2319
|
+
raise BadRequestError(
|
|
2320
|
+
headers=dict(_response.headers),
|
|
2321
|
+
body=typing.cast(
|
|
2322
|
+
BadRequest,
|
|
2323
|
+
construct_type(
|
|
2324
|
+
type_=BadRequest, # type: ignore
|
|
2325
|
+
object_=_response.json(),
|
|
2326
|
+
),
|
|
2327
|
+
),
|
|
2328
|
+
)
|
|
2329
|
+
if _response.status_code == 401:
|
|
2330
|
+
raise UnauthorizedError(
|
|
2331
|
+
headers=dict(_response.headers),
|
|
2332
|
+
body=typing.cast(
|
|
2333
|
+
Unauthorized,
|
|
2334
|
+
construct_type(
|
|
2335
|
+
type_=Unauthorized, # type: ignore
|
|
2336
|
+
object_=_response.json(),
|
|
2337
|
+
),
|
|
2338
|
+
),
|
|
2339
|
+
)
|
|
2340
|
+
if _response.status_code == 403:
|
|
2341
|
+
raise ForbiddenError(
|
|
2342
|
+
headers=dict(_response.headers),
|
|
2343
|
+
body=typing.cast(
|
|
2344
|
+
Forbidden,
|
|
2345
|
+
construct_type(
|
|
2346
|
+
type_=Forbidden, # type: ignore
|
|
2347
|
+
object_=_response.json(),
|
|
2348
|
+
),
|
|
2349
|
+
),
|
|
2350
|
+
)
|
|
2351
|
+
if _response.status_code == 404:
|
|
2352
|
+
raise NotFoundError(
|
|
2353
|
+
headers=dict(_response.headers),
|
|
2354
|
+
body=typing.cast(
|
|
2355
|
+
NotFound,
|
|
2356
|
+
construct_type(
|
|
2357
|
+
type_=NotFound, # type: ignore
|
|
2358
|
+
object_=_response.json(),
|
|
2359
|
+
),
|
|
2360
|
+
),
|
|
2361
|
+
)
|
|
2362
|
+
if _response.status_code == 422:
|
|
2363
|
+
raise UnprocessableEntityError(
|
|
2364
|
+
headers=dict(_response.headers),
|
|
2365
|
+
body=typing.cast(
|
|
2366
|
+
typing.Any,
|
|
2367
|
+
construct_type(
|
|
2368
|
+
type_=typing.Any, # type: ignore
|
|
2369
|
+
object_=_response.json(),
|
|
2370
|
+
),
|
|
2371
|
+
),
|
|
2372
|
+
)
|
|
2373
|
+
if _response.status_code == 429:
|
|
2374
|
+
raise TooManyRequestsError(
|
|
2375
|
+
headers=dict(_response.headers),
|
|
2376
|
+
body=typing.cast(
|
|
2377
|
+
TooManyRequests,
|
|
2378
|
+
construct_type(
|
|
2379
|
+
type_=TooManyRequests, # type: ignore
|
|
2380
|
+
object_=_response.json(),
|
|
2381
|
+
),
|
|
2382
|
+
),
|
|
2383
|
+
)
|
|
2384
|
+
_response_json = _response.json()
|
|
2385
|
+
except JSONDecodeError:
|
|
2386
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2387
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2388
|
+
|
|
2389
|
+
async def create(
|
|
2390
|
+
self,
|
|
2391
|
+
account_id: Uuid,
|
|
2392
|
+
project_id: Uuid,
|
|
2393
|
+
*,
|
|
2394
|
+
data: CreateShareParamsData,
|
|
2395
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2396
|
+
) -> AsyncHttpResponse[ShareResponse]:
|
|
2397
|
+
"""
|
|
2398
|
+
Create share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
2399
|
+
|
|
2400
|
+
Parameters
|
|
2401
|
+
----------
|
|
2402
|
+
account_id : Uuid
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
project_id : Uuid
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
data : CreateShareParamsData
|
|
2409
|
+
|
|
2410
|
+
request_options : typing.Optional[RequestOptions]
|
|
2411
|
+
Request-specific configuration.
|
|
2412
|
+
|
|
2413
|
+
Returns
|
|
2414
|
+
-------
|
|
2415
|
+
AsyncHttpResponse[ShareResponse]
|
|
2416
|
+
Created
|
|
2417
|
+
"""
|
|
2418
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2419
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}/shares",
|
|
2420
|
+
method="POST",
|
|
2421
|
+
json={
|
|
2422
|
+
"data": convert_and_respect_annotation_metadata(
|
|
2423
|
+
object_=data, annotation=CreateShareParamsData, direction="write"
|
|
2424
|
+
),
|
|
2425
|
+
},
|
|
2426
|
+
headers={
|
|
2427
|
+
"content-type": "application/json",
|
|
2428
|
+
},
|
|
2429
|
+
request_options=request_options,
|
|
2430
|
+
omit=OMIT,
|
|
2431
|
+
)
|
|
2432
|
+
try:
|
|
2433
|
+
if 200 <= _response.status_code < 300:
|
|
2434
|
+
_data = typing.cast(
|
|
2435
|
+
ShareResponse,
|
|
2436
|
+
construct_type(
|
|
2437
|
+
type_=ShareResponse, # type: ignore
|
|
2438
|
+
object_=_response.json(),
|
|
2439
|
+
),
|
|
2440
|
+
)
|
|
2441
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2442
|
+
if _response.status_code == 400:
|
|
2443
|
+
raise BadRequestError(
|
|
2444
|
+
headers=dict(_response.headers),
|
|
2445
|
+
body=typing.cast(
|
|
2446
|
+
BadRequest,
|
|
2447
|
+
construct_type(
|
|
2448
|
+
type_=BadRequest, # type: ignore
|
|
2449
|
+
object_=_response.json(),
|
|
2450
|
+
),
|
|
2451
|
+
),
|
|
2452
|
+
)
|
|
2453
|
+
if _response.status_code == 401:
|
|
2454
|
+
raise UnauthorizedError(
|
|
2455
|
+
headers=dict(_response.headers),
|
|
2456
|
+
body=typing.cast(
|
|
2457
|
+
Unauthorized,
|
|
2458
|
+
construct_type(
|
|
2459
|
+
type_=Unauthorized, # type: ignore
|
|
2460
|
+
object_=_response.json(),
|
|
2461
|
+
),
|
|
2462
|
+
),
|
|
2463
|
+
)
|
|
2464
|
+
if _response.status_code == 403:
|
|
2465
|
+
raise ForbiddenError(
|
|
2466
|
+
headers=dict(_response.headers),
|
|
2467
|
+
body=typing.cast(
|
|
2468
|
+
Forbidden,
|
|
2469
|
+
construct_type(
|
|
2470
|
+
type_=Forbidden, # type: ignore
|
|
2471
|
+
object_=_response.json(),
|
|
2472
|
+
),
|
|
2473
|
+
),
|
|
2474
|
+
)
|
|
2475
|
+
if _response.status_code == 404:
|
|
2476
|
+
raise NotFoundError(
|
|
2477
|
+
headers=dict(_response.headers),
|
|
2478
|
+
body=typing.cast(
|
|
2479
|
+
NotFound,
|
|
2480
|
+
construct_type(
|
|
2481
|
+
type_=NotFound, # type: ignore
|
|
2482
|
+
object_=_response.json(),
|
|
2483
|
+
),
|
|
2484
|
+
),
|
|
2485
|
+
)
|
|
2486
|
+
if _response.status_code == 422:
|
|
2487
|
+
raise UnprocessableEntityError(
|
|
2488
|
+
headers=dict(_response.headers),
|
|
2489
|
+
body=typing.cast(
|
|
2490
|
+
typing.Any,
|
|
2491
|
+
construct_type(
|
|
2492
|
+
type_=typing.Any, # type: ignore
|
|
2493
|
+
object_=_response.json(),
|
|
2494
|
+
),
|
|
2495
|
+
),
|
|
2496
|
+
)
|
|
2497
|
+
if _response.status_code == 429:
|
|
2498
|
+
raise TooManyRequestsError(
|
|
2499
|
+
headers=dict(_response.headers),
|
|
2500
|
+
body=typing.cast(
|
|
2501
|
+
TooManyRequests,
|
|
2502
|
+
construct_type(
|
|
2503
|
+
type_=TooManyRequests, # type: ignore
|
|
2504
|
+
object_=_response.json(),
|
|
2505
|
+
),
|
|
2506
|
+
),
|
|
2507
|
+
)
|
|
2508
|
+
_response_json = _response.json()
|
|
2509
|
+
except JSONDecodeError:
|
|
2510
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2511
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|