frameio 0.0.23__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of frameio might be problematic. Click here for more details.
- frameio/__init__.py +1115 -0
- frameio/account_permissions/__init__.py +4 -0
- frameio/account_permissions/client.py +182 -0
- frameio/account_permissions/raw_client.py +301 -0
- frameio/accounts/__init__.py +4 -0
- frameio/accounts/client.py +151 -0
- frameio/accounts/raw_client.py +281 -0
- frameio/client.py +439 -0
- frameio/comments/__init__.py +34 -0
- frameio/comments/client.py +596 -0
- frameio/comments/raw_client.py +1252 -0
- frameio/comments/types/__init__.py +38 -0
- frameio/comments/types/create_comment_params_data.py +25 -0
- frameio/comments/types/update_comment_params_data.py +25 -0
- frameio/core/__init__.py +110 -0
- frameio/core/api_error.py +23 -0
- frameio/core/client_wrapper.py +87 -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 +543 -0
- frameio/core/http_response.py +55 -0
- frameio/core/jsonable_encoder.py +100 -0
- frameio/core/pagination.py +82 -0
- frameio/core/pydantic_utilities.py +258 -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/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 +55 -0
- frameio/files/client.py +1136 -0
- frameio/files/raw_client.py +2492 -0
- frameio/files/types/__init__.py +53 -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/folders/__init__.py +39 -0
- frameio/folders/client.py +988 -0
- frameio/folders/raw_client.py +2058 -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 +291 -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 +108 -0
- frameio/metadata_fields/types/update_field_definition_params_data.py +114 -0
- frameio/project_permissions/__init__.py +4 -0
- frameio/project_permissions/client.py +415 -0
- frameio/project_permissions/raw_client.py +789 -0
- frameio/projects/__init__.py +4 -0
- frameio/projects/client.py +582 -0
- frameio/projects/raw_client.py +1250 -0
- frameio/py.typed +0 -0
- frameio/shares/__init__.py +64 -0
- frameio/shares/client.py +1192 -0
- frameio/shares/raw_client.py +2446 -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 +25 -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 +33 -0
- frameio/shares/types/update_share_params_data_access.py +5 -0
- frameio/types/__init__.py +959 -0
- frameio/types/account.py +65 -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 +56 -0
- frameio/types/asset_include.py +5 -0
- frameio/types/asset_share_params.py +38 -0
- frameio/types/asset_share_params_access.py +5 -0
- frameio/types/asset_with_includes.py +72 -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 +52 -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 +43 -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_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/field_definition.py +163 -0
- frameio/types/field_definition_include.py +5 -0
- frameio/types/field_definition_response.py +13 -0
- frameio/types/field_definition_with_includes.py +174 -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 +61 -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 +43 -0
- frameio/types/long_text_definition_field_configuration.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 +23 -0
- frameio/types/metadata_field.py +145 -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 +55 -0
- frameio/types/project_include.py +5 -0
- frameio/types/project_params.py +17 -0
- frameio/types/project_params_data.py +15 -0
- frameio/types/project_response.py +17 -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 +43 -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_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 +43 -0
- frameio/types/text_definition_field_configuration.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/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 +43 -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_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 +43 -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_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 +58 -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 +38 -0
- frameio/version_stacks/client.py +699 -0
- frameio/version_stacks/raw_client.py +1359 -0
- frameio/version_stacks/types/__init__.py +40 -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/webhooks/__init__.py +34 -0
- frameio/webhooks/client.py +782 -0
- frameio/webhooks/raw_client.py +1312 -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 +419 -0
- frameio/workspace_permissions/raw_client.py +789 -0
- frameio/workspaces/__init__.py +4 -0
- frameio/workspaces/client.py +552 -0
- frameio/workspaces/raw_client.py +1226 -0
- frameio-0.0.23.dist-info/METADATA +255 -0
- frameio-0.0.23.dist-info/RECORD +363 -0
- frameio-0.0.23.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,1250 @@
|
|
|
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.pydantic_utilities import parse_obj_as
|
|
11
|
+
from ..core.request_options import RequestOptions
|
|
12
|
+
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
13
|
+
from ..errors.bad_request_error import BadRequestError
|
|
14
|
+
from ..errors.forbidden_error import ForbiddenError
|
|
15
|
+
from ..errors.not_found_error import NotFoundError
|
|
16
|
+
from ..errors.too_many_requests_error import TooManyRequestsError
|
|
17
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
|
18
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
19
|
+
from ..types.bad_request import BadRequest
|
|
20
|
+
from ..types.forbidden import Forbidden
|
|
21
|
+
from ..types.include_total_count import IncludeTotalCount
|
|
22
|
+
from ..types.not_found import NotFound
|
|
23
|
+
from ..types.project_params_data import ProjectParamsData
|
|
24
|
+
from ..types.project_response import ProjectResponse
|
|
25
|
+
from ..types.project_with_includes_response import ProjectWithIncludesResponse
|
|
26
|
+
from ..types.projects_with_includes_response import ProjectsWithIncludesResponse
|
|
27
|
+
from ..types.request_after_opaque_cursor import RequestAfterOpaqueCursor
|
|
28
|
+
from ..types.request_page_size import RequestPageSize
|
|
29
|
+
from ..types.too_many_requests import TooManyRequests
|
|
30
|
+
from ..types.unauthorized import Unauthorized
|
|
31
|
+
from ..types.uuid_ import Uuid
|
|
32
|
+
|
|
33
|
+
# this is used as the default value for optional parameters
|
|
34
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class RawProjectsClient:
|
|
38
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
39
|
+
self._client_wrapper = client_wrapper
|
|
40
|
+
|
|
41
|
+
def show(
|
|
42
|
+
self,
|
|
43
|
+
account_id: Uuid,
|
|
44
|
+
project_id: Uuid,
|
|
45
|
+
*,
|
|
46
|
+
include: typing.Optional[typing.Literal["owner"]] = None,
|
|
47
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
48
|
+
) -> HttpResponse[ProjectWithIncludesResponse]:
|
|
49
|
+
"""
|
|
50
|
+
Show project details. <br><br>Rate Limits: 100 calls per 1.00 minute(s) per account
|
|
51
|
+
|
|
52
|
+
Parameters
|
|
53
|
+
----------
|
|
54
|
+
account_id : Uuid
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
project_id : Uuid
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
include : typing.Optional[typing.Literal["owner"]]
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
request_options : typing.Optional[RequestOptions]
|
|
64
|
+
Request-specific configuration.
|
|
65
|
+
|
|
66
|
+
Returns
|
|
67
|
+
-------
|
|
68
|
+
HttpResponse[ProjectWithIncludesResponse]
|
|
69
|
+
OK
|
|
70
|
+
"""
|
|
71
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
72
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}",
|
|
73
|
+
method="GET",
|
|
74
|
+
params={
|
|
75
|
+
"include": include,
|
|
76
|
+
},
|
|
77
|
+
request_options=request_options,
|
|
78
|
+
)
|
|
79
|
+
try:
|
|
80
|
+
if 200 <= _response.status_code < 300:
|
|
81
|
+
_data = typing.cast(
|
|
82
|
+
ProjectWithIncludesResponse,
|
|
83
|
+
parse_obj_as(
|
|
84
|
+
type_=ProjectWithIncludesResponse, # type: ignore
|
|
85
|
+
object_=_response.json(),
|
|
86
|
+
),
|
|
87
|
+
)
|
|
88
|
+
return HttpResponse(response=_response, data=_data)
|
|
89
|
+
if _response.status_code == 400:
|
|
90
|
+
raise BadRequestError(
|
|
91
|
+
headers=dict(_response.headers),
|
|
92
|
+
body=typing.cast(
|
|
93
|
+
BadRequest,
|
|
94
|
+
parse_obj_as(
|
|
95
|
+
type_=BadRequest, # type: ignore
|
|
96
|
+
object_=_response.json(),
|
|
97
|
+
),
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
if _response.status_code == 401:
|
|
101
|
+
raise UnauthorizedError(
|
|
102
|
+
headers=dict(_response.headers),
|
|
103
|
+
body=typing.cast(
|
|
104
|
+
Unauthorized,
|
|
105
|
+
parse_obj_as(
|
|
106
|
+
type_=Unauthorized, # type: ignore
|
|
107
|
+
object_=_response.json(),
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
)
|
|
111
|
+
if _response.status_code == 403:
|
|
112
|
+
raise ForbiddenError(
|
|
113
|
+
headers=dict(_response.headers),
|
|
114
|
+
body=typing.cast(
|
|
115
|
+
Forbidden,
|
|
116
|
+
parse_obj_as(
|
|
117
|
+
type_=Forbidden, # type: ignore
|
|
118
|
+
object_=_response.json(),
|
|
119
|
+
),
|
|
120
|
+
),
|
|
121
|
+
)
|
|
122
|
+
if _response.status_code == 404:
|
|
123
|
+
raise NotFoundError(
|
|
124
|
+
headers=dict(_response.headers),
|
|
125
|
+
body=typing.cast(
|
|
126
|
+
NotFound,
|
|
127
|
+
parse_obj_as(
|
|
128
|
+
type_=NotFound, # type: ignore
|
|
129
|
+
object_=_response.json(),
|
|
130
|
+
),
|
|
131
|
+
),
|
|
132
|
+
)
|
|
133
|
+
if _response.status_code == 422:
|
|
134
|
+
raise UnprocessableEntityError(
|
|
135
|
+
headers=dict(_response.headers),
|
|
136
|
+
body=typing.cast(
|
|
137
|
+
typing.Optional[typing.Any],
|
|
138
|
+
parse_obj_as(
|
|
139
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
140
|
+
object_=_response.json(),
|
|
141
|
+
),
|
|
142
|
+
),
|
|
143
|
+
)
|
|
144
|
+
if _response.status_code == 429:
|
|
145
|
+
raise TooManyRequestsError(
|
|
146
|
+
headers=dict(_response.headers),
|
|
147
|
+
body=typing.cast(
|
|
148
|
+
TooManyRequests,
|
|
149
|
+
parse_obj_as(
|
|
150
|
+
type_=TooManyRequests, # type: ignore
|
|
151
|
+
object_=_response.json(),
|
|
152
|
+
),
|
|
153
|
+
),
|
|
154
|
+
)
|
|
155
|
+
_response_json = _response.json()
|
|
156
|
+
except JSONDecodeError:
|
|
157
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
158
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
159
|
+
|
|
160
|
+
def delete(
|
|
161
|
+
self, account_id: Uuid, project_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
|
|
162
|
+
) -> HttpResponse[None]:
|
|
163
|
+
"""
|
|
164
|
+
Delete a project. <br><br>Rate Limits: 60 calls per 1.00 minute(s) per account
|
|
165
|
+
|
|
166
|
+
Parameters
|
|
167
|
+
----------
|
|
168
|
+
account_id : Uuid
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
project_id : Uuid
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
request_options : typing.Optional[RequestOptions]
|
|
175
|
+
Request-specific configuration.
|
|
176
|
+
|
|
177
|
+
Returns
|
|
178
|
+
-------
|
|
179
|
+
HttpResponse[None]
|
|
180
|
+
"""
|
|
181
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
182
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}",
|
|
183
|
+
method="DELETE",
|
|
184
|
+
request_options=request_options,
|
|
185
|
+
)
|
|
186
|
+
try:
|
|
187
|
+
if 200 <= _response.status_code < 300:
|
|
188
|
+
return HttpResponse(response=_response, data=None)
|
|
189
|
+
if _response.status_code == 400:
|
|
190
|
+
raise BadRequestError(
|
|
191
|
+
headers=dict(_response.headers),
|
|
192
|
+
body=typing.cast(
|
|
193
|
+
BadRequest,
|
|
194
|
+
parse_obj_as(
|
|
195
|
+
type_=BadRequest, # type: ignore
|
|
196
|
+
object_=_response.json(),
|
|
197
|
+
),
|
|
198
|
+
),
|
|
199
|
+
)
|
|
200
|
+
if _response.status_code == 401:
|
|
201
|
+
raise UnauthorizedError(
|
|
202
|
+
headers=dict(_response.headers),
|
|
203
|
+
body=typing.cast(
|
|
204
|
+
Unauthorized,
|
|
205
|
+
parse_obj_as(
|
|
206
|
+
type_=Unauthorized, # type: ignore
|
|
207
|
+
object_=_response.json(),
|
|
208
|
+
),
|
|
209
|
+
),
|
|
210
|
+
)
|
|
211
|
+
if _response.status_code == 403:
|
|
212
|
+
raise ForbiddenError(
|
|
213
|
+
headers=dict(_response.headers),
|
|
214
|
+
body=typing.cast(
|
|
215
|
+
Forbidden,
|
|
216
|
+
parse_obj_as(
|
|
217
|
+
type_=Forbidden, # type: ignore
|
|
218
|
+
object_=_response.json(),
|
|
219
|
+
),
|
|
220
|
+
),
|
|
221
|
+
)
|
|
222
|
+
if _response.status_code == 404:
|
|
223
|
+
raise NotFoundError(
|
|
224
|
+
headers=dict(_response.headers),
|
|
225
|
+
body=typing.cast(
|
|
226
|
+
NotFound,
|
|
227
|
+
parse_obj_as(
|
|
228
|
+
type_=NotFound, # type: ignore
|
|
229
|
+
object_=_response.json(),
|
|
230
|
+
),
|
|
231
|
+
),
|
|
232
|
+
)
|
|
233
|
+
if _response.status_code == 422:
|
|
234
|
+
raise UnprocessableEntityError(
|
|
235
|
+
headers=dict(_response.headers),
|
|
236
|
+
body=typing.cast(
|
|
237
|
+
typing.Optional[typing.Any],
|
|
238
|
+
parse_obj_as(
|
|
239
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
240
|
+
object_=_response.json(),
|
|
241
|
+
),
|
|
242
|
+
),
|
|
243
|
+
)
|
|
244
|
+
if _response.status_code == 429:
|
|
245
|
+
raise TooManyRequestsError(
|
|
246
|
+
headers=dict(_response.headers),
|
|
247
|
+
body=typing.cast(
|
|
248
|
+
TooManyRequests,
|
|
249
|
+
parse_obj_as(
|
|
250
|
+
type_=TooManyRequests, # type: ignore
|
|
251
|
+
object_=_response.json(),
|
|
252
|
+
),
|
|
253
|
+
),
|
|
254
|
+
)
|
|
255
|
+
_response_json = _response.json()
|
|
256
|
+
except JSONDecodeError:
|
|
257
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
258
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
259
|
+
|
|
260
|
+
def update(
|
|
261
|
+
self,
|
|
262
|
+
account_id: Uuid,
|
|
263
|
+
project_id: Uuid,
|
|
264
|
+
*,
|
|
265
|
+
data: ProjectParamsData,
|
|
266
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
267
|
+
) -> HttpResponse[ProjectResponse]:
|
|
268
|
+
"""
|
|
269
|
+
Update project details. <br><br>Rate Limits: 10 calls per 1.00 minute(s) per account
|
|
270
|
+
|
|
271
|
+
Parameters
|
|
272
|
+
----------
|
|
273
|
+
account_id : Uuid
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
project_id : Uuid
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
data : ProjectParamsData
|
|
280
|
+
|
|
281
|
+
request_options : typing.Optional[RequestOptions]
|
|
282
|
+
Request-specific configuration.
|
|
283
|
+
|
|
284
|
+
Returns
|
|
285
|
+
-------
|
|
286
|
+
HttpResponse[ProjectResponse]
|
|
287
|
+
OK
|
|
288
|
+
"""
|
|
289
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
290
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}",
|
|
291
|
+
method="PATCH",
|
|
292
|
+
json={
|
|
293
|
+
"data": convert_and_respect_annotation_metadata(
|
|
294
|
+
object_=data, annotation=ProjectParamsData, direction="write"
|
|
295
|
+
),
|
|
296
|
+
},
|
|
297
|
+
headers={
|
|
298
|
+
"content-type": "application/json",
|
|
299
|
+
},
|
|
300
|
+
request_options=request_options,
|
|
301
|
+
omit=OMIT,
|
|
302
|
+
)
|
|
303
|
+
try:
|
|
304
|
+
if 200 <= _response.status_code < 300:
|
|
305
|
+
_data = typing.cast(
|
|
306
|
+
ProjectResponse,
|
|
307
|
+
parse_obj_as(
|
|
308
|
+
type_=ProjectResponse, # type: ignore
|
|
309
|
+
object_=_response.json(),
|
|
310
|
+
),
|
|
311
|
+
)
|
|
312
|
+
return HttpResponse(response=_response, data=_data)
|
|
313
|
+
if _response.status_code == 400:
|
|
314
|
+
raise BadRequestError(
|
|
315
|
+
headers=dict(_response.headers),
|
|
316
|
+
body=typing.cast(
|
|
317
|
+
BadRequest,
|
|
318
|
+
parse_obj_as(
|
|
319
|
+
type_=BadRequest, # type: ignore
|
|
320
|
+
object_=_response.json(),
|
|
321
|
+
),
|
|
322
|
+
),
|
|
323
|
+
)
|
|
324
|
+
if _response.status_code == 401:
|
|
325
|
+
raise UnauthorizedError(
|
|
326
|
+
headers=dict(_response.headers),
|
|
327
|
+
body=typing.cast(
|
|
328
|
+
Unauthorized,
|
|
329
|
+
parse_obj_as(
|
|
330
|
+
type_=Unauthorized, # type: ignore
|
|
331
|
+
object_=_response.json(),
|
|
332
|
+
),
|
|
333
|
+
),
|
|
334
|
+
)
|
|
335
|
+
if _response.status_code == 403:
|
|
336
|
+
raise ForbiddenError(
|
|
337
|
+
headers=dict(_response.headers),
|
|
338
|
+
body=typing.cast(
|
|
339
|
+
Forbidden,
|
|
340
|
+
parse_obj_as(
|
|
341
|
+
type_=Forbidden, # type: ignore
|
|
342
|
+
object_=_response.json(),
|
|
343
|
+
),
|
|
344
|
+
),
|
|
345
|
+
)
|
|
346
|
+
if _response.status_code == 404:
|
|
347
|
+
raise NotFoundError(
|
|
348
|
+
headers=dict(_response.headers),
|
|
349
|
+
body=typing.cast(
|
|
350
|
+
NotFound,
|
|
351
|
+
parse_obj_as(
|
|
352
|
+
type_=NotFound, # type: ignore
|
|
353
|
+
object_=_response.json(),
|
|
354
|
+
),
|
|
355
|
+
),
|
|
356
|
+
)
|
|
357
|
+
if _response.status_code == 422:
|
|
358
|
+
raise UnprocessableEntityError(
|
|
359
|
+
headers=dict(_response.headers),
|
|
360
|
+
body=typing.cast(
|
|
361
|
+
typing.Optional[typing.Any],
|
|
362
|
+
parse_obj_as(
|
|
363
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
364
|
+
object_=_response.json(),
|
|
365
|
+
),
|
|
366
|
+
),
|
|
367
|
+
)
|
|
368
|
+
if _response.status_code == 429:
|
|
369
|
+
raise TooManyRequestsError(
|
|
370
|
+
headers=dict(_response.headers),
|
|
371
|
+
body=typing.cast(
|
|
372
|
+
TooManyRequests,
|
|
373
|
+
parse_obj_as(
|
|
374
|
+
type_=TooManyRequests, # type: ignore
|
|
375
|
+
object_=_response.json(),
|
|
376
|
+
),
|
|
377
|
+
),
|
|
378
|
+
)
|
|
379
|
+
_response_json = _response.json()
|
|
380
|
+
except JSONDecodeError:
|
|
381
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
382
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
383
|
+
|
|
384
|
+
def index(
|
|
385
|
+
self,
|
|
386
|
+
account_id: Uuid,
|
|
387
|
+
workspace_id: Uuid,
|
|
388
|
+
*,
|
|
389
|
+
include: typing.Optional[typing.Literal["owner"]] = None,
|
|
390
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
391
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
392
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
393
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
394
|
+
) -> HttpResponse[ProjectsWithIncludesResponse]:
|
|
395
|
+
"""
|
|
396
|
+
List projects in a given workspace. <br><br>Rate Limits: 100 calls per 1.00 minute(s) per account
|
|
397
|
+
|
|
398
|
+
Parameters
|
|
399
|
+
----------
|
|
400
|
+
account_id : Uuid
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
workspace_id : Uuid
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
include : typing.Optional[typing.Literal["owner"]]
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
410
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
411
|
+
<br/>
|
|
412
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
413
|
+
|
|
414
|
+
page_size : typing.Optional[RequestPageSize]
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
request_options : typing.Optional[RequestOptions]
|
|
421
|
+
Request-specific configuration.
|
|
422
|
+
|
|
423
|
+
Returns
|
|
424
|
+
-------
|
|
425
|
+
HttpResponse[ProjectsWithIncludesResponse]
|
|
426
|
+
OK
|
|
427
|
+
"""
|
|
428
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
429
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/workspaces/{jsonable_encoder(workspace_id)}/projects",
|
|
430
|
+
method="GET",
|
|
431
|
+
params={
|
|
432
|
+
"include": include,
|
|
433
|
+
"after": after,
|
|
434
|
+
"page_size": page_size,
|
|
435
|
+
"include_total_count": include_total_count,
|
|
436
|
+
},
|
|
437
|
+
request_options=request_options,
|
|
438
|
+
)
|
|
439
|
+
try:
|
|
440
|
+
if 200 <= _response.status_code < 300:
|
|
441
|
+
_data = typing.cast(
|
|
442
|
+
ProjectsWithIncludesResponse,
|
|
443
|
+
parse_obj_as(
|
|
444
|
+
type_=ProjectsWithIncludesResponse, # type: ignore
|
|
445
|
+
object_=_response.json(),
|
|
446
|
+
),
|
|
447
|
+
)
|
|
448
|
+
return HttpResponse(response=_response, data=_data)
|
|
449
|
+
if _response.status_code == 400:
|
|
450
|
+
raise BadRequestError(
|
|
451
|
+
headers=dict(_response.headers),
|
|
452
|
+
body=typing.cast(
|
|
453
|
+
BadRequest,
|
|
454
|
+
parse_obj_as(
|
|
455
|
+
type_=BadRequest, # type: ignore
|
|
456
|
+
object_=_response.json(),
|
|
457
|
+
),
|
|
458
|
+
),
|
|
459
|
+
)
|
|
460
|
+
if _response.status_code == 401:
|
|
461
|
+
raise UnauthorizedError(
|
|
462
|
+
headers=dict(_response.headers),
|
|
463
|
+
body=typing.cast(
|
|
464
|
+
Unauthorized,
|
|
465
|
+
parse_obj_as(
|
|
466
|
+
type_=Unauthorized, # type: ignore
|
|
467
|
+
object_=_response.json(),
|
|
468
|
+
),
|
|
469
|
+
),
|
|
470
|
+
)
|
|
471
|
+
if _response.status_code == 403:
|
|
472
|
+
raise ForbiddenError(
|
|
473
|
+
headers=dict(_response.headers),
|
|
474
|
+
body=typing.cast(
|
|
475
|
+
Forbidden,
|
|
476
|
+
parse_obj_as(
|
|
477
|
+
type_=Forbidden, # type: ignore
|
|
478
|
+
object_=_response.json(),
|
|
479
|
+
),
|
|
480
|
+
),
|
|
481
|
+
)
|
|
482
|
+
if _response.status_code == 404:
|
|
483
|
+
raise NotFoundError(
|
|
484
|
+
headers=dict(_response.headers),
|
|
485
|
+
body=typing.cast(
|
|
486
|
+
NotFound,
|
|
487
|
+
parse_obj_as(
|
|
488
|
+
type_=NotFound, # type: ignore
|
|
489
|
+
object_=_response.json(),
|
|
490
|
+
),
|
|
491
|
+
),
|
|
492
|
+
)
|
|
493
|
+
if _response.status_code == 422:
|
|
494
|
+
raise UnprocessableEntityError(
|
|
495
|
+
headers=dict(_response.headers),
|
|
496
|
+
body=typing.cast(
|
|
497
|
+
typing.Optional[typing.Any],
|
|
498
|
+
parse_obj_as(
|
|
499
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
500
|
+
object_=_response.json(),
|
|
501
|
+
),
|
|
502
|
+
),
|
|
503
|
+
)
|
|
504
|
+
if _response.status_code == 429:
|
|
505
|
+
raise TooManyRequestsError(
|
|
506
|
+
headers=dict(_response.headers),
|
|
507
|
+
body=typing.cast(
|
|
508
|
+
TooManyRequests,
|
|
509
|
+
parse_obj_as(
|
|
510
|
+
type_=TooManyRequests, # type: ignore
|
|
511
|
+
object_=_response.json(),
|
|
512
|
+
),
|
|
513
|
+
),
|
|
514
|
+
)
|
|
515
|
+
_response_json = _response.json()
|
|
516
|
+
except JSONDecodeError:
|
|
517
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
518
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
519
|
+
|
|
520
|
+
def create(
|
|
521
|
+
self,
|
|
522
|
+
account_id: Uuid,
|
|
523
|
+
workspace_id: Uuid,
|
|
524
|
+
*,
|
|
525
|
+
data: ProjectParamsData,
|
|
526
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
527
|
+
) -> HttpResponse[ProjectResponse]:
|
|
528
|
+
"""
|
|
529
|
+
Create project in a given workspace. <br><br>Rate Limits: 10 calls per 1.00 minute(s) per account
|
|
530
|
+
|
|
531
|
+
Parameters
|
|
532
|
+
----------
|
|
533
|
+
account_id : Uuid
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
workspace_id : Uuid
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
data : ProjectParamsData
|
|
540
|
+
|
|
541
|
+
request_options : typing.Optional[RequestOptions]
|
|
542
|
+
Request-specific configuration.
|
|
543
|
+
|
|
544
|
+
Returns
|
|
545
|
+
-------
|
|
546
|
+
HttpResponse[ProjectResponse]
|
|
547
|
+
Created
|
|
548
|
+
"""
|
|
549
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
550
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/workspaces/{jsonable_encoder(workspace_id)}/projects",
|
|
551
|
+
method="POST",
|
|
552
|
+
json={
|
|
553
|
+
"data": convert_and_respect_annotation_metadata(
|
|
554
|
+
object_=data, annotation=ProjectParamsData, direction="write"
|
|
555
|
+
),
|
|
556
|
+
},
|
|
557
|
+
headers={
|
|
558
|
+
"content-type": "application/json",
|
|
559
|
+
},
|
|
560
|
+
request_options=request_options,
|
|
561
|
+
omit=OMIT,
|
|
562
|
+
)
|
|
563
|
+
try:
|
|
564
|
+
if 200 <= _response.status_code < 300:
|
|
565
|
+
_data = typing.cast(
|
|
566
|
+
ProjectResponse,
|
|
567
|
+
parse_obj_as(
|
|
568
|
+
type_=ProjectResponse, # type: ignore
|
|
569
|
+
object_=_response.json(),
|
|
570
|
+
),
|
|
571
|
+
)
|
|
572
|
+
return HttpResponse(response=_response, data=_data)
|
|
573
|
+
if _response.status_code == 400:
|
|
574
|
+
raise BadRequestError(
|
|
575
|
+
headers=dict(_response.headers),
|
|
576
|
+
body=typing.cast(
|
|
577
|
+
BadRequest,
|
|
578
|
+
parse_obj_as(
|
|
579
|
+
type_=BadRequest, # type: ignore
|
|
580
|
+
object_=_response.json(),
|
|
581
|
+
),
|
|
582
|
+
),
|
|
583
|
+
)
|
|
584
|
+
if _response.status_code == 401:
|
|
585
|
+
raise UnauthorizedError(
|
|
586
|
+
headers=dict(_response.headers),
|
|
587
|
+
body=typing.cast(
|
|
588
|
+
Unauthorized,
|
|
589
|
+
parse_obj_as(
|
|
590
|
+
type_=Unauthorized, # type: ignore
|
|
591
|
+
object_=_response.json(),
|
|
592
|
+
),
|
|
593
|
+
),
|
|
594
|
+
)
|
|
595
|
+
if _response.status_code == 403:
|
|
596
|
+
raise ForbiddenError(
|
|
597
|
+
headers=dict(_response.headers),
|
|
598
|
+
body=typing.cast(
|
|
599
|
+
Forbidden,
|
|
600
|
+
parse_obj_as(
|
|
601
|
+
type_=Forbidden, # type: ignore
|
|
602
|
+
object_=_response.json(),
|
|
603
|
+
),
|
|
604
|
+
),
|
|
605
|
+
)
|
|
606
|
+
if _response.status_code == 404:
|
|
607
|
+
raise NotFoundError(
|
|
608
|
+
headers=dict(_response.headers),
|
|
609
|
+
body=typing.cast(
|
|
610
|
+
NotFound,
|
|
611
|
+
parse_obj_as(
|
|
612
|
+
type_=NotFound, # type: ignore
|
|
613
|
+
object_=_response.json(),
|
|
614
|
+
),
|
|
615
|
+
),
|
|
616
|
+
)
|
|
617
|
+
if _response.status_code == 422:
|
|
618
|
+
raise UnprocessableEntityError(
|
|
619
|
+
headers=dict(_response.headers),
|
|
620
|
+
body=typing.cast(
|
|
621
|
+
typing.Optional[typing.Any],
|
|
622
|
+
parse_obj_as(
|
|
623
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
624
|
+
object_=_response.json(),
|
|
625
|
+
),
|
|
626
|
+
),
|
|
627
|
+
)
|
|
628
|
+
if _response.status_code == 429:
|
|
629
|
+
raise TooManyRequestsError(
|
|
630
|
+
headers=dict(_response.headers),
|
|
631
|
+
body=typing.cast(
|
|
632
|
+
TooManyRequests,
|
|
633
|
+
parse_obj_as(
|
|
634
|
+
type_=TooManyRequests, # type: ignore
|
|
635
|
+
object_=_response.json(),
|
|
636
|
+
),
|
|
637
|
+
),
|
|
638
|
+
)
|
|
639
|
+
_response_json = _response.json()
|
|
640
|
+
except JSONDecodeError:
|
|
641
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
642
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
class AsyncRawProjectsClient:
|
|
646
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
647
|
+
self._client_wrapper = client_wrapper
|
|
648
|
+
|
|
649
|
+
async def show(
|
|
650
|
+
self,
|
|
651
|
+
account_id: Uuid,
|
|
652
|
+
project_id: Uuid,
|
|
653
|
+
*,
|
|
654
|
+
include: typing.Optional[typing.Literal["owner"]] = None,
|
|
655
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
656
|
+
) -> AsyncHttpResponse[ProjectWithIncludesResponse]:
|
|
657
|
+
"""
|
|
658
|
+
Show project details. <br><br>Rate Limits: 100 calls per 1.00 minute(s) per account
|
|
659
|
+
|
|
660
|
+
Parameters
|
|
661
|
+
----------
|
|
662
|
+
account_id : Uuid
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
project_id : Uuid
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
include : typing.Optional[typing.Literal["owner"]]
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
request_options : typing.Optional[RequestOptions]
|
|
672
|
+
Request-specific configuration.
|
|
673
|
+
|
|
674
|
+
Returns
|
|
675
|
+
-------
|
|
676
|
+
AsyncHttpResponse[ProjectWithIncludesResponse]
|
|
677
|
+
OK
|
|
678
|
+
"""
|
|
679
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
680
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}",
|
|
681
|
+
method="GET",
|
|
682
|
+
params={
|
|
683
|
+
"include": include,
|
|
684
|
+
},
|
|
685
|
+
request_options=request_options,
|
|
686
|
+
)
|
|
687
|
+
try:
|
|
688
|
+
if 200 <= _response.status_code < 300:
|
|
689
|
+
_data = typing.cast(
|
|
690
|
+
ProjectWithIncludesResponse,
|
|
691
|
+
parse_obj_as(
|
|
692
|
+
type_=ProjectWithIncludesResponse, # type: ignore
|
|
693
|
+
object_=_response.json(),
|
|
694
|
+
),
|
|
695
|
+
)
|
|
696
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
697
|
+
if _response.status_code == 400:
|
|
698
|
+
raise BadRequestError(
|
|
699
|
+
headers=dict(_response.headers),
|
|
700
|
+
body=typing.cast(
|
|
701
|
+
BadRequest,
|
|
702
|
+
parse_obj_as(
|
|
703
|
+
type_=BadRequest, # type: ignore
|
|
704
|
+
object_=_response.json(),
|
|
705
|
+
),
|
|
706
|
+
),
|
|
707
|
+
)
|
|
708
|
+
if _response.status_code == 401:
|
|
709
|
+
raise UnauthorizedError(
|
|
710
|
+
headers=dict(_response.headers),
|
|
711
|
+
body=typing.cast(
|
|
712
|
+
Unauthorized,
|
|
713
|
+
parse_obj_as(
|
|
714
|
+
type_=Unauthorized, # type: ignore
|
|
715
|
+
object_=_response.json(),
|
|
716
|
+
),
|
|
717
|
+
),
|
|
718
|
+
)
|
|
719
|
+
if _response.status_code == 403:
|
|
720
|
+
raise ForbiddenError(
|
|
721
|
+
headers=dict(_response.headers),
|
|
722
|
+
body=typing.cast(
|
|
723
|
+
Forbidden,
|
|
724
|
+
parse_obj_as(
|
|
725
|
+
type_=Forbidden, # type: ignore
|
|
726
|
+
object_=_response.json(),
|
|
727
|
+
),
|
|
728
|
+
),
|
|
729
|
+
)
|
|
730
|
+
if _response.status_code == 404:
|
|
731
|
+
raise NotFoundError(
|
|
732
|
+
headers=dict(_response.headers),
|
|
733
|
+
body=typing.cast(
|
|
734
|
+
NotFound,
|
|
735
|
+
parse_obj_as(
|
|
736
|
+
type_=NotFound, # type: ignore
|
|
737
|
+
object_=_response.json(),
|
|
738
|
+
),
|
|
739
|
+
),
|
|
740
|
+
)
|
|
741
|
+
if _response.status_code == 422:
|
|
742
|
+
raise UnprocessableEntityError(
|
|
743
|
+
headers=dict(_response.headers),
|
|
744
|
+
body=typing.cast(
|
|
745
|
+
typing.Optional[typing.Any],
|
|
746
|
+
parse_obj_as(
|
|
747
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
748
|
+
object_=_response.json(),
|
|
749
|
+
),
|
|
750
|
+
),
|
|
751
|
+
)
|
|
752
|
+
if _response.status_code == 429:
|
|
753
|
+
raise TooManyRequestsError(
|
|
754
|
+
headers=dict(_response.headers),
|
|
755
|
+
body=typing.cast(
|
|
756
|
+
TooManyRequests,
|
|
757
|
+
parse_obj_as(
|
|
758
|
+
type_=TooManyRequests, # type: ignore
|
|
759
|
+
object_=_response.json(),
|
|
760
|
+
),
|
|
761
|
+
),
|
|
762
|
+
)
|
|
763
|
+
_response_json = _response.json()
|
|
764
|
+
except JSONDecodeError:
|
|
765
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
766
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
767
|
+
|
|
768
|
+
async def delete(
|
|
769
|
+
self, account_id: Uuid, project_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
|
|
770
|
+
) -> AsyncHttpResponse[None]:
|
|
771
|
+
"""
|
|
772
|
+
Delete a project. <br><br>Rate Limits: 60 calls per 1.00 minute(s) per account
|
|
773
|
+
|
|
774
|
+
Parameters
|
|
775
|
+
----------
|
|
776
|
+
account_id : Uuid
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
project_id : Uuid
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
request_options : typing.Optional[RequestOptions]
|
|
783
|
+
Request-specific configuration.
|
|
784
|
+
|
|
785
|
+
Returns
|
|
786
|
+
-------
|
|
787
|
+
AsyncHttpResponse[None]
|
|
788
|
+
"""
|
|
789
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
790
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}",
|
|
791
|
+
method="DELETE",
|
|
792
|
+
request_options=request_options,
|
|
793
|
+
)
|
|
794
|
+
try:
|
|
795
|
+
if 200 <= _response.status_code < 300:
|
|
796
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
797
|
+
if _response.status_code == 400:
|
|
798
|
+
raise BadRequestError(
|
|
799
|
+
headers=dict(_response.headers),
|
|
800
|
+
body=typing.cast(
|
|
801
|
+
BadRequest,
|
|
802
|
+
parse_obj_as(
|
|
803
|
+
type_=BadRequest, # type: ignore
|
|
804
|
+
object_=_response.json(),
|
|
805
|
+
),
|
|
806
|
+
),
|
|
807
|
+
)
|
|
808
|
+
if _response.status_code == 401:
|
|
809
|
+
raise UnauthorizedError(
|
|
810
|
+
headers=dict(_response.headers),
|
|
811
|
+
body=typing.cast(
|
|
812
|
+
Unauthorized,
|
|
813
|
+
parse_obj_as(
|
|
814
|
+
type_=Unauthorized, # type: ignore
|
|
815
|
+
object_=_response.json(),
|
|
816
|
+
),
|
|
817
|
+
),
|
|
818
|
+
)
|
|
819
|
+
if _response.status_code == 403:
|
|
820
|
+
raise ForbiddenError(
|
|
821
|
+
headers=dict(_response.headers),
|
|
822
|
+
body=typing.cast(
|
|
823
|
+
Forbidden,
|
|
824
|
+
parse_obj_as(
|
|
825
|
+
type_=Forbidden, # type: ignore
|
|
826
|
+
object_=_response.json(),
|
|
827
|
+
),
|
|
828
|
+
),
|
|
829
|
+
)
|
|
830
|
+
if _response.status_code == 404:
|
|
831
|
+
raise NotFoundError(
|
|
832
|
+
headers=dict(_response.headers),
|
|
833
|
+
body=typing.cast(
|
|
834
|
+
NotFound,
|
|
835
|
+
parse_obj_as(
|
|
836
|
+
type_=NotFound, # type: ignore
|
|
837
|
+
object_=_response.json(),
|
|
838
|
+
),
|
|
839
|
+
),
|
|
840
|
+
)
|
|
841
|
+
if _response.status_code == 422:
|
|
842
|
+
raise UnprocessableEntityError(
|
|
843
|
+
headers=dict(_response.headers),
|
|
844
|
+
body=typing.cast(
|
|
845
|
+
typing.Optional[typing.Any],
|
|
846
|
+
parse_obj_as(
|
|
847
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
848
|
+
object_=_response.json(),
|
|
849
|
+
),
|
|
850
|
+
),
|
|
851
|
+
)
|
|
852
|
+
if _response.status_code == 429:
|
|
853
|
+
raise TooManyRequestsError(
|
|
854
|
+
headers=dict(_response.headers),
|
|
855
|
+
body=typing.cast(
|
|
856
|
+
TooManyRequests,
|
|
857
|
+
parse_obj_as(
|
|
858
|
+
type_=TooManyRequests, # type: ignore
|
|
859
|
+
object_=_response.json(),
|
|
860
|
+
),
|
|
861
|
+
),
|
|
862
|
+
)
|
|
863
|
+
_response_json = _response.json()
|
|
864
|
+
except JSONDecodeError:
|
|
865
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
866
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
867
|
+
|
|
868
|
+
async def update(
|
|
869
|
+
self,
|
|
870
|
+
account_id: Uuid,
|
|
871
|
+
project_id: Uuid,
|
|
872
|
+
*,
|
|
873
|
+
data: ProjectParamsData,
|
|
874
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
875
|
+
) -> AsyncHttpResponse[ProjectResponse]:
|
|
876
|
+
"""
|
|
877
|
+
Update project details. <br><br>Rate Limits: 10 calls per 1.00 minute(s) per account
|
|
878
|
+
|
|
879
|
+
Parameters
|
|
880
|
+
----------
|
|
881
|
+
account_id : Uuid
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
project_id : Uuid
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
data : ProjectParamsData
|
|
888
|
+
|
|
889
|
+
request_options : typing.Optional[RequestOptions]
|
|
890
|
+
Request-specific configuration.
|
|
891
|
+
|
|
892
|
+
Returns
|
|
893
|
+
-------
|
|
894
|
+
AsyncHttpResponse[ProjectResponse]
|
|
895
|
+
OK
|
|
896
|
+
"""
|
|
897
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
898
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/projects/{jsonable_encoder(project_id)}",
|
|
899
|
+
method="PATCH",
|
|
900
|
+
json={
|
|
901
|
+
"data": convert_and_respect_annotation_metadata(
|
|
902
|
+
object_=data, annotation=ProjectParamsData, direction="write"
|
|
903
|
+
),
|
|
904
|
+
},
|
|
905
|
+
headers={
|
|
906
|
+
"content-type": "application/json",
|
|
907
|
+
},
|
|
908
|
+
request_options=request_options,
|
|
909
|
+
omit=OMIT,
|
|
910
|
+
)
|
|
911
|
+
try:
|
|
912
|
+
if 200 <= _response.status_code < 300:
|
|
913
|
+
_data = typing.cast(
|
|
914
|
+
ProjectResponse,
|
|
915
|
+
parse_obj_as(
|
|
916
|
+
type_=ProjectResponse, # type: ignore
|
|
917
|
+
object_=_response.json(),
|
|
918
|
+
),
|
|
919
|
+
)
|
|
920
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
921
|
+
if _response.status_code == 400:
|
|
922
|
+
raise BadRequestError(
|
|
923
|
+
headers=dict(_response.headers),
|
|
924
|
+
body=typing.cast(
|
|
925
|
+
BadRequest,
|
|
926
|
+
parse_obj_as(
|
|
927
|
+
type_=BadRequest, # type: ignore
|
|
928
|
+
object_=_response.json(),
|
|
929
|
+
),
|
|
930
|
+
),
|
|
931
|
+
)
|
|
932
|
+
if _response.status_code == 401:
|
|
933
|
+
raise UnauthorizedError(
|
|
934
|
+
headers=dict(_response.headers),
|
|
935
|
+
body=typing.cast(
|
|
936
|
+
Unauthorized,
|
|
937
|
+
parse_obj_as(
|
|
938
|
+
type_=Unauthorized, # type: ignore
|
|
939
|
+
object_=_response.json(),
|
|
940
|
+
),
|
|
941
|
+
),
|
|
942
|
+
)
|
|
943
|
+
if _response.status_code == 403:
|
|
944
|
+
raise ForbiddenError(
|
|
945
|
+
headers=dict(_response.headers),
|
|
946
|
+
body=typing.cast(
|
|
947
|
+
Forbidden,
|
|
948
|
+
parse_obj_as(
|
|
949
|
+
type_=Forbidden, # type: ignore
|
|
950
|
+
object_=_response.json(),
|
|
951
|
+
),
|
|
952
|
+
),
|
|
953
|
+
)
|
|
954
|
+
if _response.status_code == 404:
|
|
955
|
+
raise NotFoundError(
|
|
956
|
+
headers=dict(_response.headers),
|
|
957
|
+
body=typing.cast(
|
|
958
|
+
NotFound,
|
|
959
|
+
parse_obj_as(
|
|
960
|
+
type_=NotFound, # type: ignore
|
|
961
|
+
object_=_response.json(),
|
|
962
|
+
),
|
|
963
|
+
),
|
|
964
|
+
)
|
|
965
|
+
if _response.status_code == 422:
|
|
966
|
+
raise UnprocessableEntityError(
|
|
967
|
+
headers=dict(_response.headers),
|
|
968
|
+
body=typing.cast(
|
|
969
|
+
typing.Optional[typing.Any],
|
|
970
|
+
parse_obj_as(
|
|
971
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
972
|
+
object_=_response.json(),
|
|
973
|
+
),
|
|
974
|
+
),
|
|
975
|
+
)
|
|
976
|
+
if _response.status_code == 429:
|
|
977
|
+
raise TooManyRequestsError(
|
|
978
|
+
headers=dict(_response.headers),
|
|
979
|
+
body=typing.cast(
|
|
980
|
+
TooManyRequests,
|
|
981
|
+
parse_obj_as(
|
|
982
|
+
type_=TooManyRequests, # type: ignore
|
|
983
|
+
object_=_response.json(),
|
|
984
|
+
),
|
|
985
|
+
),
|
|
986
|
+
)
|
|
987
|
+
_response_json = _response.json()
|
|
988
|
+
except JSONDecodeError:
|
|
989
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
990
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
991
|
+
|
|
992
|
+
async def index(
|
|
993
|
+
self,
|
|
994
|
+
account_id: Uuid,
|
|
995
|
+
workspace_id: Uuid,
|
|
996
|
+
*,
|
|
997
|
+
include: typing.Optional[typing.Literal["owner"]] = None,
|
|
998
|
+
after: typing.Optional[RequestAfterOpaqueCursor] = None,
|
|
999
|
+
page_size: typing.Optional[RequestPageSize] = None,
|
|
1000
|
+
include_total_count: typing.Optional[IncludeTotalCount] = None,
|
|
1001
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1002
|
+
) -> AsyncHttpResponse[ProjectsWithIncludesResponse]:
|
|
1003
|
+
"""
|
|
1004
|
+
List projects in a given workspace. <br><br>Rate Limits: 100 calls per 1.00 minute(s) per account
|
|
1005
|
+
|
|
1006
|
+
Parameters
|
|
1007
|
+
----------
|
|
1008
|
+
account_id : Uuid
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
workspace_id : Uuid
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
include : typing.Optional[typing.Literal["owner"]]
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
after : typing.Optional[RequestAfterOpaqueCursor]
|
|
1018
|
+
Opaque Cursor query param for requests returning paginated results.
|
|
1019
|
+
<br/>
|
|
1020
|
+
NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
|
|
1021
|
+
|
|
1022
|
+
page_size : typing.Optional[RequestPageSize]
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
include_total_count : typing.Optional[IncludeTotalCount]
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
request_options : typing.Optional[RequestOptions]
|
|
1029
|
+
Request-specific configuration.
|
|
1030
|
+
|
|
1031
|
+
Returns
|
|
1032
|
+
-------
|
|
1033
|
+
AsyncHttpResponse[ProjectsWithIncludesResponse]
|
|
1034
|
+
OK
|
|
1035
|
+
"""
|
|
1036
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1037
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/workspaces/{jsonable_encoder(workspace_id)}/projects",
|
|
1038
|
+
method="GET",
|
|
1039
|
+
params={
|
|
1040
|
+
"include": include,
|
|
1041
|
+
"after": after,
|
|
1042
|
+
"page_size": page_size,
|
|
1043
|
+
"include_total_count": include_total_count,
|
|
1044
|
+
},
|
|
1045
|
+
request_options=request_options,
|
|
1046
|
+
)
|
|
1047
|
+
try:
|
|
1048
|
+
if 200 <= _response.status_code < 300:
|
|
1049
|
+
_data = typing.cast(
|
|
1050
|
+
ProjectsWithIncludesResponse,
|
|
1051
|
+
parse_obj_as(
|
|
1052
|
+
type_=ProjectsWithIncludesResponse, # type: ignore
|
|
1053
|
+
object_=_response.json(),
|
|
1054
|
+
),
|
|
1055
|
+
)
|
|
1056
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1057
|
+
if _response.status_code == 400:
|
|
1058
|
+
raise BadRequestError(
|
|
1059
|
+
headers=dict(_response.headers),
|
|
1060
|
+
body=typing.cast(
|
|
1061
|
+
BadRequest,
|
|
1062
|
+
parse_obj_as(
|
|
1063
|
+
type_=BadRequest, # type: ignore
|
|
1064
|
+
object_=_response.json(),
|
|
1065
|
+
),
|
|
1066
|
+
),
|
|
1067
|
+
)
|
|
1068
|
+
if _response.status_code == 401:
|
|
1069
|
+
raise UnauthorizedError(
|
|
1070
|
+
headers=dict(_response.headers),
|
|
1071
|
+
body=typing.cast(
|
|
1072
|
+
Unauthorized,
|
|
1073
|
+
parse_obj_as(
|
|
1074
|
+
type_=Unauthorized, # type: ignore
|
|
1075
|
+
object_=_response.json(),
|
|
1076
|
+
),
|
|
1077
|
+
),
|
|
1078
|
+
)
|
|
1079
|
+
if _response.status_code == 403:
|
|
1080
|
+
raise ForbiddenError(
|
|
1081
|
+
headers=dict(_response.headers),
|
|
1082
|
+
body=typing.cast(
|
|
1083
|
+
Forbidden,
|
|
1084
|
+
parse_obj_as(
|
|
1085
|
+
type_=Forbidden, # type: ignore
|
|
1086
|
+
object_=_response.json(),
|
|
1087
|
+
),
|
|
1088
|
+
),
|
|
1089
|
+
)
|
|
1090
|
+
if _response.status_code == 404:
|
|
1091
|
+
raise NotFoundError(
|
|
1092
|
+
headers=dict(_response.headers),
|
|
1093
|
+
body=typing.cast(
|
|
1094
|
+
NotFound,
|
|
1095
|
+
parse_obj_as(
|
|
1096
|
+
type_=NotFound, # type: ignore
|
|
1097
|
+
object_=_response.json(),
|
|
1098
|
+
),
|
|
1099
|
+
),
|
|
1100
|
+
)
|
|
1101
|
+
if _response.status_code == 422:
|
|
1102
|
+
raise UnprocessableEntityError(
|
|
1103
|
+
headers=dict(_response.headers),
|
|
1104
|
+
body=typing.cast(
|
|
1105
|
+
typing.Optional[typing.Any],
|
|
1106
|
+
parse_obj_as(
|
|
1107
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
1108
|
+
object_=_response.json(),
|
|
1109
|
+
),
|
|
1110
|
+
),
|
|
1111
|
+
)
|
|
1112
|
+
if _response.status_code == 429:
|
|
1113
|
+
raise TooManyRequestsError(
|
|
1114
|
+
headers=dict(_response.headers),
|
|
1115
|
+
body=typing.cast(
|
|
1116
|
+
TooManyRequests,
|
|
1117
|
+
parse_obj_as(
|
|
1118
|
+
type_=TooManyRequests, # type: ignore
|
|
1119
|
+
object_=_response.json(),
|
|
1120
|
+
),
|
|
1121
|
+
),
|
|
1122
|
+
)
|
|
1123
|
+
_response_json = _response.json()
|
|
1124
|
+
except JSONDecodeError:
|
|
1125
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1126
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1127
|
+
|
|
1128
|
+
async def create(
|
|
1129
|
+
self,
|
|
1130
|
+
account_id: Uuid,
|
|
1131
|
+
workspace_id: Uuid,
|
|
1132
|
+
*,
|
|
1133
|
+
data: ProjectParamsData,
|
|
1134
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1135
|
+
) -> AsyncHttpResponse[ProjectResponse]:
|
|
1136
|
+
"""
|
|
1137
|
+
Create project in a given workspace. <br><br>Rate Limits: 10 calls per 1.00 minute(s) per account
|
|
1138
|
+
|
|
1139
|
+
Parameters
|
|
1140
|
+
----------
|
|
1141
|
+
account_id : Uuid
|
|
1142
|
+
|
|
1143
|
+
|
|
1144
|
+
workspace_id : Uuid
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
data : ProjectParamsData
|
|
1148
|
+
|
|
1149
|
+
request_options : typing.Optional[RequestOptions]
|
|
1150
|
+
Request-specific configuration.
|
|
1151
|
+
|
|
1152
|
+
Returns
|
|
1153
|
+
-------
|
|
1154
|
+
AsyncHttpResponse[ProjectResponse]
|
|
1155
|
+
Created
|
|
1156
|
+
"""
|
|
1157
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1158
|
+
f"v4/accounts/{jsonable_encoder(account_id)}/workspaces/{jsonable_encoder(workspace_id)}/projects",
|
|
1159
|
+
method="POST",
|
|
1160
|
+
json={
|
|
1161
|
+
"data": convert_and_respect_annotation_metadata(
|
|
1162
|
+
object_=data, annotation=ProjectParamsData, direction="write"
|
|
1163
|
+
),
|
|
1164
|
+
},
|
|
1165
|
+
headers={
|
|
1166
|
+
"content-type": "application/json",
|
|
1167
|
+
},
|
|
1168
|
+
request_options=request_options,
|
|
1169
|
+
omit=OMIT,
|
|
1170
|
+
)
|
|
1171
|
+
try:
|
|
1172
|
+
if 200 <= _response.status_code < 300:
|
|
1173
|
+
_data = typing.cast(
|
|
1174
|
+
ProjectResponse,
|
|
1175
|
+
parse_obj_as(
|
|
1176
|
+
type_=ProjectResponse, # type: ignore
|
|
1177
|
+
object_=_response.json(),
|
|
1178
|
+
),
|
|
1179
|
+
)
|
|
1180
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1181
|
+
if _response.status_code == 400:
|
|
1182
|
+
raise BadRequestError(
|
|
1183
|
+
headers=dict(_response.headers),
|
|
1184
|
+
body=typing.cast(
|
|
1185
|
+
BadRequest,
|
|
1186
|
+
parse_obj_as(
|
|
1187
|
+
type_=BadRequest, # type: ignore
|
|
1188
|
+
object_=_response.json(),
|
|
1189
|
+
),
|
|
1190
|
+
),
|
|
1191
|
+
)
|
|
1192
|
+
if _response.status_code == 401:
|
|
1193
|
+
raise UnauthorizedError(
|
|
1194
|
+
headers=dict(_response.headers),
|
|
1195
|
+
body=typing.cast(
|
|
1196
|
+
Unauthorized,
|
|
1197
|
+
parse_obj_as(
|
|
1198
|
+
type_=Unauthorized, # type: ignore
|
|
1199
|
+
object_=_response.json(),
|
|
1200
|
+
),
|
|
1201
|
+
),
|
|
1202
|
+
)
|
|
1203
|
+
if _response.status_code == 403:
|
|
1204
|
+
raise ForbiddenError(
|
|
1205
|
+
headers=dict(_response.headers),
|
|
1206
|
+
body=typing.cast(
|
|
1207
|
+
Forbidden,
|
|
1208
|
+
parse_obj_as(
|
|
1209
|
+
type_=Forbidden, # type: ignore
|
|
1210
|
+
object_=_response.json(),
|
|
1211
|
+
),
|
|
1212
|
+
),
|
|
1213
|
+
)
|
|
1214
|
+
if _response.status_code == 404:
|
|
1215
|
+
raise NotFoundError(
|
|
1216
|
+
headers=dict(_response.headers),
|
|
1217
|
+
body=typing.cast(
|
|
1218
|
+
NotFound,
|
|
1219
|
+
parse_obj_as(
|
|
1220
|
+
type_=NotFound, # type: ignore
|
|
1221
|
+
object_=_response.json(),
|
|
1222
|
+
),
|
|
1223
|
+
),
|
|
1224
|
+
)
|
|
1225
|
+
if _response.status_code == 422:
|
|
1226
|
+
raise UnprocessableEntityError(
|
|
1227
|
+
headers=dict(_response.headers),
|
|
1228
|
+
body=typing.cast(
|
|
1229
|
+
typing.Optional[typing.Any],
|
|
1230
|
+
parse_obj_as(
|
|
1231
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
1232
|
+
object_=_response.json(),
|
|
1233
|
+
),
|
|
1234
|
+
),
|
|
1235
|
+
)
|
|
1236
|
+
if _response.status_code == 429:
|
|
1237
|
+
raise TooManyRequestsError(
|
|
1238
|
+
headers=dict(_response.headers),
|
|
1239
|
+
body=typing.cast(
|
|
1240
|
+
TooManyRequests,
|
|
1241
|
+
parse_obj_as(
|
|
1242
|
+
type_=TooManyRequests, # type: ignore
|
|
1243
|
+
object_=_response.json(),
|
|
1244
|
+
),
|
|
1245
|
+
),
|
|
1246
|
+
)
|
|
1247
|
+
_response_json = _response.json()
|
|
1248
|
+
except JSONDecodeError:
|
|
1249
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1250
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|