appwrite-console 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- appwrite_console/__init__.py +1 -0
- appwrite_console/client.py +371 -0
- appwrite_console/encoders/__init__.py +1 -0
- appwrite_console/encoders/value_class_encoder.py +373 -0
- appwrite_console/enums/__init__.py +1 -0
- appwrite_console/enums/account_key_scopes.py +6 -0
- appwrite_console/enums/adapter.py +5 -0
- appwrite_console/enums/addon.py +7 -0
- appwrite_console/enums/appwrite_migration_resource.py +42 -0
- appwrite_console/enums/attribute_status.py +8 -0
- appwrite_console/enums/authentication_factor.py +7 -0
- appwrite_console/enums/authenticator_type.py +4 -0
- appwrite_console/enums/backup_services.py +10 -0
- appwrite_console/enums/billing_plan_group.py +6 -0
- appwrite_console/enums/block_mode.py +5 -0
- appwrite_console/enums/block_resource_type.py +12 -0
- appwrite_console/enums/browser.py +17 -0
- appwrite_console/enums/browser_permission.py +23 -0
- appwrite_console/enums/browser_theme.py +5 -0
- appwrite_console/enums/build_runtime.py +95 -0
- appwrite_console/enums/cache_database.py +6 -0
- appwrite_console/enums/cache_target.py +9 -0
- appwrite_console/enums/column_status.py +8 -0
- appwrite_console/enums/compression.py +6 -0
- appwrite_console/enums/console_resource_type.py +4 -0
- appwrite_console/enums/credit_card.py +20 -0
- appwrite_console/enums/database_status.py +17 -0
- appwrite_console/enums/database_type.py +10 -0
- appwrite_console/enums/databases_index_type.py +7 -0
- appwrite_console/enums/deployment_download_type.py +5 -0
- appwrite_console/enums/deployment_status.py +9 -0
- appwrite_console/enums/detection_framework_type.py +4 -0
- appwrite_console/enums/detection_runtime_type.py +4 -0
- appwrite_console/enums/documents_db_index_type.py +6 -0
- appwrite_console/enums/domain_purchase_status.py +7 -0
- appwrite_console/enums/domain_registration_type.py +7 -0
- appwrite_console/enums/domain_suggestion_type.py +5 -0
- appwrite_console/enums/domain_transfer_status_enum.py +11 -0
- appwrite_console/enums/embedding_model.py +7 -0
- appwrite_console/enums/execution_method.py +10 -0
- appwrite_console/enums/execution_status.py +8 -0
- appwrite_console/enums/execution_trigger.py +6 -0
- appwrite_console/enums/firebase_migration_resource.py +13 -0
- appwrite_console/enums/flag.py +198 -0
- appwrite_console/enums/framework.py +18 -0
- appwrite_console/enums/function_template_use_case.py +10 -0
- appwrite_console/enums/image_format.py +10 -0
- appwrite_console/enums/image_gravity.py +12 -0
- appwrite_console/enums/index_status.py +8 -0
- appwrite_console/enums/message_priority.py +5 -0
- appwrite_console/enums/message_status.py +8 -0
- appwrite_console/enums/messaging_provider_type.py +6 -0
- appwrite_console/enums/n_host_migration_resource.py +14 -0
- appwrite_console/enums/o_auth2_google_prompt.py +6 -0
- appwrite_console/enums/o_auth2_oidc_prompt.py +7 -0
- appwrite_console/enums/o_auth_provider.py +47 -0
- appwrite_console/enums/on_duplicate.py +6 -0
- appwrite_console/enums/order_by.py +5 -0
- appwrite_console/enums/organization_key_scopes.py +19 -0
- appwrite_console/enums/password_hash.py +14 -0
- appwrite_console/enums/platform.py +5 -0
- appwrite_console/enums/platform_type.py +8 -0
- appwrite_console/enums/project_auth_method_id.py +10 -0
- appwrite_console/enums/project_email_template_id.py +10 -0
- appwrite_console/enums/project_email_template_locale.py +134 -0
- appwrite_console/enums/project_key_scopes.py +107 -0
- appwrite_console/enums/project_o_auth2_google_prompt.py +6 -0
- appwrite_console/enums/project_o_auth2_oidc_prompt.py +7 -0
- appwrite_console/enums/project_o_auth_provider_id.py +47 -0
- appwrite_console/enums/project_policy_id.py +17 -0
- appwrite_console/enums/project_protocol_id.py +6 -0
- appwrite_console/enums/project_service_id.py +22 -0
- appwrite_console/enums/project_smtp_secure.py +5 -0
- appwrite_console/enums/project_usage_range.py +5 -0
- appwrite_console/enums/proxy_resource_type.py +5 -0
- appwrite_console/enums/proxy_rule_deployment_resource_type.py +5 -0
- appwrite_console/enums/proxy_rule_status.py +6 -0
- appwrite_console/enums/query_suggestion_resource.py +97 -0
- appwrite_console/enums/region.py +9 -0
- appwrite_console/enums/relation_mutate.py +6 -0
- appwrite_console/enums/relationship_type.py +7 -0
- appwrite_console/enums/runtime.py +95 -0
- appwrite_console/enums/schedule_resource_type.py +7 -0
- appwrite_console/enums/site_template_use_case.py +12 -0
- appwrite_console/enums/smtp_encryption.py +6 -0
- appwrite_console/enums/status.py +4 -0
- appwrite_console/enums/status_code.py +7 -0
- appwrite_console/enums/supabase_migration_resource.py +14 -0
- appwrite_console/enums/tables_db_index_type.py +7 -0
- appwrite_console/enums/template_reference_type.py +6 -0
- appwrite_console/enums/timezone.py +422 -0
- appwrite_console/enums/usage_range.py +6 -0
- appwrite_console/enums/vcs_detection_type.py +5 -0
- appwrite_console/enums/vcs_reference_type.py +6 -0
- appwrite_console/enums/vectors_db_index_type.py +9 -0
- appwrite_console/enums/waf_rule_action.py +8 -0
- appwrite_console/exception.py +7 -0
- appwrite_console/id.py +26 -0
- appwrite_console/input_file.py +21 -0
- appwrite_console/models/__init__.py +803 -0
- appwrite_console/models/activity_event.py +99 -0
- appwrite_console/models/activity_event_list.py +19 -0
- appwrite_console/models/additional_resource.py +30 -0
- appwrite_console/models/addon.py +42 -0
- appwrite_console/models/addon_list.py +19 -0
- appwrite_console/models/addon_price.py +36 -0
- appwrite_console/models/aggregation_breakdown.py +28 -0
- appwrite_console/models/aggregation_team.py +101 -0
- appwrite_console/models/aggregation_team_list.py +19 -0
- appwrite_console/models/algo_argon2.py +24 -0
- appwrite_console/models/algo_bcrypt.py +15 -0
- appwrite_console/models/algo_md5.py +15 -0
- appwrite_console/models/algo_phpass.py +15 -0
- appwrite_console/models/algo_scrypt.py +27 -0
- appwrite_console/models/algo_scrypt_modified.py +24 -0
- appwrite_console/models/algo_sha.py +15 -0
- appwrite_console/models/app.py +91 -0
- appwrite_console/models/app_installation.py +42 -0
- appwrite_console/models/app_installation_list.py +19 -0
- appwrite_console/models/app_key.py +39 -0
- appwrite_console/models/app_key_list.py +19 -0
- appwrite_console/models/app_scope.py +27 -0
- appwrite_console/models/app_scope_list.py +19 -0
- appwrite_console/models/app_secret.py +39 -0
- appwrite_console/models/app_secret_list.py +19 -0
- appwrite_console/models/app_secret_plaintext.py +39 -0
- appwrite_console/models/apps_list.py +19 -0
- appwrite_console/models/attribute_bigint.py +46 -0
- appwrite_console/models/attribute_boolean.py +40 -0
- appwrite_console/models/attribute_datetime.py +43 -0
- appwrite_console/models/attribute_email.py +43 -0
- appwrite_console/models/attribute_enum.py +46 -0
- appwrite_console/models/attribute_float.py +46 -0
- appwrite_console/models/attribute_integer.py +46 -0
- appwrite_console/models/attribute_ip.py +43 -0
- appwrite_console/models/attribute_line.py +40 -0
- appwrite_console/models/attribute_list.py +36 -0
- appwrite_console/models/attribute_longtext.py +43 -0
- appwrite_console/models/attribute_mediumtext.py +43 -0
- appwrite_console/models/attribute_object.py +37 -0
- appwrite_console/models/attribute_point.py +40 -0
- appwrite_console/models/attribute_polygon.py +40 -0
- appwrite_console/models/attribute_relationship.py +55 -0
- appwrite_console/models/attribute_string.py +46 -0
- appwrite_console/models/attribute_text.py +43 -0
- appwrite_console/models/attribute_url.py +43 -0
- appwrite_console/models/attribute_varchar.py +46 -0
- appwrite_console/models/attribute_vector.py +40 -0
- appwrite_console/models/backup_archive.py +48 -0
- appwrite_console/models/backup_archive_list.py +19 -0
- appwrite_console/models/backup_policy.py +48 -0
- appwrite_console/models/backup_policy_list.py +19 -0
- appwrite_console/models/backup_restoration.py +45 -0
- appwrite_console/models/backup_restoration_list.py +19 -0
- appwrite_console/models/base_model.py +27 -0
- appwrite_console/models/billing_address.py +36 -0
- appwrite_console/models/billing_address_list.py +19 -0
- appwrite_console/models/billing_limits.py +36 -0
- appwrite_console/models/billing_plan.py +226 -0
- appwrite_console/models/billing_plan_addon.py +19 -0
- appwrite_console/models/billing_plan_addon_details.py +36 -0
- appwrite_console/models/billing_plan_dedicated_database_limits.py +69 -0
- appwrite_console/models/billing_plan_limits.py +18 -0
- appwrite_console/models/billing_plan_list.py +19 -0
- appwrite_console/models/billing_plan_supported_addons.py +21 -0
- appwrite_console/models/block.py +45 -0
- appwrite_console/models/block_delete.py +19 -0
- appwrite_console/models/block_list.py +19 -0
- appwrite_console/models/branch.py +15 -0
- appwrite_console/models/branch_list.py +19 -0
- appwrite_console/models/bucket.py +54 -0
- appwrite_console/models/bucket_list.py +19 -0
- appwrite_console/models/campaign.py +49 -0
- appwrite_console/models/collection.py +67 -0
- appwrite_console/models/collection_list.py +19 -0
- appwrite_console/models/column_bigint.py +46 -0
- appwrite_console/models/column_boolean.py +40 -0
- appwrite_console/models/column_datetime.py +43 -0
- appwrite_console/models/column_email.py +43 -0
- appwrite_console/models/column_enum.py +46 -0
- appwrite_console/models/column_float.py +46 -0
- appwrite_console/models/column_index.py +42 -0
- appwrite_console/models/column_index_list.py +19 -0
- appwrite_console/models/column_integer.py +46 -0
- appwrite_console/models/column_ip.py +43 -0
- appwrite_console/models/column_line.py +40 -0
- appwrite_console/models/column_list.py +36 -0
- appwrite_console/models/column_longtext.py +43 -0
- appwrite_console/models/column_mediumtext.py +43 -0
- appwrite_console/models/column_point.py +40 -0
- appwrite_console/models/column_polygon.py +40 -0
- appwrite_console/models/column_relationship.py +55 -0
- appwrite_console/models/column_string.py +46 -0
- appwrite_console/models/column_text.py +43 -0
- appwrite_console/models/column_url.py +43 -0
- appwrite_console/models/column_varchar.py +46 -0
- appwrite_console/models/console_key_scope.py +24 -0
- appwrite_console/models/console_key_scope_list.py +19 -0
- appwrite_console/models/console_o_auth2_provider.py +19 -0
- appwrite_console/models/console_o_auth2_provider_list.py +19 -0
- appwrite_console/models/console_o_auth2_provider_parameter.py +24 -0
- appwrite_console/models/console_region.py +30 -0
- appwrite_console/models/console_region_list.py +19 -0
- appwrite_console/models/console_variables.py +96 -0
- appwrite_console/models/continent.py +18 -0
- appwrite_console/models/continent_list.py +19 -0
- appwrite_console/models/country.py +18 -0
- appwrite_console/models/country_list.py +19 -0
- appwrite_console/models/coupon.py +36 -0
- appwrite_console/models/credit.py +45 -0
- appwrite_console/models/credit_available.py +15 -0
- appwrite_console/models/credit_list.py +22 -0
- appwrite_console/models/currency.py +33 -0
- appwrite_console/models/currency_list.py +19 -0
- appwrite_console/models/database.py +52 -0
- appwrite_console/models/database_list.py +19 -0
- appwrite_console/models/database_migration.py +57 -0
- appwrite_console/models/database_migration_list.py +19 -0
- appwrite_console/models/database_status.py +57 -0
- appwrite_console/models/database_status_connections.py +18 -0
- appwrite_console/models/database_status_replica.py +24 -0
- appwrite_console/models/database_status_volume.py +24 -0
- appwrite_console/models/dedicated_database.py +159 -0
- appwrite_console/models/dedicated_database_backup.py +63 -0
- appwrite_console/models/dedicated_database_backup_list.py +19 -0
- appwrite_console/models/dedicated_database_backup_storage.py +27 -0
- appwrite_console/models/dedicated_database_branch.py +48 -0
- appwrite_console/models/dedicated_database_branch_list.py +16 -0
- appwrite_console/models/dedicated_database_execution.py +31 -0
- appwrite_console/models/dedicated_database_execution_column.py +18 -0
- appwrite_console/models/dedicated_database_extensions.py +22 -0
- appwrite_console/models/dedicated_database_list.py +19 -0
- appwrite_console/models/dedicated_database_member.py +24 -0
- appwrite_console/models/dedicated_database_operation.py +45 -0
- appwrite_console/models/dedicated_database_operation_list.py +19 -0
- appwrite_console/models/dedicated_database_pitr_windows.py +18 -0
- appwrite_console/models/dedicated_database_pooler.py +42 -0
- appwrite_console/models/dedicated_database_replicas.py +37 -0
- appwrite_console/models/dedicated_database_restoration.py +45 -0
- appwrite_console/models/dedicated_database_restoration_list.py +19 -0
- appwrite_console/models/dedicated_database_specification.py +39 -0
- appwrite_console/models/dedicated_database_specification_list.py +23 -0
- appwrite_console/models/dedicated_database_specification_pricing.py +27 -0
- appwrite_console/models/deployment.py +94 -0
- appwrite_console/models/deployment_list.py +19 -0
- appwrite_console/models/detection_framework.py +32 -0
- appwrite_console/models/detection_runtime.py +29 -0
- appwrite_console/models/detection_variable.py +18 -0
- appwrite_console/models/dev_key.py +36 -0
- appwrite_console/models/dev_key_list.py +19 -0
- appwrite_console/models/dns_record.py +48 -0
- appwrite_console/models/dns_records_list.py +19 -0
- appwrite_console/models/document.py +80 -0
- appwrite_console/models/document_list.py +32 -0
- appwrite_console/models/domain.py +53 -0
- appwrite_console/models/domain_price.py +30 -0
- appwrite_console/models/domain_purchase.py +43 -0
- appwrite_console/models/domain_suggestion.py +24 -0
- appwrite_console/models/domain_suggestions_list.py +19 -0
- appwrite_console/models/domain_transfer_out.py +15 -0
- appwrite_console/models/domain_transfer_status.py +22 -0
- appwrite_console/models/domains_list.py +19 -0
- appwrite_console/models/downgrade_feedback.py +42 -0
- appwrite_console/models/email_template.py +36 -0
- appwrite_console/models/email_template_list.py +19 -0
- appwrite_console/models/embedding.py +24 -0
- appwrite_console/models/embedding_list.py +19 -0
- appwrite_console/models/ephemeral_key.py +39 -0
- appwrite_console/models/estimation.py +37 -0
- appwrite_console/models/estimation_delete_organization.py +16 -0
- appwrite_console/models/estimation_item.py +18 -0
- appwrite_console/models/estimation_plan_change.py +29 -0
- appwrite_console/models/estimation_update_plan.py +40 -0
- appwrite_console/models/execution.py +69 -0
- appwrite_console/models/execution_list.py +19 -0
- appwrite_console/models/file.py +60 -0
- appwrite_console/models/file_list.py +19 -0
- appwrite_console/models/framework.py +28 -0
- appwrite_console/models/framework_adapter.py +27 -0
- appwrite_console/models/framework_list.py +19 -0
- appwrite_console/models/function.py +109 -0
- appwrite_console/models/function_list.py +19 -0
- appwrite_console/models/headers.py +18 -0
- appwrite_console/models/identity.py +42 -0
- appwrite_console/models/identity_list.py +19 -0
- appwrite_console/models/index.py +43 -0
- appwrite_console/models/index_list.py +19 -0
- appwrite_console/models/insight.py +64 -0
- appwrite_console/models/insight_cta.py +24 -0
- appwrite_console/models/insight_list.py +19 -0
- appwrite_console/models/installation.py +30 -0
- appwrite_console/models/installation_list.py +19 -0
- appwrite_console/models/invoice.py +82 -0
- appwrite_console/models/invoice_list.py +19 -0
- appwrite_console/models/jwt.py +15 -0
- appwrite_console/models/key.py +39 -0
- appwrite_console/models/key_list.py +19 -0
- appwrite_console/models/language.py +21 -0
- appwrite_console/models/language_list.py +19 -0
- appwrite_console/models/locale.py +66 -0
- appwrite_console/models/locale_code.py +18 -0
- appwrite_console/models/locale_code_list.py +19 -0
- appwrite_console/models/log.py +78 -0
- appwrite_console/models/log_list.py +19 -0
- appwrite_console/models/membership.py +57 -0
- appwrite_console/models/membership_list.py +19 -0
- appwrite_console/models/message.py +52 -0
- appwrite_console/models/message_list.py +19 -0
- appwrite_console/models/metric.py +18 -0
- appwrite_console/models/metric_breakdown.py +24 -0
- appwrite_console/models/mfa_challenge.py +24 -0
- appwrite_console/models/mfa_factors.py +24 -0
- appwrite_console/models/mfa_recovery_codes.py +15 -0
- appwrite_console/models/mfa_type.py +18 -0
- appwrite_console/models/migration.py +75 -0
- appwrite_console/models/migration_list.py +19 -0
- appwrite_console/models/migration_report.py +96 -0
- appwrite_console/models/mock_number.py +24 -0
- appwrite_console/models/mock_number_list.py +19 -0
- appwrite_console/models/notification.py +60 -0
- appwrite_console/models/notification_list.py +19 -0
- appwrite_console/models/o_auth2_amazon.py +24 -0
- appwrite_console/models/o_auth2_apple.py +30 -0
- appwrite_console/models/o_auth2_appwrite.py +24 -0
- appwrite_console/models/o_auth2_auth0.py +27 -0
- appwrite_console/models/o_auth2_authentik.py +27 -0
- appwrite_console/models/o_auth2_autodesk.py +24 -0
- appwrite_console/models/o_auth2_bitbucket.py +24 -0
- appwrite_console/models/o_auth2_bitly.py +24 -0
- appwrite_console/models/o_auth2_box.py +24 -0
- appwrite_console/models/o_auth2_dailymotion.py +24 -0
- appwrite_console/models/o_auth2_discord.py +24 -0
- appwrite_console/models/o_auth2_disqus.py +24 -0
- appwrite_console/models/o_auth2_dropbox.py +24 -0
- appwrite_console/models/o_auth2_etsy.py +24 -0
- appwrite_console/models/o_auth2_facebook.py +24 -0
- appwrite_console/models/o_auth2_figma.py +24 -0
- appwrite_console/models/o_auth2_fusion_auth.py +27 -0
- appwrite_console/models/o_auth2_github.py +24 -0
- appwrite_console/models/o_auth2_gitlab.py +27 -0
- appwrite_console/models/o_auth2_google.py +28 -0
- appwrite_console/models/o_auth2_keycloak.py +30 -0
- appwrite_console/models/o_auth2_kick.py +24 -0
- appwrite_console/models/o_auth2_linkedin.py +24 -0
- appwrite_console/models/o_auth2_microsoft.py +27 -0
- appwrite_console/models/o_auth2_notion.py +24 -0
- appwrite_console/models/o_auth2_oidc.py +43 -0
- appwrite_console/models/o_auth2_okta.py +30 -0
- appwrite_console/models/o_auth2_paypal.py +24 -0
- appwrite_console/models/o_auth2_podio.py +24 -0
- appwrite_console/models/o_auth2_provider_list.py +59 -0
- appwrite_console/models/o_auth2_salesforce.py +24 -0
- appwrite_console/models/o_auth2_slack.py +24 -0
- appwrite_console/models/o_auth2_spotify.py +24 -0
- appwrite_console/models/o_auth2_stripe.py +24 -0
- appwrite_console/models/o_auth2_tradeshift.py +24 -0
- appwrite_console/models/o_auth2_twitch.py +24 -0
- appwrite_console/models/o_auth2_word_press.py +24 -0
- appwrite_console/models/o_auth2_x.py +24 -0
- appwrite_console/models/o_auth2_yahoo.py +24 -0
- appwrite_console/models/o_auth2_yandex.py +24 -0
- appwrite_console/models/o_auth2_zoho.py +24 -0
- appwrite_console/models/o_auth2_zoom.py +24 -0
- appwrite_console/models/oauth2_approve.py +15 -0
- appwrite_console/models/oauth2_authorize.py +18 -0
- appwrite_console/models/oauth2_consent.py +42 -0
- appwrite_console/models/oauth2_consent_list.py +19 -0
- appwrite_console/models/oauth2_consent_token.py +45 -0
- appwrite_console/models/oauth2_consent_token_list.py +19 -0
- appwrite_console/models/oauth2_device_authorization.py +30 -0
- appwrite_console/models/oauth2_grant.py +48 -0
- appwrite_console/models/oauth2_organization.py +15 -0
- appwrite_console/models/oauth2_organization_list.py +19 -0
- appwrite_console/models/oauth2_par.py +18 -0
- appwrite_console/models/oauth2_project.py +21 -0
- appwrite_console/models/oauth2_project_list.py +19 -0
- appwrite_console/models/oauth2_reject.py +15 -0
- appwrite_console/models/oauth2_token.py +33 -0
- appwrite_console/models/organization.py +132 -0
- appwrite_console/models/organization_list.py +32 -0
- appwrite_console/models/payment_authentication.py +30 -0
- appwrite_console/models/payment_method.py +72 -0
- appwrite_console/models/payment_method_list.py +19 -0
- appwrite_console/models/phone.py +21 -0
- appwrite_console/models/phone_list.py +19 -0
- appwrite_console/models/plan_change_estimation_details.py +39 -0
- appwrite_console/models/plan_change_limits.py +28 -0
- appwrite_console/models/plan_change_project_compliance.py +28 -0
- appwrite_console/models/plan_change_resource_compliance.py +30 -0
- appwrite_console/models/platform_android.py +31 -0
- appwrite_console/models/platform_apple.py +31 -0
- appwrite_console/models/platform_linux.py +31 -0
- appwrite_console/models/platform_list.py +23 -0
- appwrite_console/models/platform_web.py +31 -0
- appwrite_console/models/platform_windows.py +31 -0
- appwrite_console/models/policy_deny_aliased_email.py +18 -0
- appwrite_console/models/policy_deny_corporate_email.py +18 -0
- appwrite_console/models/policy_deny_disposable_email.py +18 -0
- appwrite_console/models/policy_deny_free_email.py +18 -0
- appwrite_console/models/policy_list.py +32 -0
- appwrite_console/models/policy_membership_privacy.py +33 -0
- appwrite_console/models/policy_password_dictionary.py +18 -0
- appwrite_console/models/policy_password_history.py +18 -0
- appwrite_console/models/policy_password_personal_data.py +18 -0
- appwrite_console/models/policy_password_strength.py +30 -0
- appwrite_console/models/policy_session_alert.py +18 -0
- appwrite_console/models/policy_session_duration.py +18 -0
- appwrite_console/models/policy_session_invalidation.py +18 -0
- appwrite_console/models/policy_session_limit.py +18 -0
- appwrite_console/models/policy_user_limit.py +18 -0
- appwrite_console/models/postgres_extension.py +24 -0
- appwrite_console/models/postgres_extension_list.py +19 -0
- appwrite_console/models/preferences.py +52 -0
- appwrite_console/models/presence.py +39 -0
- appwrite_console/models/presence_list.py +19 -0
- appwrite_console/models/program.py +39 -0
- appwrite_console/models/project.py +153 -0
- appwrite_console/models/project_auth_method.py +19 -0
- appwrite_console/models/project_list.py +19 -0
- appwrite_console/models/project_protocol.py +19 -0
- appwrite_console/models/project_service.py +19 -0
- appwrite_console/models/provider.py +39 -0
- appwrite_console/models/provider_list.py +19 -0
- appwrite_console/models/provider_repository.py +42 -0
- appwrite_console/models/provider_repository_framework.py +45 -0
- appwrite_console/models/provider_repository_framework_list.py +22 -0
- appwrite_console/models/provider_repository_runtime.py +45 -0
- appwrite_console/models/provider_repository_runtime_list.py +22 -0
- appwrite_console/models/proxy_rule.py +59 -0
- appwrite_console/models/proxy_rule_list.py +19 -0
- appwrite_console/models/report.py +49 -0
- appwrite_console/models/report_list.py +19 -0
- appwrite_console/models/resource_token.py +33 -0
- appwrite_console/models/resource_token_list.py +19 -0
- appwrite_console/models/review.py +24 -0
- appwrite_console/models/roles.py +18 -0
- appwrite_console/models/row.py +80 -0
- appwrite_console/models/row_list.py +32 -0
- appwrite_console/models/runtime.py +36 -0
- appwrite_console/models/runtime_list.py +19 -0
- appwrite_console/models/schedule.py +45 -0
- appwrite_console/models/schedule_list.py +19 -0
- appwrite_console/models/session.py +99 -0
- appwrite_console/models/session_list.py +19 -0
- appwrite_console/models/site.py +115 -0
- appwrite_console/models/site_list.py +19 -0
- appwrite_console/models/specification.py +24 -0
- appwrite_console/models/specification_list.py +19 -0
- appwrite_console/models/stage.py +27 -0
- appwrite_console/models/stage_list.py +16 -0
- appwrite_console/models/subscriber.py +40 -0
- appwrite_console/models/subscriber_list.py +19 -0
- appwrite_console/models/table.py +67 -0
- appwrite_console/models/table_list.py +19 -0
- appwrite_console/models/target.py +39 -0
- appwrite_console/models/target_list.py +19 -0
- appwrite_console/models/team.py +43 -0
- appwrite_console/models/team_list.py +32 -0
- appwrite_console/models/template_framework.py +39 -0
- appwrite_console/models/template_function.py +65 -0
- appwrite_console/models/template_function_list.py +19 -0
- appwrite_console/models/template_runtime.py +24 -0
- appwrite_console/models/template_site.py +53 -0
- appwrite_console/models/template_site_list.py +19 -0
- appwrite_console/models/template_variable.py +33 -0
- appwrite_console/models/token.py +30 -0
- appwrite_console/models/topic.py +36 -0
- appwrite_console/models/topic_list.py +19 -0
- appwrite_console/models/transaction.py +30 -0
- appwrite_console/models/transaction_list.py +19 -0
- appwrite_console/models/usage_billing_plan.py +46 -0
- appwrite_console/models/usage_data_point.py +99 -0
- appwrite_console/models/usage_event_list.py +19 -0
- appwrite_console/models/usage_gauge_list.py +19 -0
- appwrite_console/models/usage_metric.py +19 -0
- appwrite_console/models/usage_organization.py +104 -0
- appwrite_console/models/usage_organization_project.py +73 -0
- appwrite_console/models/usage_presence.py +22 -0
- appwrite_console/models/usage_project.py +218 -0
- appwrite_console/models/usage_resources.py +36 -0
- appwrite_console/models/usage_users.py +28 -0
- appwrite_console/models/user.py +111 -0
- appwrite_console/models/user_list.py +32 -0
- appwrite_console/models/variable.py +36 -0
- appwrite_console/models/variable_list.py +19 -0
- appwrite_console/models/vcs_content.py +21 -0
- appwrite_console/models/vcs_content_list.py +19 -0
- appwrite_console/models/vcs_namespace.py +27 -0
- appwrite_console/models/vcs_namespace_list.py +19 -0
- appwrite_console/models/vectorsdb_collection.py +54 -0
- appwrite_console/models/vectorsdb_collection_list.py +19 -0
- appwrite_console/models/waf_rule.py +55 -0
- appwrite_console/models/waf_rule_bypass.py +55 -0
- appwrite_console/models/waf_rule_challenge.py +64 -0
- appwrite_console/models/waf_rule_deny.py +55 -0
- appwrite_console/models/waf_rule_list.py +19 -0
- appwrite_console/models/waf_rule_rate_limit.py +64 -0
- appwrite_console/models/waf_rule_redirect.py +61 -0
- appwrite_console/models/webhook.py +51 -0
- appwrite_console/models/webhook_list.py +19 -0
- appwrite_console/operator.py +150 -0
- appwrite_console/permission.py +21 -0
- appwrite_console/query.py +293 -0
- appwrite_console/role.py +111 -0
- appwrite_console/service.py +50 -0
- appwrite_console/services/__init__.py +1 -0
- appwrite_console/services/account.py +3328 -0
- appwrite_console/services/activities.py +89 -0
- appwrite_console/services/advisor.py +234 -0
- appwrite_console/services/apps.py +1156 -0
- appwrite_console/services/assistant.py +50 -0
- appwrite_console/services/avatars.py +531 -0
- appwrite_console/services/backups.py +572 -0
- appwrite_console/services/console.py +807 -0
- appwrite_console/services/databases.py +4976 -0
- appwrite_console/services/documents_db.py +2052 -0
- appwrite_console/services/domains.py +3047 -0
- appwrite_console/services/functions.py +1659 -0
- appwrite_console/services/graphql.py +92 -0
- appwrite_console/services/locale.py +243 -0
- appwrite_console/services/manager.py +301 -0
- appwrite_console/services/messaging.py +3137 -0
- appwrite_console/services/migrations.py +1036 -0
- appwrite_console/services/mongo.py +1683 -0
- appwrite_console/services/mysql.py +1861 -0
- appwrite_console/services/notifications.py +98 -0
- appwrite_console/services/oauth2.py +914 -0
- appwrite_console/services/organization.py +1039 -0
- appwrite_console/services/organizations.py +2245 -0
- appwrite_console/services/postgresql.py +1995 -0
- appwrite_console/services/presences.py +309 -0
- appwrite_console/services/project.py +5271 -0
- appwrite_console/services/projects.py +885 -0
- appwrite_console/services/proxy.py +394 -0
- appwrite_console/services/sites.py +1593 -0
- appwrite_console/services/storage.py +818 -0
- appwrite_console/services/tables_db.py +5189 -0
- appwrite_console/services/teams.py +993 -0
- appwrite_console/services/tokens.py +243 -0
- appwrite_console/services/usage.py +194 -0
- appwrite_console/services/users.py +2314 -0
- appwrite_console/services/vcs.py +599 -0
- appwrite_console/services/vectors_db.py +2054 -0
- appwrite_console/services/waf.py +1014 -0
- appwrite_console/services/webhooks.py +344 -0
- appwrite_console/utils/__init__.py +1 -0
- appwrite_console/utils/deprecated.py +51 -0
- appwrite_console-0.1.0.dist-info/METADATA +189 -0
- appwrite_console-0.1.0.dist-info/RECORD +552 -0
- appwrite_console-0.1.0.dist-info/WHEEL +5 -0
- appwrite_console-0.1.0.dist-info/licenses/LICENSE +12 -0
- appwrite_console-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,818 @@
|
|
|
1
|
+
from ..service import Service
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
from typing import Any, Dict, List, Optional, Union
|
|
4
|
+
from ..exception import AppwriteException
|
|
5
|
+
from appwrite_console.utils.deprecated import deprecated
|
|
6
|
+
from ..models.bucket_list import BucketList
|
|
7
|
+
from ..enums.compression import Compression
|
|
8
|
+
from ..models.bucket import Bucket
|
|
9
|
+
from ..models.file_list import FileList
|
|
10
|
+
from ..input_file import InputFile
|
|
11
|
+
from ..models.file import File
|
|
12
|
+
from ..enums.image_gravity import ImageGravity
|
|
13
|
+
from ..enums.image_format import ImageFormat
|
|
14
|
+
|
|
15
|
+
class Storage(Service):
|
|
16
|
+
|
|
17
|
+
def __init__(self, client) -> None:
|
|
18
|
+
super(Storage, self).__init__(client)
|
|
19
|
+
|
|
20
|
+
def list_buckets(
|
|
21
|
+
self,
|
|
22
|
+
queries: Optional[List[str]] = None,
|
|
23
|
+
search: Optional[str] = None,
|
|
24
|
+
total: Optional[bool] = None
|
|
25
|
+
) -> BucketList:
|
|
26
|
+
"""
|
|
27
|
+
Get a list of all the storage buckets. You can use the query params to filter your results.
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
queries : Optional[List[str]]
|
|
32
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations
|
|
33
|
+
search : Optional[str]
|
|
34
|
+
Search term to filter your list results. Max length: 256 chars.
|
|
35
|
+
total : Optional[bool]
|
|
36
|
+
When set to false, the total count returned will be 0 and will not be calculated.
|
|
37
|
+
|
|
38
|
+
Returns
|
|
39
|
+
-------
|
|
40
|
+
BucketList
|
|
41
|
+
API response as a typed Pydantic model
|
|
42
|
+
|
|
43
|
+
Raises
|
|
44
|
+
------
|
|
45
|
+
AppwriteException
|
|
46
|
+
If API request fails
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
api_path = '/storage/buckets'
|
|
50
|
+
api_params = {}
|
|
51
|
+
|
|
52
|
+
if queries is not None:
|
|
53
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
54
|
+
if search is not None:
|
|
55
|
+
api_params['search'] = self._normalize_value(search)
|
|
56
|
+
if total is not None:
|
|
57
|
+
api_params['total'] = self._normalize_value(total)
|
|
58
|
+
|
|
59
|
+
response = self.client.call('get', api_path, {
|
|
60
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
61
|
+
'accept': 'application/json',
|
|
62
|
+
}, api_params)
|
|
63
|
+
|
|
64
|
+
return self._parse_response(response, model=BucketList)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def create_bucket(
|
|
68
|
+
self,
|
|
69
|
+
bucket_id: str,
|
|
70
|
+
name: str,
|
|
71
|
+
permissions: Optional[List[str]] = None,
|
|
72
|
+
file_security: Optional[bool] = None,
|
|
73
|
+
enabled: Optional[bool] = None,
|
|
74
|
+
maximum_file_size: Optional[float] = None,
|
|
75
|
+
allowed_file_extensions: Optional[List[str]] = None,
|
|
76
|
+
compression: Optional[Compression] = None,
|
|
77
|
+
encryption: Optional[bool] = None,
|
|
78
|
+
antivirus: Optional[bool] = None,
|
|
79
|
+
transformations: Optional[bool] = None
|
|
80
|
+
) -> Bucket:
|
|
81
|
+
"""
|
|
82
|
+
Create a new storage bucket.
|
|
83
|
+
|
|
84
|
+
Parameters
|
|
85
|
+
----------
|
|
86
|
+
bucket_id : str
|
|
87
|
+
Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
88
|
+
name : str
|
|
89
|
+
Bucket name
|
|
90
|
+
permissions : Optional[List[str]]
|
|
91
|
+
An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
92
|
+
file_security : Optional[bool]
|
|
93
|
+
Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
94
|
+
enabled : Optional[bool]
|
|
95
|
+
Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
|
96
|
+
maximum_file_size : Optional[float]
|
|
97
|
+
Maximum file size allowed in bytes. Maximum allowed value is 5GB.
|
|
98
|
+
allowed_file_extensions : Optional[List[str]]
|
|
99
|
+
Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
|
100
|
+
compression : Optional[Compression]
|
|
101
|
+
Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
|
102
|
+
encryption : Optional[bool]
|
|
103
|
+
Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
|
104
|
+
antivirus : Optional[bool]
|
|
105
|
+
Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
|
106
|
+
transformations : Optional[bool]
|
|
107
|
+
Are image transformations enabled?
|
|
108
|
+
|
|
109
|
+
Returns
|
|
110
|
+
-------
|
|
111
|
+
Bucket
|
|
112
|
+
API response as a typed Pydantic model
|
|
113
|
+
|
|
114
|
+
Raises
|
|
115
|
+
------
|
|
116
|
+
AppwriteException
|
|
117
|
+
If API request fails
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
api_path = '/storage/buckets'
|
|
121
|
+
api_params = {}
|
|
122
|
+
if bucket_id is None:
|
|
123
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
124
|
+
|
|
125
|
+
if name is None:
|
|
126
|
+
raise AppwriteException('Missing required parameter: "name"')
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
api_params['bucketId'] = self._normalize_value(bucket_id)
|
|
130
|
+
api_params['name'] = self._normalize_value(name)
|
|
131
|
+
if permissions is not None:
|
|
132
|
+
api_params['permissions'] = self._normalize_value(permissions)
|
|
133
|
+
if file_security is not None:
|
|
134
|
+
api_params['fileSecurity'] = self._normalize_value(file_security)
|
|
135
|
+
if enabled is not None:
|
|
136
|
+
api_params['enabled'] = self._normalize_value(enabled)
|
|
137
|
+
if maximum_file_size is not None:
|
|
138
|
+
api_params['maximumFileSize'] = self._normalize_value(maximum_file_size)
|
|
139
|
+
if allowed_file_extensions is not None:
|
|
140
|
+
api_params['allowedFileExtensions'] = self._normalize_value(allowed_file_extensions)
|
|
141
|
+
if compression is not None:
|
|
142
|
+
api_params['compression'] = self._normalize_value(compression)
|
|
143
|
+
if encryption is not None:
|
|
144
|
+
api_params['encryption'] = self._normalize_value(encryption)
|
|
145
|
+
if antivirus is not None:
|
|
146
|
+
api_params['antivirus'] = self._normalize_value(antivirus)
|
|
147
|
+
if transformations is not None:
|
|
148
|
+
api_params['transformations'] = self._normalize_value(transformations)
|
|
149
|
+
|
|
150
|
+
response = self.client.call('post', api_path, {
|
|
151
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
152
|
+
'content-type': 'application/json',
|
|
153
|
+
'accept': 'application/json',
|
|
154
|
+
}, api_params)
|
|
155
|
+
|
|
156
|
+
return self._parse_response(response, model=Bucket)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def get_bucket(
|
|
160
|
+
self,
|
|
161
|
+
bucket_id: str
|
|
162
|
+
) -> Bucket:
|
|
163
|
+
"""
|
|
164
|
+
Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
|
165
|
+
|
|
166
|
+
Parameters
|
|
167
|
+
----------
|
|
168
|
+
bucket_id : str
|
|
169
|
+
Bucket unique ID.
|
|
170
|
+
|
|
171
|
+
Returns
|
|
172
|
+
-------
|
|
173
|
+
Bucket
|
|
174
|
+
API response as a typed Pydantic model
|
|
175
|
+
|
|
176
|
+
Raises
|
|
177
|
+
------
|
|
178
|
+
AppwriteException
|
|
179
|
+
If API request fails
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
api_path = '/storage/buckets/{bucketId}'
|
|
183
|
+
api_params = {}
|
|
184
|
+
if bucket_id is None:
|
|
185
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
186
|
+
|
|
187
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
response = self.client.call('get', api_path, {
|
|
191
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
192
|
+
'accept': 'application/json',
|
|
193
|
+
}, api_params)
|
|
194
|
+
|
|
195
|
+
return self._parse_response(response, model=Bucket)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def update_bucket(
|
|
199
|
+
self,
|
|
200
|
+
bucket_id: str,
|
|
201
|
+
name: str,
|
|
202
|
+
permissions: Optional[List[str]] = None,
|
|
203
|
+
file_security: Optional[bool] = None,
|
|
204
|
+
enabled: Optional[bool] = None,
|
|
205
|
+
maximum_file_size: Optional[float] = None,
|
|
206
|
+
allowed_file_extensions: Optional[List[str]] = None,
|
|
207
|
+
compression: Optional[Compression] = None,
|
|
208
|
+
encryption: Optional[bool] = None,
|
|
209
|
+
antivirus: Optional[bool] = None,
|
|
210
|
+
transformations: Optional[bool] = None
|
|
211
|
+
) -> Bucket:
|
|
212
|
+
"""
|
|
213
|
+
Update a storage bucket by its unique ID.
|
|
214
|
+
|
|
215
|
+
Parameters
|
|
216
|
+
----------
|
|
217
|
+
bucket_id : str
|
|
218
|
+
Bucket unique ID.
|
|
219
|
+
name : str
|
|
220
|
+
Bucket name
|
|
221
|
+
permissions : Optional[List[str]]
|
|
222
|
+
An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
223
|
+
file_security : Optional[bool]
|
|
224
|
+
Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
225
|
+
enabled : Optional[bool]
|
|
226
|
+
Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
|
227
|
+
maximum_file_size : Optional[float]
|
|
228
|
+
Maximum file size allowed in bytes. Maximum allowed value is 5GB.
|
|
229
|
+
allowed_file_extensions : Optional[List[str]]
|
|
230
|
+
Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
|
231
|
+
compression : Optional[Compression]
|
|
232
|
+
Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
|
233
|
+
encryption : Optional[bool]
|
|
234
|
+
Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
|
235
|
+
antivirus : Optional[bool]
|
|
236
|
+
Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
|
237
|
+
transformations : Optional[bool]
|
|
238
|
+
Are image transformations enabled?
|
|
239
|
+
|
|
240
|
+
Returns
|
|
241
|
+
-------
|
|
242
|
+
Bucket
|
|
243
|
+
API response as a typed Pydantic model
|
|
244
|
+
|
|
245
|
+
Raises
|
|
246
|
+
------
|
|
247
|
+
AppwriteException
|
|
248
|
+
If API request fails
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
api_path = '/storage/buckets/{bucketId}'
|
|
252
|
+
api_params = {}
|
|
253
|
+
if bucket_id is None:
|
|
254
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
255
|
+
|
|
256
|
+
if name is None:
|
|
257
|
+
raise AppwriteException('Missing required parameter: "name"')
|
|
258
|
+
|
|
259
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
260
|
+
|
|
261
|
+
api_params['name'] = self._normalize_value(name)
|
|
262
|
+
if permissions is not None:
|
|
263
|
+
api_params['permissions'] = self._normalize_value(permissions)
|
|
264
|
+
if file_security is not None:
|
|
265
|
+
api_params['fileSecurity'] = self._normalize_value(file_security)
|
|
266
|
+
if enabled is not None:
|
|
267
|
+
api_params['enabled'] = self._normalize_value(enabled)
|
|
268
|
+
if maximum_file_size is not None:
|
|
269
|
+
api_params['maximumFileSize'] = self._normalize_value(maximum_file_size)
|
|
270
|
+
if allowed_file_extensions is not None:
|
|
271
|
+
api_params['allowedFileExtensions'] = self._normalize_value(allowed_file_extensions)
|
|
272
|
+
if compression is not None:
|
|
273
|
+
api_params['compression'] = self._normalize_value(compression)
|
|
274
|
+
if encryption is not None:
|
|
275
|
+
api_params['encryption'] = self._normalize_value(encryption)
|
|
276
|
+
if antivirus is not None:
|
|
277
|
+
api_params['antivirus'] = self._normalize_value(antivirus)
|
|
278
|
+
if transformations is not None:
|
|
279
|
+
api_params['transformations'] = self._normalize_value(transformations)
|
|
280
|
+
|
|
281
|
+
response = self.client.call('put', api_path, {
|
|
282
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
283
|
+
'content-type': 'application/json',
|
|
284
|
+
'accept': 'application/json',
|
|
285
|
+
}, api_params)
|
|
286
|
+
|
|
287
|
+
return self._parse_response(response, model=Bucket)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def delete_bucket(
|
|
291
|
+
self,
|
|
292
|
+
bucket_id: str
|
|
293
|
+
) -> Dict[str, Any]:
|
|
294
|
+
"""
|
|
295
|
+
Delete a storage bucket by its unique ID.
|
|
296
|
+
|
|
297
|
+
Parameters
|
|
298
|
+
----------
|
|
299
|
+
bucket_id : str
|
|
300
|
+
Bucket unique ID.
|
|
301
|
+
|
|
302
|
+
Returns
|
|
303
|
+
-------
|
|
304
|
+
Dict[str, Any]
|
|
305
|
+
API response as a dictionary
|
|
306
|
+
|
|
307
|
+
Raises
|
|
308
|
+
------
|
|
309
|
+
AppwriteException
|
|
310
|
+
If API request fails
|
|
311
|
+
"""
|
|
312
|
+
|
|
313
|
+
api_path = '/storage/buckets/{bucketId}'
|
|
314
|
+
api_params = {}
|
|
315
|
+
if bucket_id is None:
|
|
316
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
317
|
+
|
|
318
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
response = self.client.call('delete', api_path, {
|
|
322
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
323
|
+
'content-type': 'application/json',
|
|
324
|
+
}, api_params)
|
|
325
|
+
|
|
326
|
+
return response
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def list_files(
|
|
330
|
+
self,
|
|
331
|
+
bucket_id: str,
|
|
332
|
+
queries: Optional[List[str]] = None,
|
|
333
|
+
search: Optional[str] = None,
|
|
334
|
+
total: Optional[bool] = None
|
|
335
|
+
) -> FileList:
|
|
336
|
+
"""
|
|
337
|
+
Get a list of all the user files. You can use the query params to filter your results.
|
|
338
|
+
|
|
339
|
+
Parameters
|
|
340
|
+
----------
|
|
341
|
+
bucket_id : str
|
|
342
|
+
Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
343
|
+
queries : Optional[List[str]]
|
|
344
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
345
|
+
search : Optional[str]
|
|
346
|
+
Search term to filter your list results. Max length: 256 chars.
|
|
347
|
+
total : Optional[bool]
|
|
348
|
+
When set to false, the total count returned will be 0 and will not be calculated.
|
|
349
|
+
|
|
350
|
+
Returns
|
|
351
|
+
-------
|
|
352
|
+
FileList
|
|
353
|
+
API response as a typed Pydantic model
|
|
354
|
+
|
|
355
|
+
Raises
|
|
356
|
+
------
|
|
357
|
+
AppwriteException
|
|
358
|
+
If API request fails
|
|
359
|
+
"""
|
|
360
|
+
|
|
361
|
+
api_path = '/storage/buckets/{bucketId}/files'
|
|
362
|
+
api_params = {}
|
|
363
|
+
if bucket_id is None:
|
|
364
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
365
|
+
|
|
366
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
367
|
+
|
|
368
|
+
if queries is not None:
|
|
369
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
370
|
+
if search is not None:
|
|
371
|
+
api_params['search'] = self._normalize_value(search)
|
|
372
|
+
if total is not None:
|
|
373
|
+
api_params['total'] = self._normalize_value(total)
|
|
374
|
+
|
|
375
|
+
response = self.client.call('get', api_path, {
|
|
376
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
377
|
+
'accept': 'application/json',
|
|
378
|
+
}, api_params)
|
|
379
|
+
|
|
380
|
+
return self._parse_response(response, model=FileList)
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
def create_file(
|
|
384
|
+
self,
|
|
385
|
+
bucket_id: str,
|
|
386
|
+
file_id: str,
|
|
387
|
+
file: InputFile,
|
|
388
|
+
permissions: Optional[List[str]] = None,
|
|
389
|
+
folder: Optional[str] = None,
|
|
390
|
+
on_progress = None
|
|
391
|
+
) -> File:
|
|
392
|
+
"""
|
|
393
|
+
Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
|
394
|
+
|
|
395
|
+
Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
396
|
+
|
|
397
|
+
When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
398
|
+
|
|
399
|
+
If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
Parameters
|
|
403
|
+
----------
|
|
404
|
+
bucket_id : str
|
|
405
|
+
Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
406
|
+
file_id : str
|
|
407
|
+
File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
408
|
+
file : InputFile
|
|
409
|
+
Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
|
410
|
+
permissions : Optional[List[str]]
|
|
411
|
+
An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
412
|
+
folder : Optional[str]
|
|
413
|
+
Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root.
|
|
414
|
+
on_progress : callable, optional
|
|
415
|
+
Optional callback for upload progress
|
|
416
|
+
|
|
417
|
+
Returns
|
|
418
|
+
-------
|
|
419
|
+
File
|
|
420
|
+
API response as a typed Pydantic model
|
|
421
|
+
|
|
422
|
+
Raises
|
|
423
|
+
------
|
|
424
|
+
AppwriteException
|
|
425
|
+
If API request fails
|
|
426
|
+
"""
|
|
427
|
+
|
|
428
|
+
api_path = '/storage/buckets/{bucketId}/files'
|
|
429
|
+
api_params = {}
|
|
430
|
+
if bucket_id is None:
|
|
431
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
432
|
+
|
|
433
|
+
if file_id is None:
|
|
434
|
+
raise AppwriteException('Missing required parameter: "file_id"')
|
|
435
|
+
|
|
436
|
+
if file is None:
|
|
437
|
+
raise AppwriteException('Missing required parameter: "file"')
|
|
438
|
+
|
|
439
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
440
|
+
|
|
441
|
+
api_params['fileId'] = self._normalize_value(file_id)
|
|
442
|
+
api_params['file'] = self._normalize_value(file)
|
|
443
|
+
if permissions is not None:
|
|
444
|
+
api_params['permissions'] = self._normalize_value(permissions)
|
|
445
|
+
if folder is not None:
|
|
446
|
+
api_params['folder'] = self._normalize_value(folder)
|
|
447
|
+
|
|
448
|
+
param_name = 'file'
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
upload_id = ''
|
|
452
|
+
upload_id = file_id
|
|
453
|
+
|
|
454
|
+
response = self.client.chunked_upload(api_path, {
|
|
455
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
456
|
+
'content-type': 'multipart/form-data',
|
|
457
|
+
'accept': 'application/json',
|
|
458
|
+
}, api_params, param_name, on_progress, upload_id)
|
|
459
|
+
|
|
460
|
+
return self._parse_response(response, model=File)
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
def get_file(
|
|
464
|
+
self,
|
|
465
|
+
bucket_id: str,
|
|
466
|
+
file_id: str
|
|
467
|
+
) -> File:
|
|
468
|
+
"""
|
|
469
|
+
Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
|
470
|
+
|
|
471
|
+
Parameters
|
|
472
|
+
----------
|
|
473
|
+
bucket_id : str
|
|
474
|
+
Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
475
|
+
file_id : str
|
|
476
|
+
File ID.
|
|
477
|
+
|
|
478
|
+
Returns
|
|
479
|
+
-------
|
|
480
|
+
File
|
|
481
|
+
API response as a typed Pydantic model
|
|
482
|
+
|
|
483
|
+
Raises
|
|
484
|
+
------
|
|
485
|
+
AppwriteException
|
|
486
|
+
If API request fails
|
|
487
|
+
"""
|
|
488
|
+
|
|
489
|
+
api_path = '/storage/buckets/{bucketId}/files/{fileId}'
|
|
490
|
+
api_params = {}
|
|
491
|
+
if bucket_id is None:
|
|
492
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
493
|
+
|
|
494
|
+
if file_id is None:
|
|
495
|
+
raise AppwriteException('Missing required parameter: "file_id"')
|
|
496
|
+
|
|
497
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
498
|
+
api_path = api_path.replace('{fileId}', str(self._normalize_value(file_id)))
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
response = self.client.call('get', api_path, {
|
|
502
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
503
|
+
'accept': 'application/json',
|
|
504
|
+
}, api_params)
|
|
505
|
+
|
|
506
|
+
return self._parse_response(response, model=File)
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def update_file(
|
|
510
|
+
self,
|
|
511
|
+
bucket_id: str,
|
|
512
|
+
file_id: str,
|
|
513
|
+
name: Optional[str] = None,
|
|
514
|
+
permissions: Optional[List[str]] = None
|
|
515
|
+
) -> File:
|
|
516
|
+
"""
|
|
517
|
+
Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
518
|
+
|
|
519
|
+
Parameters
|
|
520
|
+
----------
|
|
521
|
+
bucket_id : str
|
|
522
|
+
Bucket unique ID.
|
|
523
|
+
file_id : str
|
|
524
|
+
File ID.
|
|
525
|
+
name : Optional[str]
|
|
526
|
+
File name.
|
|
527
|
+
permissions : Optional[List[str]]
|
|
528
|
+
An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
529
|
+
|
|
530
|
+
Returns
|
|
531
|
+
-------
|
|
532
|
+
File
|
|
533
|
+
API response as a typed Pydantic model
|
|
534
|
+
|
|
535
|
+
Raises
|
|
536
|
+
------
|
|
537
|
+
AppwriteException
|
|
538
|
+
If API request fails
|
|
539
|
+
"""
|
|
540
|
+
|
|
541
|
+
api_path = '/storage/buckets/{bucketId}/files/{fileId}'
|
|
542
|
+
api_params = {}
|
|
543
|
+
if bucket_id is None:
|
|
544
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
545
|
+
|
|
546
|
+
if file_id is None:
|
|
547
|
+
raise AppwriteException('Missing required parameter: "file_id"')
|
|
548
|
+
|
|
549
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
550
|
+
api_path = api_path.replace('{fileId}', str(self._normalize_value(file_id)))
|
|
551
|
+
|
|
552
|
+
if name is not None:
|
|
553
|
+
api_params['name'] = self._normalize_value(name)
|
|
554
|
+
if permissions is not None:
|
|
555
|
+
api_params['permissions'] = self._normalize_value(permissions)
|
|
556
|
+
|
|
557
|
+
response = self.client.call('put', api_path, {
|
|
558
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
559
|
+
'content-type': 'application/json',
|
|
560
|
+
'accept': 'application/json',
|
|
561
|
+
}, api_params)
|
|
562
|
+
|
|
563
|
+
return self._parse_response(response, model=File)
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
def delete_file(
|
|
567
|
+
self,
|
|
568
|
+
bucket_id: str,
|
|
569
|
+
file_id: str
|
|
570
|
+
) -> Dict[str, Any]:
|
|
571
|
+
"""
|
|
572
|
+
Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
|
573
|
+
|
|
574
|
+
Parameters
|
|
575
|
+
----------
|
|
576
|
+
bucket_id : str
|
|
577
|
+
Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
578
|
+
file_id : str
|
|
579
|
+
File ID.
|
|
580
|
+
|
|
581
|
+
Returns
|
|
582
|
+
-------
|
|
583
|
+
Dict[str, Any]
|
|
584
|
+
API response as a dictionary
|
|
585
|
+
|
|
586
|
+
Raises
|
|
587
|
+
------
|
|
588
|
+
AppwriteException
|
|
589
|
+
If API request fails
|
|
590
|
+
"""
|
|
591
|
+
|
|
592
|
+
api_path = '/storage/buckets/{bucketId}/files/{fileId}'
|
|
593
|
+
api_params = {}
|
|
594
|
+
if bucket_id is None:
|
|
595
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
596
|
+
|
|
597
|
+
if file_id is None:
|
|
598
|
+
raise AppwriteException('Missing required parameter: "file_id"')
|
|
599
|
+
|
|
600
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
601
|
+
api_path = api_path.replace('{fileId}', str(self._normalize_value(file_id)))
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
response = self.client.call('delete', api_path, {
|
|
605
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
606
|
+
'content-type': 'application/json',
|
|
607
|
+
}, api_params)
|
|
608
|
+
|
|
609
|
+
return response
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
def get_file_download(
|
|
613
|
+
self,
|
|
614
|
+
bucket_id: str,
|
|
615
|
+
file_id: str,
|
|
616
|
+
token: Optional[str] = None
|
|
617
|
+
) -> bytes:
|
|
618
|
+
"""
|
|
619
|
+
Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
620
|
+
|
|
621
|
+
Parameters
|
|
622
|
+
----------
|
|
623
|
+
bucket_id : str
|
|
624
|
+
Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
625
|
+
file_id : str
|
|
626
|
+
File ID.
|
|
627
|
+
token : Optional[str]
|
|
628
|
+
File token for accessing this file.
|
|
629
|
+
|
|
630
|
+
Returns
|
|
631
|
+
-------
|
|
632
|
+
bytes
|
|
633
|
+
Response as bytes
|
|
634
|
+
|
|
635
|
+
Raises
|
|
636
|
+
------
|
|
637
|
+
AppwriteException
|
|
638
|
+
If API request fails
|
|
639
|
+
"""
|
|
640
|
+
|
|
641
|
+
api_path = '/storage/buckets/{bucketId}/files/{fileId}/download'
|
|
642
|
+
api_params = {}
|
|
643
|
+
if bucket_id is None:
|
|
644
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
645
|
+
|
|
646
|
+
if file_id is None:
|
|
647
|
+
raise AppwriteException('Missing required parameter: "file_id"')
|
|
648
|
+
|
|
649
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
650
|
+
api_path = api_path.replace('{fileId}', str(self._normalize_value(file_id)))
|
|
651
|
+
|
|
652
|
+
if token is not None:
|
|
653
|
+
api_params['token'] = self._normalize_value(token)
|
|
654
|
+
|
|
655
|
+
response = self.client.call('get', api_path, {
|
|
656
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
657
|
+
'accept': '*/*',
|
|
658
|
+
}, api_params)
|
|
659
|
+
|
|
660
|
+
return response
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
def get_file_preview(
|
|
664
|
+
self,
|
|
665
|
+
bucket_id: str,
|
|
666
|
+
file_id: str,
|
|
667
|
+
width: Optional[float] = None,
|
|
668
|
+
height: Optional[float] = None,
|
|
669
|
+
gravity: Optional[ImageGravity] = None,
|
|
670
|
+
quality: Optional[float] = None,
|
|
671
|
+
border_width: Optional[float] = None,
|
|
672
|
+
border_color: Optional[str] = None,
|
|
673
|
+
border_radius: Optional[float] = None,
|
|
674
|
+
opacity: Optional[float] = None,
|
|
675
|
+
rotation: Optional[float] = None,
|
|
676
|
+
background: Optional[str] = None,
|
|
677
|
+
output: Optional[ImageFormat] = None,
|
|
678
|
+
token: Optional[str] = None
|
|
679
|
+
) -> bytes:
|
|
680
|
+
"""
|
|
681
|
+
Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
|
682
|
+
|
|
683
|
+
Parameters
|
|
684
|
+
----------
|
|
685
|
+
bucket_id : str
|
|
686
|
+
Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
687
|
+
file_id : str
|
|
688
|
+
File ID
|
|
689
|
+
width : Optional[float]
|
|
690
|
+
Resize preview image width, Pass an integer between 0 to 4000.
|
|
691
|
+
height : Optional[float]
|
|
692
|
+
Resize preview image height, Pass an integer between 0 to 4000.
|
|
693
|
+
gravity : Optional[ImageGravity]
|
|
694
|
+
Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
|
695
|
+
quality : Optional[float]
|
|
696
|
+
Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
697
|
+
border_width : Optional[float]
|
|
698
|
+
Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
|
699
|
+
border_color : Optional[str]
|
|
700
|
+
Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
|
701
|
+
border_radius : Optional[float]
|
|
702
|
+
Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
|
703
|
+
opacity : Optional[float]
|
|
704
|
+
Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
|
705
|
+
rotation : Optional[float]
|
|
706
|
+
Preview image rotation in degrees. Pass an integer between -360 and 360.
|
|
707
|
+
background : Optional[str]
|
|
708
|
+
Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
|
709
|
+
output : Optional[ImageFormat]
|
|
710
|
+
Output format type (jpeg, jpg, png, gif and webp).
|
|
711
|
+
token : Optional[str]
|
|
712
|
+
File token for accessing this file.
|
|
713
|
+
|
|
714
|
+
Returns
|
|
715
|
+
-------
|
|
716
|
+
bytes
|
|
717
|
+
Response as bytes
|
|
718
|
+
|
|
719
|
+
Raises
|
|
720
|
+
------
|
|
721
|
+
AppwriteException
|
|
722
|
+
If API request fails
|
|
723
|
+
"""
|
|
724
|
+
|
|
725
|
+
api_path = '/storage/buckets/{bucketId}/files/{fileId}/preview'
|
|
726
|
+
api_params = {}
|
|
727
|
+
if bucket_id is None:
|
|
728
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
729
|
+
|
|
730
|
+
if file_id is None:
|
|
731
|
+
raise AppwriteException('Missing required parameter: "file_id"')
|
|
732
|
+
|
|
733
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
734
|
+
api_path = api_path.replace('{fileId}', str(self._normalize_value(file_id)))
|
|
735
|
+
|
|
736
|
+
if width is not None:
|
|
737
|
+
api_params['width'] = self._normalize_value(width)
|
|
738
|
+
if height is not None:
|
|
739
|
+
api_params['height'] = self._normalize_value(height)
|
|
740
|
+
if gravity is not None:
|
|
741
|
+
api_params['gravity'] = self._normalize_value(gravity)
|
|
742
|
+
if quality is not None:
|
|
743
|
+
api_params['quality'] = self._normalize_value(quality)
|
|
744
|
+
if border_width is not None:
|
|
745
|
+
api_params['borderWidth'] = self._normalize_value(border_width)
|
|
746
|
+
if border_color is not None:
|
|
747
|
+
api_params['borderColor'] = self._normalize_value(border_color)
|
|
748
|
+
if border_radius is not None:
|
|
749
|
+
api_params['borderRadius'] = self._normalize_value(border_radius)
|
|
750
|
+
if opacity is not None:
|
|
751
|
+
api_params['opacity'] = self._normalize_value(opacity)
|
|
752
|
+
if rotation is not None:
|
|
753
|
+
api_params['rotation'] = self._normalize_value(rotation)
|
|
754
|
+
if background is not None:
|
|
755
|
+
api_params['background'] = self._normalize_value(background)
|
|
756
|
+
if output is not None:
|
|
757
|
+
api_params['output'] = self._normalize_value(output)
|
|
758
|
+
if token is not None:
|
|
759
|
+
api_params['token'] = self._normalize_value(token)
|
|
760
|
+
|
|
761
|
+
response = self.client.call('get', api_path, {
|
|
762
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
763
|
+
'accept': 'image/*',
|
|
764
|
+
}, api_params)
|
|
765
|
+
|
|
766
|
+
return response
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
def get_file_view(
|
|
770
|
+
self,
|
|
771
|
+
bucket_id: str,
|
|
772
|
+
file_id: str,
|
|
773
|
+
token: Optional[str] = None
|
|
774
|
+
) -> bytes:
|
|
775
|
+
"""
|
|
776
|
+
Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
|
777
|
+
|
|
778
|
+
Parameters
|
|
779
|
+
----------
|
|
780
|
+
bucket_id : str
|
|
781
|
+
Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
782
|
+
file_id : str
|
|
783
|
+
File ID.
|
|
784
|
+
token : Optional[str]
|
|
785
|
+
File token for accessing this file.
|
|
786
|
+
|
|
787
|
+
Returns
|
|
788
|
+
-------
|
|
789
|
+
bytes
|
|
790
|
+
Response as bytes
|
|
791
|
+
|
|
792
|
+
Raises
|
|
793
|
+
------
|
|
794
|
+
AppwriteException
|
|
795
|
+
If API request fails
|
|
796
|
+
"""
|
|
797
|
+
|
|
798
|
+
api_path = '/storage/buckets/{bucketId}/files/{fileId}/view'
|
|
799
|
+
api_params = {}
|
|
800
|
+
if bucket_id is None:
|
|
801
|
+
raise AppwriteException('Missing required parameter: "bucket_id"')
|
|
802
|
+
|
|
803
|
+
if file_id is None:
|
|
804
|
+
raise AppwriteException('Missing required parameter: "file_id"')
|
|
805
|
+
|
|
806
|
+
api_path = api_path.replace('{bucketId}', str(self._normalize_value(bucket_id)))
|
|
807
|
+
api_path = api_path.replace('{fileId}', str(self._normalize_value(file_id)))
|
|
808
|
+
|
|
809
|
+
if token is not None:
|
|
810
|
+
api_params['token'] = self._normalize_value(token)
|
|
811
|
+
|
|
812
|
+
response = self.client.call('get', api_path, {
|
|
813
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
814
|
+
'accept': '*/*',
|
|
815
|
+
}, api_params)
|
|
816
|
+
|
|
817
|
+
return response
|
|
818
|
+
|