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,38 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .create_comment_params_data import CreateCommentParamsData
|
|
10
|
+
from .update_comment_params_data import UpdateCommentParamsData
|
|
11
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
12
|
+
"CreateCommentParamsData": ".create_comment_params_data",
|
|
13
|
+
"UpdateCommentParamsData": ".update_comment_params_data",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
18
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
19
|
+
if module_name is None:
|
|
20
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
21
|
+
try:
|
|
22
|
+
module = import_module(module_name, __package__)
|
|
23
|
+
if module_name == f".{attr_name}":
|
|
24
|
+
return module
|
|
25
|
+
else:
|
|
26
|
+
return getattr(module, attr_name)
|
|
27
|
+
except ImportError as e:
|
|
28
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
29
|
+
except AttributeError as e:
|
|
30
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def __dir__():
|
|
34
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
35
|
+
return sorted(lazy_attrs)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
__all__ = ["CreateCommentParamsData", "UpdateCommentParamsData"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class CreateCommentParamsData(UniversalBaseModel):
|
|
10
|
+
page: typing.Optional[int] = pydantic.Field(default=None)
|
|
11
|
+
"""
|
|
12
|
+
Document page. Only allowed when file type is a pdf document
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
text: str = pydantic.Field()
|
|
16
|
+
"""
|
|
17
|
+
Comment text (required)
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
timestamp: typing.Optional[float] = pydantic.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
Comment frame number in media. Only allowed when file type is 'audio', 'stream', or 'video'.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UpdateCommentParamsData(UniversalBaseModel):
|
|
10
|
+
page: typing.Optional[int] = pydantic.Field(default=None)
|
|
11
|
+
"""
|
|
12
|
+
Document page. Only allowed when file type is a pdf document
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
text: typing.Optional[str] = pydantic.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
Comment text
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
timestamp: typing.Optional[float] = pydantic.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
Comment frame number in media. Only allowed when file type is 'audio', 'stream', or 'video'.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
frameio/core/__init__.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .api_error import ApiError
|
|
10
|
+
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
|
|
11
|
+
from .datetime_utils import serialize_datetime
|
|
12
|
+
from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
|
|
13
|
+
from .http_client import AsyncHttpClient, HttpClient
|
|
14
|
+
from .http_response import AsyncHttpResponse, HttpResponse
|
|
15
|
+
from .jsonable_encoder import jsonable_encoder
|
|
16
|
+
from .pagination import AsyncPager, SyncPager
|
|
17
|
+
from .pydantic_utilities import (
|
|
18
|
+
IS_PYDANTIC_V2,
|
|
19
|
+
UniversalBaseModel,
|
|
20
|
+
UniversalRootModel,
|
|
21
|
+
parse_obj_as,
|
|
22
|
+
universal_field_validator,
|
|
23
|
+
universal_root_validator,
|
|
24
|
+
update_forward_refs,
|
|
25
|
+
)
|
|
26
|
+
from .query_encoder import encode_query
|
|
27
|
+
from .remove_none_from_dict import remove_none_from_dict
|
|
28
|
+
from .request_options import RequestOptions
|
|
29
|
+
from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
|
|
30
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
31
|
+
"ApiError": ".api_error",
|
|
32
|
+
"AsyncClientWrapper": ".client_wrapper",
|
|
33
|
+
"AsyncHttpClient": ".http_client",
|
|
34
|
+
"AsyncHttpResponse": ".http_response",
|
|
35
|
+
"AsyncPager": ".pagination",
|
|
36
|
+
"BaseClientWrapper": ".client_wrapper",
|
|
37
|
+
"FieldMetadata": ".serialization",
|
|
38
|
+
"File": ".file",
|
|
39
|
+
"HttpClient": ".http_client",
|
|
40
|
+
"HttpResponse": ".http_response",
|
|
41
|
+
"IS_PYDANTIC_V2": ".pydantic_utilities",
|
|
42
|
+
"RequestOptions": ".request_options",
|
|
43
|
+
"SyncClientWrapper": ".client_wrapper",
|
|
44
|
+
"SyncPager": ".pagination",
|
|
45
|
+
"UniversalBaseModel": ".pydantic_utilities",
|
|
46
|
+
"UniversalRootModel": ".pydantic_utilities",
|
|
47
|
+
"convert_and_respect_annotation_metadata": ".serialization",
|
|
48
|
+
"convert_file_dict_to_httpx_tuples": ".file",
|
|
49
|
+
"encode_query": ".query_encoder",
|
|
50
|
+
"jsonable_encoder": ".jsonable_encoder",
|
|
51
|
+
"parse_obj_as": ".pydantic_utilities",
|
|
52
|
+
"remove_none_from_dict": ".remove_none_from_dict",
|
|
53
|
+
"serialize_datetime": ".datetime_utils",
|
|
54
|
+
"universal_field_validator": ".pydantic_utilities",
|
|
55
|
+
"universal_root_validator": ".pydantic_utilities",
|
|
56
|
+
"update_forward_refs": ".pydantic_utilities",
|
|
57
|
+
"with_content_type": ".file",
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
62
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
63
|
+
if module_name is None:
|
|
64
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
65
|
+
try:
|
|
66
|
+
module = import_module(module_name, __package__)
|
|
67
|
+
if module_name == f".{attr_name}":
|
|
68
|
+
return module
|
|
69
|
+
else:
|
|
70
|
+
return getattr(module, attr_name)
|
|
71
|
+
except ImportError as e:
|
|
72
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
73
|
+
except AttributeError as e:
|
|
74
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def __dir__():
|
|
78
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
79
|
+
return sorted(lazy_attrs)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
__all__ = [
|
|
83
|
+
"ApiError",
|
|
84
|
+
"AsyncClientWrapper",
|
|
85
|
+
"AsyncHttpClient",
|
|
86
|
+
"AsyncHttpResponse",
|
|
87
|
+
"AsyncPager",
|
|
88
|
+
"BaseClientWrapper",
|
|
89
|
+
"FieldMetadata",
|
|
90
|
+
"File",
|
|
91
|
+
"HttpClient",
|
|
92
|
+
"HttpResponse",
|
|
93
|
+
"IS_PYDANTIC_V2",
|
|
94
|
+
"RequestOptions",
|
|
95
|
+
"SyncClientWrapper",
|
|
96
|
+
"SyncPager",
|
|
97
|
+
"UniversalBaseModel",
|
|
98
|
+
"UniversalRootModel",
|
|
99
|
+
"convert_and_respect_annotation_metadata",
|
|
100
|
+
"convert_file_dict_to_httpx_tuples",
|
|
101
|
+
"encode_query",
|
|
102
|
+
"jsonable_encoder",
|
|
103
|
+
"parse_obj_as",
|
|
104
|
+
"remove_none_from_dict",
|
|
105
|
+
"serialize_datetime",
|
|
106
|
+
"universal_field_validator",
|
|
107
|
+
"universal_root_validator",
|
|
108
|
+
"update_forward_refs",
|
|
109
|
+
"with_content_type",
|
|
110
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ApiError(Exception):
|
|
7
|
+
headers: Optional[Dict[str, str]]
|
|
8
|
+
status_code: Optional[int]
|
|
9
|
+
body: Any
|
|
10
|
+
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
*,
|
|
14
|
+
headers: Optional[Dict[str, str]] = None,
|
|
15
|
+
status_code: Optional[int] = None,
|
|
16
|
+
body: Any = None,
|
|
17
|
+
) -> None:
|
|
18
|
+
self.headers = headers
|
|
19
|
+
self.status_code = status_code
|
|
20
|
+
self.body = body
|
|
21
|
+
|
|
22
|
+
def __str__(self) -> str:
|
|
23
|
+
return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}"
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
from .http_client import AsyncHttpClient, HttpClient
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BaseClientWrapper:
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
*,
|
|
13
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
14
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
15
|
+
base_url: str,
|
|
16
|
+
timeout: typing.Optional[float] = None,
|
|
17
|
+
):
|
|
18
|
+
self._token = token
|
|
19
|
+
self._headers = headers
|
|
20
|
+
self._base_url = base_url
|
|
21
|
+
self._timeout = timeout
|
|
22
|
+
|
|
23
|
+
def get_headers(self) -> typing.Dict[str, str]:
|
|
24
|
+
headers: typing.Dict[str, str] = {
|
|
25
|
+
"User-Agent": "frameio/v0.0.23",
|
|
26
|
+
"X-Fern-Language": "Python",
|
|
27
|
+
"X-Fern-SDK-Name": "frameio",
|
|
28
|
+
"X-Fern-SDK-Version": "v0.0.23",
|
|
29
|
+
**(self.get_custom_headers() or {}),
|
|
30
|
+
}
|
|
31
|
+
token = self._get_token()
|
|
32
|
+
if token is not None:
|
|
33
|
+
headers["Authorization"] = f"Bearer {token}"
|
|
34
|
+
return headers
|
|
35
|
+
|
|
36
|
+
def _get_token(self) -> typing.Optional[str]:
|
|
37
|
+
if isinstance(self._token, str) or self._token is None:
|
|
38
|
+
return self._token
|
|
39
|
+
else:
|
|
40
|
+
return self._token()
|
|
41
|
+
|
|
42
|
+
def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]:
|
|
43
|
+
return self._headers
|
|
44
|
+
|
|
45
|
+
def get_base_url(self) -> str:
|
|
46
|
+
return self._base_url
|
|
47
|
+
|
|
48
|
+
def get_timeout(self) -> typing.Optional[float]:
|
|
49
|
+
return self._timeout
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class SyncClientWrapper(BaseClientWrapper):
|
|
53
|
+
def __init__(
|
|
54
|
+
self,
|
|
55
|
+
*,
|
|
56
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
57
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
58
|
+
base_url: str,
|
|
59
|
+
timeout: typing.Optional[float] = None,
|
|
60
|
+
httpx_client: httpx.Client,
|
|
61
|
+
):
|
|
62
|
+
super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout)
|
|
63
|
+
self.httpx_client = HttpClient(
|
|
64
|
+
httpx_client=httpx_client,
|
|
65
|
+
base_headers=self.get_headers,
|
|
66
|
+
base_timeout=self.get_timeout,
|
|
67
|
+
base_url=self.get_base_url,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class AsyncClientWrapper(BaseClientWrapper):
|
|
72
|
+
def __init__(
|
|
73
|
+
self,
|
|
74
|
+
*,
|
|
75
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
76
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
77
|
+
base_url: str,
|
|
78
|
+
timeout: typing.Optional[float] = None,
|
|
79
|
+
httpx_client: httpx.AsyncClient,
|
|
80
|
+
):
|
|
81
|
+
super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout)
|
|
82
|
+
self.httpx_client = AsyncHttpClient(
|
|
83
|
+
httpx_client=httpx_client,
|
|
84
|
+
base_headers=self.get_headers,
|
|
85
|
+
base_timeout=self.get_timeout,
|
|
86
|
+
base_url=self.get_base_url,
|
|
87
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def serialize_datetime(v: dt.datetime) -> str:
|
|
7
|
+
"""
|
|
8
|
+
Serialize a datetime including timezone info.
|
|
9
|
+
|
|
10
|
+
Uses the timezone info provided if present, otherwise uses the current runtime's timezone info.
|
|
11
|
+
|
|
12
|
+
UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def _serialize_zoned_datetime(v: dt.datetime) -> str:
|
|
16
|
+
if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None):
|
|
17
|
+
# UTC is a special case where we use "Z" at the end instead of "+00:00"
|
|
18
|
+
return v.isoformat().replace("+00:00", "Z")
|
|
19
|
+
else:
|
|
20
|
+
# Delegate to the typical +/- offset format
|
|
21
|
+
return v.isoformat()
|
|
22
|
+
|
|
23
|
+
if v.tzinfo is not None:
|
|
24
|
+
return _serialize_zoned_datetime(v)
|
|
25
|
+
else:
|
|
26
|
+
local_tz = dt.datetime.now().astimezone().tzinfo
|
|
27
|
+
localized_dt = v.replace(tzinfo=local_tz)
|
|
28
|
+
return _serialize_zoned_datetime(localized_dt)
|
frameio/core/file.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast
|
|
4
|
+
|
|
5
|
+
# File typing inspired by the flexibility of types within the httpx library
|
|
6
|
+
# https://github.com/encode/httpx/blob/master/httpx/_types.py
|
|
7
|
+
FileContent = Union[IO[bytes], bytes, str]
|
|
8
|
+
File = Union[
|
|
9
|
+
# file (or bytes)
|
|
10
|
+
FileContent,
|
|
11
|
+
# (filename, file (or bytes))
|
|
12
|
+
Tuple[Optional[str], FileContent],
|
|
13
|
+
# (filename, file (or bytes), content_type)
|
|
14
|
+
Tuple[Optional[str], FileContent, Optional[str]],
|
|
15
|
+
# (filename, file (or bytes), content_type, headers)
|
|
16
|
+
Tuple[
|
|
17
|
+
Optional[str],
|
|
18
|
+
FileContent,
|
|
19
|
+
Optional[str],
|
|
20
|
+
Mapping[str, str],
|
|
21
|
+
],
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def convert_file_dict_to_httpx_tuples(
|
|
26
|
+
d: Dict[str, Union[File, List[File]]],
|
|
27
|
+
) -> List[Tuple[str, File]]:
|
|
28
|
+
"""
|
|
29
|
+
The format we use is a list of tuples, where the first element is the
|
|
30
|
+
name of the file and the second is the file object. Typically HTTPX wants
|
|
31
|
+
a dict, but to be able to send lists of files, you have to use the list
|
|
32
|
+
approach (which also works for non-lists)
|
|
33
|
+
https://github.com/encode/httpx/pull/1032
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
httpx_tuples = []
|
|
37
|
+
for key, file_like in d.items():
|
|
38
|
+
if isinstance(file_like, list):
|
|
39
|
+
for file_like_item in file_like:
|
|
40
|
+
httpx_tuples.append((key, file_like_item))
|
|
41
|
+
else:
|
|
42
|
+
httpx_tuples.append((key, file_like))
|
|
43
|
+
return httpx_tuples
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def with_content_type(*, file: File, default_content_type: str) -> File:
|
|
47
|
+
"""
|
|
48
|
+
This function resolves to the file's content type, if provided, and defaults
|
|
49
|
+
to the default_content_type value if not.
|
|
50
|
+
"""
|
|
51
|
+
if isinstance(file, tuple):
|
|
52
|
+
if len(file) == 2:
|
|
53
|
+
filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore
|
|
54
|
+
return (filename, content, default_content_type)
|
|
55
|
+
elif len(file) == 3:
|
|
56
|
+
filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore
|
|
57
|
+
out_content_type = file_content_type or default_content_type
|
|
58
|
+
return (filename, content, out_content_type)
|
|
59
|
+
elif len(file) == 4:
|
|
60
|
+
filename, content, file_content_type, headers = cast( # type: ignore
|
|
61
|
+
Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file
|
|
62
|
+
)
|
|
63
|
+
out_content_type = file_content_type or default_content_type
|
|
64
|
+
return (filename, content, out_content_type, headers)
|
|
65
|
+
else:
|
|
66
|
+
raise ValueError(f"Unexpected tuple length: {len(file)}")
|
|
67
|
+
return (None, file, default_content_type)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ForceMultipartDict(Dict[str, Any]):
|
|
7
|
+
"""
|
|
8
|
+
A dictionary subclass that always evaluates to True in boolean contexts.
|
|
9
|
+
|
|
10
|
+
This is used to force multipart/form-data encoding in HTTP requests even when
|
|
11
|
+
the dictionary is empty, which would normally evaluate to False.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __bool__(self) -> bool:
|
|
15
|
+
return True
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
FORCE_MULTIPART = ForceMultipartDict()
|