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,2245 @@
|
|
|
1
|
+
from ..service import Service
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
from typing import Any, Dict, List, Optional, Union, Type, TypeVar
|
|
4
|
+
from ..exception import AppwriteException
|
|
5
|
+
from appwrite_console.utils.deprecated import deprecated
|
|
6
|
+
from ..models.organization_list import OrganizationList
|
|
7
|
+
from ..enums.platform import Platform
|
|
8
|
+
from ..models.organization import Organization
|
|
9
|
+
from ..models.payment_authentication import PaymentAuthentication
|
|
10
|
+
from ..models.estimation import Estimation
|
|
11
|
+
from ..models.addon_list import AddonList
|
|
12
|
+
from ..models.addon import Addon
|
|
13
|
+
from ..enums.addon import Addon as AddonEnum
|
|
14
|
+
from ..models.addon_price import AddonPrice
|
|
15
|
+
from ..models.aggregation_team_list import AggregationTeamList
|
|
16
|
+
from ..models.aggregation_team import AggregationTeam
|
|
17
|
+
from ..models.billing_address import BillingAddress
|
|
18
|
+
from ..models.credit_list import CreditList
|
|
19
|
+
from ..models.credit import Credit
|
|
20
|
+
from ..models.credit_available import CreditAvailable
|
|
21
|
+
from ..models.estimation_delete_organization import EstimationDeleteOrganization
|
|
22
|
+
from ..models.estimation_update_plan import EstimationUpdatePlan
|
|
23
|
+
from ..models.downgrade_feedback import DowngradeFeedback
|
|
24
|
+
from ..models.invoice_list import InvoiceList
|
|
25
|
+
from ..models.invoice import Invoice
|
|
26
|
+
from ..models.payment_method import PaymentMethod
|
|
27
|
+
from ..models.billing_plan import BillingPlan
|
|
28
|
+
from ..models.estimation_plan_change import EstimationPlanChange
|
|
29
|
+
from ..models.console_region_list import ConsoleRegionList
|
|
30
|
+
from ..models.roles import Roles
|
|
31
|
+
from ..models.usage_organization import UsageOrganization
|
|
32
|
+
|
|
33
|
+
T = TypeVar('T')
|
|
34
|
+
|
|
35
|
+
class Organizations(Service):
|
|
36
|
+
|
|
37
|
+
def __init__(self, client) -> None:
|
|
38
|
+
super(Organizations, self).__init__(client)
|
|
39
|
+
|
|
40
|
+
def list(
|
|
41
|
+
self,
|
|
42
|
+
queries: Optional[List[str]] = None,
|
|
43
|
+
search: Optional[str] = None,
|
|
44
|
+
model_type: Type[T] = dict
|
|
45
|
+
) -> OrganizationList[T]:
|
|
46
|
+
"""
|
|
47
|
+
Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
|
48
|
+
|
|
49
|
+
Parameters
|
|
50
|
+
----------
|
|
51
|
+
queries : Optional[List[str]]
|
|
52
|
+
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, total, billingPlan, paymentMethodId, backupPaymentMethodId, platform
|
|
53
|
+
search : Optional[str]
|
|
54
|
+
Search term to filter your list results. Max length: 256 chars.
|
|
55
|
+
|
|
56
|
+
model_type : Type[T], optional
|
|
57
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
58
|
+
|
|
59
|
+
Returns
|
|
60
|
+
-------
|
|
61
|
+
OrganizationList[T]
|
|
62
|
+
API response as a typed Pydantic model
|
|
63
|
+
|
|
64
|
+
Raises
|
|
65
|
+
------
|
|
66
|
+
AppwriteException
|
|
67
|
+
If API request fails
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
api_path = '/organizations'
|
|
71
|
+
api_params = {}
|
|
72
|
+
|
|
73
|
+
if queries is not None:
|
|
74
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
75
|
+
if search is not None:
|
|
76
|
+
api_params['search'] = self._normalize_value(search)
|
|
77
|
+
|
|
78
|
+
response = self.client.call('get', api_path, {
|
|
79
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
80
|
+
'accept': 'application/json',
|
|
81
|
+
}, api_params)
|
|
82
|
+
|
|
83
|
+
return OrganizationList.with_data(response, model_type)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def create(
|
|
87
|
+
self,
|
|
88
|
+
organization_id: str,
|
|
89
|
+
name: str,
|
|
90
|
+
billing_plan: str,
|
|
91
|
+
payment_method_id: Optional[str] = None,
|
|
92
|
+
billing_address_id: Optional[str] = None,
|
|
93
|
+
invites: Optional[List[str]] = None,
|
|
94
|
+
coupon_id: Optional[str] = None,
|
|
95
|
+
tax_id: Optional[str] = None,
|
|
96
|
+
budget: Optional[float] = None,
|
|
97
|
+
platform: Optional[Platform] = None,
|
|
98
|
+
model_type: Type[T] = dict
|
|
99
|
+
) -> Union[Organization, PaymentAuthentication]:
|
|
100
|
+
"""
|
|
101
|
+
Create a new organization.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
Parameters
|
|
105
|
+
----------
|
|
106
|
+
organization_id : str
|
|
107
|
+
Organization 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.
|
|
108
|
+
name : str
|
|
109
|
+
Organization name. Max length: 128 chars.
|
|
110
|
+
billing_plan : str
|
|
111
|
+
Organization billing plan chosen
|
|
112
|
+
payment_method_id : Optional[str]
|
|
113
|
+
Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
114
|
+
billing_address_id : Optional[str]
|
|
115
|
+
Unique ID of billing address
|
|
116
|
+
invites : Optional[List[str]]
|
|
117
|
+
Additional member invites
|
|
118
|
+
coupon_id : Optional[str]
|
|
119
|
+
Coupon id
|
|
120
|
+
tax_id : Optional[str]
|
|
121
|
+
Tax Id associated to billing.
|
|
122
|
+
budget : Optional[float]
|
|
123
|
+
Budget limit for additional usage set for the organization
|
|
124
|
+
platform : Optional[Platform]
|
|
125
|
+
Platform type
|
|
126
|
+
|
|
127
|
+
model_type : Type[T], optional
|
|
128
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
129
|
+
|
|
130
|
+
Returns
|
|
131
|
+
-------
|
|
132
|
+
Union[Organization, PaymentAuthentication]
|
|
133
|
+
API response as one of the typed response models
|
|
134
|
+
|
|
135
|
+
Raises
|
|
136
|
+
------
|
|
137
|
+
AppwriteException
|
|
138
|
+
If API request fails
|
|
139
|
+
"""
|
|
140
|
+
|
|
141
|
+
api_path = '/organizations'
|
|
142
|
+
api_params = {}
|
|
143
|
+
if organization_id is None:
|
|
144
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
145
|
+
|
|
146
|
+
if name is None:
|
|
147
|
+
raise AppwriteException('Missing required parameter: "name"')
|
|
148
|
+
|
|
149
|
+
if billing_plan is None:
|
|
150
|
+
raise AppwriteException('Missing required parameter: "billing_plan"')
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
api_params['organizationId'] = self._normalize_value(organization_id)
|
|
154
|
+
api_params['name'] = self._normalize_value(name)
|
|
155
|
+
api_params['billingPlan'] = self._normalize_value(billing_plan)
|
|
156
|
+
if payment_method_id is not None:
|
|
157
|
+
api_params['paymentMethodId'] = self._normalize_value(payment_method_id)
|
|
158
|
+
if billing_address_id is not None:
|
|
159
|
+
api_params['billingAddressId'] = self._normalize_value(billing_address_id)
|
|
160
|
+
if invites is not None:
|
|
161
|
+
api_params['invites'] = self._normalize_value(invites)
|
|
162
|
+
if coupon_id is not None:
|
|
163
|
+
api_params['couponId'] = self._normalize_value(coupon_id)
|
|
164
|
+
if tax_id is not None:
|
|
165
|
+
api_params['taxId'] = self._normalize_value(tax_id)
|
|
166
|
+
if budget is not None:
|
|
167
|
+
api_params['budget'] = self._normalize_value(budget)
|
|
168
|
+
if platform is not None:
|
|
169
|
+
api_params['platform'] = self._normalize_value(platform)
|
|
170
|
+
|
|
171
|
+
response = self.client.call('post', api_path, {
|
|
172
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
173
|
+
'content-type': 'application/json',
|
|
174
|
+
'accept': 'application/json',
|
|
175
|
+
}, api_params)
|
|
176
|
+
|
|
177
|
+
return self._parse_response(response, model=Organization)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def estimation_create_organization(
|
|
181
|
+
self,
|
|
182
|
+
billing_plan: str,
|
|
183
|
+
payment_method_id: Optional[str] = None,
|
|
184
|
+
invites: Optional[List[str]] = None,
|
|
185
|
+
coupon_id: Optional[str] = None,
|
|
186
|
+
platform: Optional[Platform] = None
|
|
187
|
+
) -> Estimation:
|
|
188
|
+
"""
|
|
189
|
+
Get estimation for creating an organization.
|
|
190
|
+
|
|
191
|
+
Parameters
|
|
192
|
+
----------
|
|
193
|
+
billing_plan : str
|
|
194
|
+
Organization billing plan chosen
|
|
195
|
+
payment_method_id : Optional[str]
|
|
196
|
+
Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
197
|
+
invites : Optional[List[str]]
|
|
198
|
+
Additional member invites
|
|
199
|
+
coupon_id : Optional[str]
|
|
200
|
+
Coupon id
|
|
201
|
+
platform : Optional[Platform]
|
|
202
|
+
Platform type
|
|
203
|
+
|
|
204
|
+
Returns
|
|
205
|
+
-------
|
|
206
|
+
Estimation
|
|
207
|
+
API response as a typed Pydantic model
|
|
208
|
+
|
|
209
|
+
Raises
|
|
210
|
+
------
|
|
211
|
+
AppwriteException
|
|
212
|
+
If API request fails
|
|
213
|
+
"""
|
|
214
|
+
|
|
215
|
+
api_path = '/organizations/estimations/create-organization'
|
|
216
|
+
api_params = {}
|
|
217
|
+
if billing_plan is None:
|
|
218
|
+
raise AppwriteException('Missing required parameter: "billing_plan"')
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
api_params['billingPlan'] = self._normalize_value(billing_plan)
|
|
222
|
+
if payment_method_id is not None:
|
|
223
|
+
api_params['paymentMethodId'] = self._normalize_value(payment_method_id)
|
|
224
|
+
if invites is not None:
|
|
225
|
+
api_params['invites'] = self._normalize_value(invites)
|
|
226
|
+
if coupon_id is not None:
|
|
227
|
+
api_params['couponId'] = self._normalize_value(coupon_id)
|
|
228
|
+
if platform is not None:
|
|
229
|
+
api_params['platform'] = self._normalize_value(platform)
|
|
230
|
+
|
|
231
|
+
response = self.client.call('patch', api_path, {
|
|
232
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
233
|
+
'content-type': 'application/json',
|
|
234
|
+
'accept': 'application/json',
|
|
235
|
+
}, api_params)
|
|
236
|
+
|
|
237
|
+
return self._parse_response(response, model=Estimation)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def delete(
|
|
241
|
+
self,
|
|
242
|
+
organization_id: str
|
|
243
|
+
) -> Dict[str, Any]:
|
|
244
|
+
"""
|
|
245
|
+
Delete an organization.
|
|
246
|
+
|
|
247
|
+
Parameters
|
|
248
|
+
----------
|
|
249
|
+
organization_id : str
|
|
250
|
+
Team ID.
|
|
251
|
+
|
|
252
|
+
Returns
|
|
253
|
+
-------
|
|
254
|
+
Dict[str, Any]
|
|
255
|
+
API response as a dictionary
|
|
256
|
+
|
|
257
|
+
Raises
|
|
258
|
+
------
|
|
259
|
+
AppwriteException
|
|
260
|
+
If API request fails
|
|
261
|
+
"""
|
|
262
|
+
|
|
263
|
+
api_path = '/organizations/{organizationId}'
|
|
264
|
+
api_params = {}
|
|
265
|
+
if organization_id is None:
|
|
266
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
267
|
+
|
|
268
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
response = self.client.call('delete', api_path, {
|
|
272
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
273
|
+
'content-type': 'application/json',
|
|
274
|
+
'accept': 'application/json',
|
|
275
|
+
}, api_params)
|
|
276
|
+
|
|
277
|
+
return response
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def list_addons(
|
|
281
|
+
self,
|
|
282
|
+
organization_id: str
|
|
283
|
+
) -> AddonList:
|
|
284
|
+
"""
|
|
285
|
+
List all billing addons for an organization.
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
Parameters
|
|
289
|
+
----------
|
|
290
|
+
organization_id : str
|
|
291
|
+
Organization ID
|
|
292
|
+
|
|
293
|
+
Returns
|
|
294
|
+
-------
|
|
295
|
+
AddonList
|
|
296
|
+
API response as a typed Pydantic model
|
|
297
|
+
|
|
298
|
+
Raises
|
|
299
|
+
------
|
|
300
|
+
AppwriteException
|
|
301
|
+
If API request fails
|
|
302
|
+
"""
|
|
303
|
+
|
|
304
|
+
api_path = '/organizations/{organizationId}/addons'
|
|
305
|
+
api_params = {}
|
|
306
|
+
if organization_id is None:
|
|
307
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
308
|
+
|
|
309
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
response = self.client.call('get', api_path, {
|
|
313
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
314
|
+
'accept': 'application/json',
|
|
315
|
+
}, api_params)
|
|
316
|
+
|
|
317
|
+
return self._parse_response(response, model=AddonList)
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
def create_baa_addon(
|
|
321
|
+
self,
|
|
322
|
+
organization_id: str
|
|
323
|
+
) -> Addon:
|
|
324
|
+
"""
|
|
325
|
+
Create the BAA billing addon for an organization.
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
Parameters
|
|
329
|
+
----------
|
|
330
|
+
organization_id : str
|
|
331
|
+
Organization ID
|
|
332
|
+
|
|
333
|
+
Returns
|
|
334
|
+
-------
|
|
335
|
+
Addon
|
|
336
|
+
API response as a typed Pydantic model
|
|
337
|
+
|
|
338
|
+
Raises
|
|
339
|
+
------
|
|
340
|
+
AppwriteException
|
|
341
|
+
If API request fails
|
|
342
|
+
"""
|
|
343
|
+
|
|
344
|
+
api_path = '/organizations/{organizationId}/addons/baa'
|
|
345
|
+
api_params = {}
|
|
346
|
+
if organization_id is None:
|
|
347
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
348
|
+
|
|
349
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
response = self.client.call('post', api_path, {
|
|
353
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
354
|
+
'content-type': 'application/json',
|
|
355
|
+
'accept': 'application/json',
|
|
356
|
+
}, api_params)
|
|
357
|
+
|
|
358
|
+
return self._parse_response(response, model=Addon)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
def create_premium_geo_db_addon(
|
|
362
|
+
self,
|
|
363
|
+
organization_id: str
|
|
364
|
+
) -> Addon:
|
|
365
|
+
"""
|
|
366
|
+
Create a Premium Geo DB addon for an organization.
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
Parameters
|
|
370
|
+
----------
|
|
371
|
+
organization_id : str
|
|
372
|
+
Organization ID
|
|
373
|
+
|
|
374
|
+
Returns
|
|
375
|
+
-------
|
|
376
|
+
Addon
|
|
377
|
+
API response as a typed Pydantic model
|
|
378
|
+
|
|
379
|
+
Raises
|
|
380
|
+
------
|
|
381
|
+
AppwriteException
|
|
382
|
+
If API request fails
|
|
383
|
+
"""
|
|
384
|
+
|
|
385
|
+
api_path = '/organizations/{organizationId}/addons/premium-geo-db'
|
|
386
|
+
api_params = {}
|
|
387
|
+
if organization_id is None:
|
|
388
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
389
|
+
|
|
390
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
response = self.client.call('post', api_path, {
|
|
394
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
395
|
+
'content-type': 'application/json',
|
|
396
|
+
'accept': 'application/json',
|
|
397
|
+
}, api_params)
|
|
398
|
+
|
|
399
|
+
return self._parse_response(response, model=Addon)
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
def get_addon(
|
|
403
|
+
self,
|
|
404
|
+
organization_id: str,
|
|
405
|
+
addon_id: str
|
|
406
|
+
) -> Addon:
|
|
407
|
+
"""
|
|
408
|
+
Get the details of a billing addon for an organization.
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
Parameters
|
|
412
|
+
----------
|
|
413
|
+
organization_id : str
|
|
414
|
+
Organization ID
|
|
415
|
+
addon_id : str
|
|
416
|
+
Addon ID
|
|
417
|
+
|
|
418
|
+
Returns
|
|
419
|
+
-------
|
|
420
|
+
Addon
|
|
421
|
+
API response as a typed Pydantic model
|
|
422
|
+
|
|
423
|
+
Raises
|
|
424
|
+
------
|
|
425
|
+
AppwriteException
|
|
426
|
+
If API request fails
|
|
427
|
+
"""
|
|
428
|
+
|
|
429
|
+
api_path = '/organizations/{organizationId}/addons/{addonId}'
|
|
430
|
+
api_params = {}
|
|
431
|
+
if organization_id is None:
|
|
432
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
433
|
+
|
|
434
|
+
if addon_id is None:
|
|
435
|
+
raise AppwriteException('Missing required parameter: "addon_id"')
|
|
436
|
+
|
|
437
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
438
|
+
api_path = api_path.replace('{addonId}', str(self._normalize_value(addon_id)))
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
response = self.client.call('get', api_path, {
|
|
442
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
443
|
+
'accept': 'application/json',
|
|
444
|
+
}, api_params)
|
|
445
|
+
|
|
446
|
+
return self._parse_response(response, model=Addon)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
def delete_addon(
|
|
450
|
+
self,
|
|
451
|
+
organization_id: str,
|
|
452
|
+
addon_id: str
|
|
453
|
+
) -> Dict[str, Any]:
|
|
454
|
+
"""
|
|
455
|
+
Delete a billing addon for an organization.
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
Parameters
|
|
459
|
+
----------
|
|
460
|
+
organization_id : str
|
|
461
|
+
Organization ID
|
|
462
|
+
addon_id : str
|
|
463
|
+
Addon ID
|
|
464
|
+
|
|
465
|
+
Returns
|
|
466
|
+
-------
|
|
467
|
+
Dict[str, Any]
|
|
468
|
+
API response as a dictionary
|
|
469
|
+
|
|
470
|
+
Raises
|
|
471
|
+
------
|
|
472
|
+
AppwriteException
|
|
473
|
+
If API request fails
|
|
474
|
+
"""
|
|
475
|
+
|
|
476
|
+
api_path = '/organizations/{organizationId}/addons/{addonId}'
|
|
477
|
+
api_params = {}
|
|
478
|
+
if organization_id is None:
|
|
479
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
480
|
+
|
|
481
|
+
if addon_id is None:
|
|
482
|
+
raise AppwriteException('Missing required parameter: "addon_id"')
|
|
483
|
+
|
|
484
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
485
|
+
api_path = api_path.replace('{addonId}', str(self._normalize_value(addon_id)))
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
response = self.client.call('delete', api_path, {
|
|
489
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
490
|
+
'content-type': 'application/json',
|
|
491
|
+
'accept': 'application/json',
|
|
492
|
+
}, api_params)
|
|
493
|
+
|
|
494
|
+
return response
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
def confirm_addon_payment(
|
|
498
|
+
self,
|
|
499
|
+
organization_id: str,
|
|
500
|
+
addon_id: str
|
|
501
|
+
) -> Addon:
|
|
502
|
+
"""
|
|
503
|
+
Confirm payment for a billing addon for an organization.
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
Parameters
|
|
507
|
+
----------
|
|
508
|
+
organization_id : str
|
|
509
|
+
Organization ID
|
|
510
|
+
addon_id : str
|
|
511
|
+
Addon ID
|
|
512
|
+
|
|
513
|
+
Returns
|
|
514
|
+
-------
|
|
515
|
+
Addon
|
|
516
|
+
API response as a typed Pydantic model
|
|
517
|
+
|
|
518
|
+
Raises
|
|
519
|
+
------
|
|
520
|
+
AppwriteException
|
|
521
|
+
If API request fails
|
|
522
|
+
"""
|
|
523
|
+
|
|
524
|
+
api_path = '/organizations/{organizationId}/addons/{addonId}/confirmations'
|
|
525
|
+
api_params = {}
|
|
526
|
+
if organization_id is None:
|
|
527
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
528
|
+
|
|
529
|
+
if addon_id is None:
|
|
530
|
+
raise AppwriteException('Missing required parameter: "addon_id"')
|
|
531
|
+
|
|
532
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
533
|
+
api_path = api_path.replace('{addonId}', str(self._normalize_value(addon_id)))
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
response = self.client.call('post', api_path, {
|
|
537
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
538
|
+
'content-type': 'application/json',
|
|
539
|
+
'accept': 'application/json',
|
|
540
|
+
}, api_params)
|
|
541
|
+
|
|
542
|
+
return self._parse_response(response, model=Addon)
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
def get_addon_price(
|
|
546
|
+
self,
|
|
547
|
+
organization_id: str,
|
|
548
|
+
addon: AddonEnum
|
|
549
|
+
) -> AddonPrice:
|
|
550
|
+
"""
|
|
551
|
+
Get the price details for a billing addon for an organization.
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
Parameters
|
|
555
|
+
----------
|
|
556
|
+
organization_id : str
|
|
557
|
+
Organization ID
|
|
558
|
+
addon : AddonEnum
|
|
559
|
+
Addon key identifier (e.g. baa).
|
|
560
|
+
|
|
561
|
+
Returns
|
|
562
|
+
-------
|
|
563
|
+
AddonPrice
|
|
564
|
+
API response as a typed Pydantic model
|
|
565
|
+
|
|
566
|
+
Raises
|
|
567
|
+
------
|
|
568
|
+
AppwriteException
|
|
569
|
+
If API request fails
|
|
570
|
+
"""
|
|
571
|
+
|
|
572
|
+
api_path = '/organizations/{organizationId}/addons/{addon}/price'
|
|
573
|
+
api_params = {}
|
|
574
|
+
if organization_id is None:
|
|
575
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
576
|
+
|
|
577
|
+
if addon is None:
|
|
578
|
+
raise AppwriteException('Missing required parameter: "addon"')
|
|
579
|
+
|
|
580
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
581
|
+
api_path = api_path.replace('{addon}', str(self._normalize_value(addon)))
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
response = self.client.call('get', api_path, {
|
|
585
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
586
|
+
'accept': 'application/json',
|
|
587
|
+
}, api_params)
|
|
588
|
+
|
|
589
|
+
return self._parse_response(response, model=AddonPrice)
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
def list_aggregations(
|
|
593
|
+
self,
|
|
594
|
+
organization_id: str,
|
|
595
|
+
queries: Optional[List[str]] = None
|
|
596
|
+
) -> AggregationTeamList:
|
|
597
|
+
"""
|
|
598
|
+
Get a list of all aggregations for an organization.
|
|
599
|
+
|
|
600
|
+
Parameters
|
|
601
|
+
----------
|
|
602
|
+
organization_id : str
|
|
603
|
+
Organization ID
|
|
604
|
+
queries : Optional[List[str]]
|
|
605
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, from, to
|
|
606
|
+
|
|
607
|
+
Returns
|
|
608
|
+
-------
|
|
609
|
+
AggregationTeamList
|
|
610
|
+
API response as a typed Pydantic model
|
|
611
|
+
|
|
612
|
+
Raises
|
|
613
|
+
------
|
|
614
|
+
AppwriteException
|
|
615
|
+
If API request fails
|
|
616
|
+
"""
|
|
617
|
+
|
|
618
|
+
api_path = '/organizations/{organizationId}/aggregations'
|
|
619
|
+
api_params = {}
|
|
620
|
+
if organization_id is None:
|
|
621
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
622
|
+
|
|
623
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
624
|
+
|
|
625
|
+
if queries is not None:
|
|
626
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
627
|
+
|
|
628
|
+
response = self.client.call('get', api_path, {
|
|
629
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
630
|
+
'accept': 'application/json',
|
|
631
|
+
}, api_params)
|
|
632
|
+
|
|
633
|
+
return self._parse_response(response, model=AggregationTeamList)
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
def get_aggregation(
|
|
637
|
+
self,
|
|
638
|
+
organization_id: str,
|
|
639
|
+
aggregation_id: str,
|
|
640
|
+
limit: Optional[float] = None,
|
|
641
|
+
offset: Optional[float] = None
|
|
642
|
+
) -> AggregationTeam:
|
|
643
|
+
"""
|
|
644
|
+
Get a specific aggregation using it's aggregation ID.
|
|
645
|
+
|
|
646
|
+
Parameters
|
|
647
|
+
----------
|
|
648
|
+
organization_id : str
|
|
649
|
+
Organization ID
|
|
650
|
+
aggregation_id : str
|
|
651
|
+
Invoice unique ID
|
|
652
|
+
limit : Optional[float]
|
|
653
|
+
Maximum number of project aggregations to return in response. By default will return maximum 5 results. Maximum of 10 results allowed per request.
|
|
654
|
+
offset : Optional[float]
|
|
655
|
+
Offset value. The default value is 0. Use this param to manage pagination.
|
|
656
|
+
|
|
657
|
+
Returns
|
|
658
|
+
-------
|
|
659
|
+
AggregationTeam
|
|
660
|
+
API response as a typed Pydantic model
|
|
661
|
+
|
|
662
|
+
Raises
|
|
663
|
+
------
|
|
664
|
+
AppwriteException
|
|
665
|
+
If API request fails
|
|
666
|
+
"""
|
|
667
|
+
|
|
668
|
+
api_path = '/organizations/{organizationId}/aggregations/{aggregationId}'
|
|
669
|
+
api_params = {}
|
|
670
|
+
if organization_id is None:
|
|
671
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
672
|
+
|
|
673
|
+
if aggregation_id is None:
|
|
674
|
+
raise AppwriteException('Missing required parameter: "aggregation_id"')
|
|
675
|
+
|
|
676
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
677
|
+
api_path = api_path.replace('{aggregationId}', str(self._normalize_value(aggregation_id)))
|
|
678
|
+
|
|
679
|
+
if limit is not None:
|
|
680
|
+
api_params['limit'] = self._normalize_value(limit)
|
|
681
|
+
if offset is not None:
|
|
682
|
+
api_params['offset'] = self._normalize_value(offset)
|
|
683
|
+
|
|
684
|
+
response = self.client.call('get', api_path, {
|
|
685
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
686
|
+
'accept': 'application/json',
|
|
687
|
+
}, api_params)
|
|
688
|
+
|
|
689
|
+
return self._parse_response(response, model=AggregationTeam)
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
def set_billing_address(
|
|
693
|
+
self,
|
|
694
|
+
organization_id: str,
|
|
695
|
+
billing_address_id: str,
|
|
696
|
+
model_type: Type[T] = dict
|
|
697
|
+
) -> Organization[T]:
|
|
698
|
+
"""
|
|
699
|
+
Set a billing address for an organization.
|
|
700
|
+
|
|
701
|
+
Parameters
|
|
702
|
+
----------
|
|
703
|
+
organization_id : str
|
|
704
|
+
Organization ID
|
|
705
|
+
billing_address_id : str
|
|
706
|
+
Unique ID of billing address
|
|
707
|
+
|
|
708
|
+
model_type : Type[T], optional
|
|
709
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
710
|
+
|
|
711
|
+
Returns
|
|
712
|
+
-------
|
|
713
|
+
Organization[T]
|
|
714
|
+
API response as a typed Pydantic model
|
|
715
|
+
|
|
716
|
+
Raises
|
|
717
|
+
------
|
|
718
|
+
AppwriteException
|
|
719
|
+
If API request fails
|
|
720
|
+
"""
|
|
721
|
+
|
|
722
|
+
api_path = '/organizations/{organizationId}/billing-address'
|
|
723
|
+
api_params = {}
|
|
724
|
+
if organization_id is None:
|
|
725
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
726
|
+
|
|
727
|
+
if billing_address_id is None:
|
|
728
|
+
raise AppwriteException('Missing required parameter: "billing_address_id"')
|
|
729
|
+
|
|
730
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
731
|
+
|
|
732
|
+
api_params['billingAddressId'] = self._normalize_value(billing_address_id)
|
|
733
|
+
|
|
734
|
+
response = self.client.call('patch', api_path, {
|
|
735
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
736
|
+
'content-type': 'application/json',
|
|
737
|
+
'accept': 'application/json',
|
|
738
|
+
}, api_params)
|
|
739
|
+
|
|
740
|
+
return Organization.with_data(response, model_type)
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
def delete_billing_address(
|
|
744
|
+
self,
|
|
745
|
+
organization_id: str
|
|
746
|
+
) -> Dict[str, Any]:
|
|
747
|
+
"""
|
|
748
|
+
Delete a team's billing address.
|
|
749
|
+
|
|
750
|
+
Parameters
|
|
751
|
+
----------
|
|
752
|
+
organization_id : str
|
|
753
|
+
Organization ID
|
|
754
|
+
|
|
755
|
+
Returns
|
|
756
|
+
-------
|
|
757
|
+
Dict[str, Any]
|
|
758
|
+
API response as a dictionary
|
|
759
|
+
|
|
760
|
+
Raises
|
|
761
|
+
------
|
|
762
|
+
AppwriteException
|
|
763
|
+
If API request fails
|
|
764
|
+
"""
|
|
765
|
+
|
|
766
|
+
api_path = '/organizations/{organizationId}/billing-address'
|
|
767
|
+
api_params = {}
|
|
768
|
+
if organization_id is None:
|
|
769
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
770
|
+
|
|
771
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
response = self.client.call('delete', api_path, {
|
|
775
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
776
|
+
'content-type': 'application/json',
|
|
777
|
+
'accept': 'application/json',
|
|
778
|
+
}, api_params)
|
|
779
|
+
|
|
780
|
+
return response
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
def get_billing_address(
|
|
784
|
+
self,
|
|
785
|
+
organization_id: str,
|
|
786
|
+
billing_address_id: str
|
|
787
|
+
) -> BillingAddress:
|
|
788
|
+
"""
|
|
789
|
+
Get a billing address using it's ID.
|
|
790
|
+
|
|
791
|
+
Parameters
|
|
792
|
+
----------
|
|
793
|
+
organization_id : str
|
|
794
|
+
Organization ID
|
|
795
|
+
billing_address_id : str
|
|
796
|
+
Unique ID of billing address
|
|
797
|
+
|
|
798
|
+
Returns
|
|
799
|
+
-------
|
|
800
|
+
BillingAddress
|
|
801
|
+
API response as a typed Pydantic model
|
|
802
|
+
|
|
803
|
+
Raises
|
|
804
|
+
------
|
|
805
|
+
AppwriteException
|
|
806
|
+
If API request fails
|
|
807
|
+
"""
|
|
808
|
+
|
|
809
|
+
api_path = '/organizations/{organizationId}/billing-addresses/{billingAddressId}'
|
|
810
|
+
api_params = {}
|
|
811
|
+
if organization_id is None:
|
|
812
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
813
|
+
|
|
814
|
+
if billing_address_id is None:
|
|
815
|
+
raise AppwriteException('Missing required parameter: "billing_address_id"')
|
|
816
|
+
|
|
817
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
818
|
+
api_path = api_path.replace('{billingAddressId}', str(self._normalize_value(billing_address_id)))
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
response = self.client.call('get', api_path, {
|
|
822
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
823
|
+
'accept': 'application/json',
|
|
824
|
+
}, api_params)
|
|
825
|
+
|
|
826
|
+
return self._parse_response(response, model=BillingAddress)
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
def set_billing_email(
|
|
830
|
+
self,
|
|
831
|
+
organization_id: str,
|
|
832
|
+
billing_email: str,
|
|
833
|
+
model_type: Type[T] = dict
|
|
834
|
+
) -> Organization[T]:
|
|
835
|
+
"""
|
|
836
|
+
Set the current billing email for the organization.
|
|
837
|
+
|
|
838
|
+
Parameters
|
|
839
|
+
----------
|
|
840
|
+
organization_id : str
|
|
841
|
+
Organization ID
|
|
842
|
+
billing_email : str
|
|
843
|
+
Billing email for the organization.
|
|
844
|
+
|
|
845
|
+
model_type : Type[T], optional
|
|
846
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
847
|
+
|
|
848
|
+
Returns
|
|
849
|
+
-------
|
|
850
|
+
Organization[T]
|
|
851
|
+
API response as a typed Pydantic model
|
|
852
|
+
|
|
853
|
+
Raises
|
|
854
|
+
------
|
|
855
|
+
AppwriteException
|
|
856
|
+
If API request fails
|
|
857
|
+
"""
|
|
858
|
+
|
|
859
|
+
api_path = '/organizations/{organizationId}/billing-email'
|
|
860
|
+
api_params = {}
|
|
861
|
+
if organization_id is None:
|
|
862
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
863
|
+
|
|
864
|
+
if billing_email is None:
|
|
865
|
+
raise AppwriteException('Missing required parameter: "billing_email"')
|
|
866
|
+
|
|
867
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
868
|
+
|
|
869
|
+
api_params['billingEmail'] = self._normalize_value(billing_email)
|
|
870
|
+
|
|
871
|
+
response = self.client.call('patch', api_path, {
|
|
872
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
873
|
+
'content-type': 'application/json',
|
|
874
|
+
'accept': 'application/json',
|
|
875
|
+
}, api_params)
|
|
876
|
+
|
|
877
|
+
return Organization.with_data(response, model_type)
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
def update_budget(
|
|
881
|
+
self,
|
|
882
|
+
organization_id: str,
|
|
883
|
+
budget: Optional[float],
|
|
884
|
+
alerts: Optional[List[float]] = None,
|
|
885
|
+
model_type: Type[T] = dict
|
|
886
|
+
) -> Organization[T]:
|
|
887
|
+
"""
|
|
888
|
+
Update the budget limit for an organization.
|
|
889
|
+
|
|
890
|
+
Parameters
|
|
891
|
+
----------
|
|
892
|
+
organization_id : str
|
|
893
|
+
Organization Unique ID
|
|
894
|
+
budget : Optional[float]
|
|
895
|
+
Budget limit for additional usage set for the organization
|
|
896
|
+
alerts : Optional[List[float]]
|
|
897
|
+
Budget alert limit percentage
|
|
898
|
+
|
|
899
|
+
model_type : Type[T], optional
|
|
900
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
901
|
+
|
|
902
|
+
Returns
|
|
903
|
+
-------
|
|
904
|
+
Organization[T]
|
|
905
|
+
API response as a typed Pydantic model
|
|
906
|
+
|
|
907
|
+
Raises
|
|
908
|
+
------
|
|
909
|
+
AppwriteException
|
|
910
|
+
If API request fails
|
|
911
|
+
"""
|
|
912
|
+
|
|
913
|
+
api_path = '/organizations/{organizationId}/budget'
|
|
914
|
+
api_params = {}
|
|
915
|
+
if organization_id is None:
|
|
916
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
917
|
+
|
|
918
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
919
|
+
|
|
920
|
+
api_params['budget'] = self._normalize_value(budget)
|
|
921
|
+
if alerts is not None:
|
|
922
|
+
api_params['alerts'] = self._normalize_value(alerts)
|
|
923
|
+
|
|
924
|
+
response = self.client.call('patch', api_path, {
|
|
925
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
926
|
+
'content-type': 'application/json',
|
|
927
|
+
'accept': 'application/json',
|
|
928
|
+
}, api_params)
|
|
929
|
+
|
|
930
|
+
return Organization.with_data(response, model_type)
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
def list_credits(
|
|
934
|
+
self,
|
|
935
|
+
organization_id: str,
|
|
936
|
+
queries: Optional[List[str]] = None
|
|
937
|
+
) -> CreditList:
|
|
938
|
+
"""
|
|
939
|
+
List all credits for an organization.
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
Parameters
|
|
943
|
+
----------
|
|
944
|
+
organization_id : str
|
|
945
|
+
Organization ID
|
|
946
|
+
queries : Optional[List[str]]
|
|
947
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, couponId, credits, expiration, status
|
|
948
|
+
|
|
949
|
+
Returns
|
|
950
|
+
-------
|
|
951
|
+
CreditList
|
|
952
|
+
API response as a typed Pydantic model
|
|
953
|
+
|
|
954
|
+
Raises
|
|
955
|
+
------
|
|
956
|
+
AppwriteException
|
|
957
|
+
If API request fails
|
|
958
|
+
"""
|
|
959
|
+
|
|
960
|
+
api_path = '/organizations/{organizationId}/credits'
|
|
961
|
+
api_params = {}
|
|
962
|
+
if organization_id is None:
|
|
963
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
964
|
+
|
|
965
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
966
|
+
|
|
967
|
+
if queries is not None:
|
|
968
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
969
|
+
|
|
970
|
+
response = self.client.call('get', api_path, {
|
|
971
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
972
|
+
'accept': 'application/json',
|
|
973
|
+
}, api_params)
|
|
974
|
+
|
|
975
|
+
return self._parse_response(response, model=CreditList)
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
def add_credit(
|
|
979
|
+
self,
|
|
980
|
+
organization_id: str,
|
|
981
|
+
coupon_id: str
|
|
982
|
+
) -> Credit:
|
|
983
|
+
"""
|
|
984
|
+
Add credit to an organization using a coupon.
|
|
985
|
+
|
|
986
|
+
Parameters
|
|
987
|
+
----------
|
|
988
|
+
organization_id : str
|
|
989
|
+
Organization ID
|
|
990
|
+
coupon_id : str
|
|
991
|
+
ID of the coupon
|
|
992
|
+
|
|
993
|
+
Returns
|
|
994
|
+
-------
|
|
995
|
+
Credit
|
|
996
|
+
API response as a typed Pydantic model
|
|
997
|
+
|
|
998
|
+
Raises
|
|
999
|
+
------
|
|
1000
|
+
AppwriteException
|
|
1001
|
+
If API request fails
|
|
1002
|
+
"""
|
|
1003
|
+
|
|
1004
|
+
api_path = '/organizations/{organizationId}/credits'
|
|
1005
|
+
api_params = {}
|
|
1006
|
+
if organization_id is None:
|
|
1007
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1008
|
+
|
|
1009
|
+
if coupon_id is None:
|
|
1010
|
+
raise AppwriteException('Missing required parameter: "coupon_id"')
|
|
1011
|
+
|
|
1012
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1013
|
+
|
|
1014
|
+
api_params['couponId'] = self._normalize_value(coupon_id)
|
|
1015
|
+
|
|
1016
|
+
response = self.client.call('post', api_path, {
|
|
1017
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1018
|
+
'content-type': 'application/json',
|
|
1019
|
+
'accept': 'application/json',
|
|
1020
|
+
}, api_params)
|
|
1021
|
+
|
|
1022
|
+
return self._parse_response(response, model=Credit)
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
def get_available_credits(
|
|
1026
|
+
self,
|
|
1027
|
+
organization_id: str
|
|
1028
|
+
) -> CreditAvailable:
|
|
1029
|
+
"""
|
|
1030
|
+
Get total available valid credits for an organization.
|
|
1031
|
+
|
|
1032
|
+
Parameters
|
|
1033
|
+
----------
|
|
1034
|
+
organization_id : str
|
|
1035
|
+
Organization ID
|
|
1036
|
+
|
|
1037
|
+
Returns
|
|
1038
|
+
-------
|
|
1039
|
+
CreditAvailable
|
|
1040
|
+
API response as a typed Pydantic model
|
|
1041
|
+
|
|
1042
|
+
Raises
|
|
1043
|
+
------
|
|
1044
|
+
AppwriteException
|
|
1045
|
+
If API request fails
|
|
1046
|
+
"""
|
|
1047
|
+
|
|
1048
|
+
api_path = '/organizations/{organizationId}/credits/available'
|
|
1049
|
+
api_params = {}
|
|
1050
|
+
if organization_id is None:
|
|
1051
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1052
|
+
|
|
1053
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
response = self.client.call('get', api_path, {
|
|
1057
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1058
|
+
'accept': 'application/json',
|
|
1059
|
+
}, api_params)
|
|
1060
|
+
|
|
1061
|
+
return self._parse_response(response, model=CreditAvailable)
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
def get_credit(
|
|
1065
|
+
self,
|
|
1066
|
+
organization_id: str,
|
|
1067
|
+
credit_id: str
|
|
1068
|
+
) -> Credit:
|
|
1069
|
+
"""
|
|
1070
|
+
Get credit details.
|
|
1071
|
+
|
|
1072
|
+
Parameters
|
|
1073
|
+
----------
|
|
1074
|
+
organization_id : str
|
|
1075
|
+
Organization ID
|
|
1076
|
+
credit_id : str
|
|
1077
|
+
Credit Unique ID
|
|
1078
|
+
|
|
1079
|
+
Returns
|
|
1080
|
+
-------
|
|
1081
|
+
Credit
|
|
1082
|
+
API response as a typed Pydantic model
|
|
1083
|
+
|
|
1084
|
+
Raises
|
|
1085
|
+
------
|
|
1086
|
+
AppwriteException
|
|
1087
|
+
If API request fails
|
|
1088
|
+
"""
|
|
1089
|
+
|
|
1090
|
+
api_path = '/organizations/{organizationId}/credits/{creditId}'
|
|
1091
|
+
api_params = {}
|
|
1092
|
+
if organization_id is None:
|
|
1093
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1094
|
+
|
|
1095
|
+
if credit_id is None:
|
|
1096
|
+
raise AppwriteException('Missing required parameter: "credit_id"')
|
|
1097
|
+
|
|
1098
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1099
|
+
api_path = api_path.replace('{creditId}', str(self._normalize_value(credit_id)))
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
response = self.client.call('get', api_path, {
|
|
1103
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1104
|
+
'accept': 'application/json',
|
|
1105
|
+
}, api_params)
|
|
1106
|
+
|
|
1107
|
+
return self._parse_response(response, model=Credit)
|
|
1108
|
+
|
|
1109
|
+
|
|
1110
|
+
def estimation_delete_organization(
|
|
1111
|
+
self,
|
|
1112
|
+
organization_id: str
|
|
1113
|
+
) -> EstimationDeleteOrganization:
|
|
1114
|
+
"""
|
|
1115
|
+
Get estimation for deleting an organization.
|
|
1116
|
+
|
|
1117
|
+
Parameters
|
|
1118
|
+
----------
|
|
1119
|
+
organization_id : str
|
|
1120
|
+
Team ID.
|
|
1121
|
+
|
|
1122
|
+
Returns
|
|
1123
|
+
-------
|
|
1124
|
+
EstimationDeleteOrganization
|
|
1125
|
+
API response as a typed Pydantic model
|
|
1126
|
+
|
|
1127
|
+
Raises
|
|
1128
|
+
------
|
|
1129
|
+
AppwriteException
|
|
1130
|
+
If API request fails
|
|
1131
|
+
"""
|
|
1132
|
+
|
|
1133
|
+
api_path = '/organizations/{organizationId}/estimations/delete-organization'
|
|
1134
|
+
api_params = {}
|
|
1135
|
+
if organization_id is None:
|
|
1136
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1137
|
+
|
|
1138
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
response = self.client.call('patch', api_path, {
|
|
1142
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1143
|
+
'content-type': 'application/json',
|
|
1144
|
+
'accept': 'application/json',
|
|
1145
|
+
}, api_params)
|
|
1146
|
+
|
|
1147
|
+
return self._parse_response(response, model=EstimationDeleteOrganization)
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
def estimation_update_plan(
|
|
1151
|
+
self,
|
|
1152
|
+
organization_id: str,
|
|
1153
|
+
billing_plan: str,
|
|
1154
|
+
invites: Optional[List[str]] = None,
|
|
1155
|
+
coupon_id: Optional[str] = None
|
|
1156
|
+
) -> EstimationUpdatePlan:
|
|
1157
|
+
"""
|
|
1158
|
+
Get estimation for updating the organization plan.
|
|
1159
|
+
|
|
1160
|
+
Parameters
|
|
1161
|
+
----------
|
|
1162
|
+
organization_id : str
|
|
1163
|
+
Organization ID
|
|
1164
|
+
billing_plan : str
|
|
1165
|
+
Organization billing plan chosen
|
|
1166
|
+
invites : Optional[List[str]]
|
|
1167
|
+
Additional member invites
|
|
1168
|
+
coupon_id : Optional[str]
|
|
1169
|
+
Coupon id
|
|
1170
|
+
|
|
1171
|
+
Returns
|
|
1172
|
+
-------
|
|
1173
|
+
EstimationUpdatePlan
|
|
1174
|
+
API response as a typed Pydantic model
|
|
1175
|
+
|
|
1176
|
+
Raises
|
|
1177
|
+
------
|
|
1178
|
+
AppwriteException
|
|
1179
|
+
If API request fails
|
|
1180
|
+
"""
|
|
1181
|
+
|
|
1182
|
+
api_path = '/organizations/{organizationId}/estimations/update-plan'
|
|
1183
|
+
api_params = {}
|
|
1184
|
+
if organization_id is None:
|
|
1185
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1186
|
+
|
|
1187
|
+
if billing_plan is None:
|
|
1188
|
+
raise AppwriteException('Missing required parameter: "billing_plan"')
|
|
1189
|
+
|
|
1190
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1191
|
+
|
|
1192
|
+
api_params['billingPlan'] = self._normalize_value(billing_plan)
|
|
1193
|
+
if invites is not None:
|
|
1194
|
+
api_params['invites'] = self._normalize_value(invites)
|
|
1195
|
+
if coupon_id is not None:
|
|
1196
|
+
api_params['couponId'] = self._normalize_value(coupon_id)
|
|
1197
|
+
|
|
1198
|
+
response = self.client.call('patch', api_path, {
|
|
1199
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1200
|
+
'content-type': 'application/json',
|
|
1201
|
+
'accept': 'application/json',
|
|
1202
|
+
}, api_params)
|
|
1203
|
+
|
|
1204
|
+
return self._parse_response(response, model=EstimationUpdatePlan)
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
def create_downgrade_feedback(
|
|
1208
|
+
self,
|
|
1209
|
+
organization_id: str,
|
|
1210
|
+
reason: str,
|
|
1211
|
+
message: str,
|
|
1212
|
+
from_plan_id: str,
|
|
1213
|
+
to_plan_id: str
|
|
1214
|
+
) -> DowngradeFeedback:
|
|
1215
|
+
"""
|
|
1216
|
+
Submit feedback about downgrading from a paid plan to a lower tier. This helps the team understand user experience and improve the platform.
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
Parameters
|
|
1220
|
+
----------
|
|
1221
|
+
organization_id : str
|
|
1222
|
+
Organization Unique ID
|
|
1223
|
+
reason : str
|
|
1224
|
+
Feedback reason
|
|
1225
|
+
message : str
|
|
1226
|
+
Feedback message
|
|
1227
|
+
from_plan_id : str
|
|
1228
|
+
Plan downgrading from
|
|
1229
|
+
to_plan_id : str
|
|
1230
|
+
Plan downgrading to
|
|
1231
|
+
|
|
1232
|
+
Returns
|
|
1233
|
+
-------
|
|
1234
|
+
DowngradeFeedback
|
|
1235
|
+
API response as a typed Pydantic model
|
|
1236
|
+
|
|
1237
|
+
Raises
|
|
1238
|
+
------
|
|
1239
|
+
AppwriteException
|
|
1240
|
+
If API request fails
|
|
1241
|
+
"""
|
|
1242
|
+
|
|
1243
|
+
api_path = '/organizations/{organizationId}/feedbacks/downgrade'
|
|
1244
|
+
api_params = {}
|
|
1245
|
+
if organization_id is None:
|
|
1246
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1247
|
+
|
|
1248
|
+
if reason is None:
|
|
1249
|
+
raise AppwriteException('Missing required parameter: "reason"')
|
|
1250
|
+
|
|
1251
|
+
if message is None:
|
|
1252
|
+
raise AppwriteException('Missing required parameter: "message"')
|
|
1253
|
+
|
|
1254
|
+
if from_plan_id is None:
|
|
1255
|
+
raise AppwriteException('Missing required parameter: "from_plan_id"')
|
|
1256
|
+
|
|
1257
|
+
if to_plan_id is None:
|
|
1258
|
+
raise AppwriteException('Missing required parameter: "to_plan_id"')
|
|
1259
|
+
|
|
1260
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1261
|
+
|
|
1262
|
+
api_params['reason'] = self._normalize_value(reason)
|
|
1263
|
+
api_params['message'] = self._normalize_value(message)
|
|
1264
|
+
api_params['fromPlanId'] = self._normalize_value(from_plan_id)
|
|
1265
|
+
api_params['toPlanId'] = self._normalize_value(to_plan_id)
|
|
1266
|
+
|
|
1267
|
+
response = self.client.call('post', api_path, {
|
|
1268
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1269
|
+
'content-type': 'application/json',
|
|
1270
|
+
'accept': 'application/json',
|
|
1271
|
+
}, api_params)
|
|
1272
|
+
|
|
1273
|
+
return self._parse_response(response, model=DowngradeFeedback)
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
def list_invoices(
|
|
1277
|
+
self,
|
|
1278
|
+
organization_id: str,
|
|
1279
|
+
queries: Optional[List[str]] = None
|
|
1280
|
+
) -> InvoiceList:
|
|
1281
|
+
"""
|
|
1282
|
+
List all invoices for an organization.
|
|
1283
|
+
|
|
1284
|
+
Parameters
|
|
1285
|
+
----------
|
|
1286
|
+
organization_id : str
|
|
1287
|
+
Organization ID
|
|
1288
|
+
queries : Optional[List[str]]
|
|
1289
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount
|
|
1290
|
+
|
|
1291
|
+
Returns
|
|
1292
|
+
-------
|
|
1293
|
+
InvoiceList
|
|
1294
|
+
API response as a typed Pydantic model
|
|
1295
|
+
|
|
1296
|
+
Raises
|
|
1297
|
+
------
|
|
1298
|
+
AppwriteException
|
|
1299
|
+
If API request fails
|
|
1300
|
+
"""
|
|
1301
|
+
|
|
1302
|
+
api_path = '/organizations/{organizationId}/invoices'
|
|
1303
|
+
api_params = {}
|
|
1304
|
+
if organization_id is None:
|
|
1305
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1306
|
+
|
|
1307
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1308
|
+
|
|
1309
|
+
if queries is not None:
|
|
1310
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
1311
|
+
|
|
1312
|
+
response = self.client.call('get', api_path, {
|
|
1313
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1314
|
+
'accept': 'application/json',
|
|
1315
|
+
}, api_params)
|
|
1316
|
+
|
|
1317
|
+
return self._parse_response(response, model=InvoiceList)
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
def get_invoice(
|
|
1321
|
+
self,
|
|
1322
|
+
organization_id: str,
|
|
1323
|
+
invoice_id: str
|
|
1324
|
+
) -> Invoice:
|
|
1325
|
+
"""
|
|
1326
|
+
Get an invoice by its unique ID.
|
|
1327
|
+
|
|
1328
|
+
Parameters
|
|
1329
|
+
----------
|
|
1330
|
+
organization_id : str
|
|
1331
|
+
Organization ID
|
|
1332
|
+
invoice_id : str
|
|
1333
|
+
Invoice unique ID
|
|
1334
|
+
|
|
1335
|
+
Returns
|
|
1336
|
+
-------
|
|
1337
|
+
Invoice
|
|
1338
|
+
API response as a typed Pydantic model
|
|
1339
|
+
|
|
1340
|
+
Raises
|
|
1341
|
+
------
|
|
1342
|
+
AppwriteException
|
|
1343
|
+
If API request fails
|
|
1344
|
+
"""
|
|
1345
|
+
|
|
1346
|
+
api_path = '/organizations/{organizationId}/invoices/{invoiceId}'
|
|
1347
|
+
api_params = {}
|
|
1348
|
+
if organization_id is None:
|
|
1349
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1350
|
+
|
|
1351
|
+
if invoice_id is None:
|
|
1352
|
+
raise AppwriteException('Missing required parameter: "invoice_id"')
|
|
1353
|
+
|
|
1354
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1355
|
+
api_path = api_path.replace('{invoiceId}', str(self._normalize_value(invoice_id)))
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
response = self.client.call('get', api_path, {
|
|
1359
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1360
|
+
'accept': 'application/json',
|
|
1361
|
+
}, api_params)
|
|
1362
|
+
|
|
1363
|
+
return self._parse_response(response, model=Invoice)
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
def get_invoice_download(
|
|
1367
|
+
self,
|
|
1368
|
+
organization_id: str,
|
|
1369
|
+
invoice_id: str
|
|
1370
|
+
) -> bytes:
|
|
1371
|
+
"""
|
|
1372
|
+
Download invoice in PDF
|
|
1373
|
+
|
|
1374
|
+
Parameters
|
|
1375
|
+
----------
|
|
1376
|
+
organization_id : str
|
|
1377
|
+
Organization ID
|
|
1378
|
+
invoice_id : str
|
|
1379
|
+
Invoice unique ID
|
|
1380
|
+
|
|
1381
|
+
Returns
|
|
1382
|
+
-------
|
|
1383
|
+
bytes
|
|
1384
|
+
Response as bytes
|
|
1385
|
+
|
|
1386
|
+
Raises
|
|
1387
|
+
------
|
|
1388
|
+
AppwriteException
|
|
1389
|
+
If API request fails
|
|
1390
|
+
"""
|
|
1391
|
+
|
|
1392
|
+
api_path = '/organizations/{organizationId}/invoices/{invoiceId}/download'
|
|
1393
|
+
api_params = {}
|
|
1394
|
+
if organization_id is None:
|
|
1395
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1396
|
+
|
|
1397
|
+
if invoice_id is None:
|
|
1398
|
+
raise AppwriteException('Missing required parameter: "invoice_id"')
|
|
1399
|
+
|
|
1400
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1401
|
+
api_path = api_path.replace('{invoiceId}', str(self._normalize_value(invoice_id)))
|
|
1402
|
+
|
|
1403
|
+
|
|
1404
|
+
response = self.client.call('get', api_path, {
|
|
1405
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1406
|
+
'accept': 'application/json',
|
|
1407
|
+
}, api_params)
|
|
1408
|
+
|
|
1409
|
+
return response
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
def create_invoice_payment(
|
|
1413
|
+
self,
|
|
1414
|
+
organization_id: str,
|
|
1415
|
+
invoice_id: str,
|
|
1416
|
+
payment_method_id: str
|
|
1417
|
+
) -> Invoice:
|
|
1418
|
+
"""
|
|
1419
|
+
Initiate payment for failed invoice to pay live from console
|
|
1420
|
+
|
|
1421
|
+
Parameters
|
|
1422
|
+
----------
|
|
1423
|
+
organization_id : str
|
|
1424
|
+
Organization ID
|
|
1425
|
+
invoice_id : str
|
|
1426
|
+
Invoice unique ID
|
|
1427
|
+
payment_method_id : str
|
|
1428
|
+
Payment method ID
|
|
1429
|
+
|
|
1430
|
+
Returns
|
|
1431
|
+
-------
|
|
1432
|
+
Invoice
|
|
1433
|
+
API response as a typed Pydantic model
|
|
1434
|
+
|
|
1435
|
+
Raises
|
|
1436
|
+
------
|
|
1437
|
+
AppwriteException
|
|
1438
|
+
If API request fails
|
|
1439
|
+
"""
|
|
1440
|
+
|
|
1441
|
+
api_path = '/organizations/{organizationId}/invoices/{invoiceId}/payments'
|
|
1442
|
+
api_params = {}
|
|
1443
|
+
if organization_id is None:
|
|
1444
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1445
|
+
|
|
1446
|
+
if invoice_id is None:
|
|
1447
|
+
raise AppwriteException('Missing required parameter: "invoice_id"')
|
|
1448
|
+
|
|
1449
|
+
if payment_method_id is None:
|
|
1450
|
+
raise AppwriteException('Missing required parameter: "payment_method_id"')
|
|
1451
|
+
|
|
1452
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1453
|
+
api_path = api_path.replace('{invoiceId}', str(self._normalize_value(invoice_id)))
|
|
1454
|
+
|
|
1455
|
+
api_params['paymentMethodId'] = self._normalize_value(payment_method_id)
|
|
1456
|
+
|
|
1457
|
+
response = self.client.call('post', api_path, {
|
|
1458
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1459
|
+
'content-type': 'application/json',
|
|
1460
|
+
'accept': 'application/json',
|
|
1461
|
+
}, api_params)
|
|
1462
|
+
|
|
1463
|
+
return self._parse_response(response, model=Invoice)
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
def validate_invoice(
|
|
1467
|
+
self,
|
|
1468
|
+
organization_id: str,
|
|
1469
|
+
invoice_id: str
|
|
1470
|
+
) -> Invoice:
|
|
1471
|
+
"""
|
|
1472
|
+
Validates the payment linked with the invoice and updates the invoice status if the payment status is changed.
|
|
1473
|
+
|
|
1474
|
+
Parameters
|
|
1475
|
+
----------
|
|
1476
|
+
organization_id : str
|
|
1477
|
+
Organization ID
|
|
1478
|
+
invoice_id : str
|
|
1479
|
+
Invoice unique ID
|
|
1480
|
+
|
|
1481
|
+
Returns
|
|
1482
|
+
-------
|
|
1483
|
+
Invoice
|
|
1484
|
+
API response as a typed Pydantic model
|
|
1485
|
+
|
|
1486
|
+
Raises
|
|
1487
|
+
------
|
|
1488
|
+
AppwriteException
|
|
1489
|
+
If API request fails
|
|
1490
|
+
"""
|
|
1491
|
+
|
|
1492
|
+
api_path = '/organizations/{organizationId}/invoices/{invoiceId}/status'
|
|
1493
|
+
api_params = {}
|
|
1494
|
+
if organization_id is None:
|
|
1495
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1496
|
+
|
|
1497
|
+
if invoice_id is None:
|
|
1498
|
+
raise AppwriteException('Missing required parameter: "invoice_id"')
|
|
1499
|
+
|
|
1500
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1501
|
+
api_path = api_path.replace('{invoiceId}', str(self._normalize_value(invoice_id)))
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
response = self.client.call('patch', api_path, {
|
|
1505
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1506
|
+
'content-type': 'application/json',
|
|
1507
|
+
'accept': 'application/json',
|
|
1508
|
+
}, api_params)
|
|
1509
|
+
|
|
1510
|
+
return self._parse_response(response, model=Invoice)
|
|
1511
|
+
|
|
1512
|
+
|
|
1513
|
+
def get_invoice_view(
|
|
1514
|
+
self,
|
|
1515
|
+
organization_id: str,
|
|
1516
|
+
invoice_id: str
|
|
1517
|
+
) -> bytes:
|
|
1518
|
+
"""
|
|
1519
|
+
View invoice in PDF
|
|
1520
|
+
|
|
1521
|
+
Parameters
|
|
1522
|
+
----------
|
|
1523
|
+
organization_id : str
|
|
1524
|
+
Organization ID
|
|
1525
|
+
invoice_id : str
|
|
1526
|
+
Invoice unique ID
|
|
1527
|
+
|
|
1528
|
+
Returns
|
|
1529
|
+
-------
|
|
1530
|
+
bytes
|
|
1531
|
+
Response as bytes
|
|
1532
|
+
|
|
1533
|
+
Raises
|
|
1534
|
+
------
|
|
1535
|
+
AppwriteException
|
|
1536
|
+
If API request fails
|
|
1537
|
+
"""
|
|
1538
|
+
|
|
1539
|
+
api_path = '/organizations/{organizationId}/invoices/{invoiceId}/view'
|
|
1540
|
+
api_params = {}
|
|
1541
|
+
if organization_id is None:
|
|
1542
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1543
|
+
|
|
1544
|
+
if invoice_id is None:
|
|
1545
|
+
raise AppwriteException('Missing required parameter: "invoice_id"')
|
|
1546
|
+
|
|
1547
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1548
|
+
api_path = api_path.replace('{invoiceId}', str(self._normalize_value(invoice_id)))
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
response = self.client.call('get', api_path, {
|
|
1552
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1553
|
+
'accept': 'application/json',
|
|
1554
|
+
}, api_params)
|
|
1555
|
+
|
|
1556
|
+
return response
|
|
1557
|
+
|
|
1558
|
+
|
|
1559
|
+
def set_default_payment_method(
|
|
1560
|
+
self,
|
|
1561
|
+
organization_id: str,
|
|
1562
|
+
payment_method_id: str,
|
|
1563
|
+
model_type: Type[T] = dict
|
|
1564
|
+
) -> Organization[T]:
|
|
1565
|
+
"""
|
|
1566
|
+
Set a organization's default payment method.
|
|
1567
|
+
|
|
1568
|
+
Parameters
|
|
1569
|
+
----------
|
|
1570
|
+
organization_id : str
|
|
1571
|
+
Organization ID
|
|
1572
|
+
payment_method_id : str
|
|
1573
|
+
Unique ID of payment method
|
|
1574
|
+
|
|
1575
|
+
model_type : Type[T], optional
|
|
1576
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
1577
|
+
|
|
1578
|
+
Returns
|
|
1579
|
+
-------
|
|
1580
|
+
Organization[T]
|
|
1581
|
+
API response as a typed Pydantic model
|
|
1582
|
+
|
|
1583
|
+
Raises
|
|
1584
|
+
------
|
|
1585
|
+
AppwriteException
|
|
1586
|
+
If API request fails
|
|
1587
|
+
"""
|
|
1588
|
+
|
|
1589
|
+
api_path = '/organizations/{organizationId}/payment-method'
|
|
1590
|
+
api_params = {}
|
|
1591
|
+
if organization_id is None:
|
|
1592
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1593
|
+
|
|
1594
|
+
if payment_method_id is None:
|
|
1595
|
+
raise AppwriteException('Missing required parameter: "payment_method_id"')
|
|
1596
|
+
|
|
1597
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1598
|
+
|
|
1599
|
+
api_params['paymentMethodId'] = self._normalize_value(payment_method_id)
|
|
1600
|
+
|
|
1601
|
+
response = self.client.call('patch', api_path, {
|
|
1602
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1603
|
+
'content-type': 'application/json',
|
|
1604
|
+
'accept': 'application/json',
|
|
1605
|
+
}, api_params)
|
|
1606
|
+
|
|
1607
|
+
return Organization.with_data(response, model_type)
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
def delete_default_payment_method(
|
|
1611
|
+
self,
|
|
1612
|
+
organization_id: str,
|
|
1613
|
+
model_type: Type[T] = dict
|
|
1614
|
+
) -> Organization[T]:
|
|
1615
|
+
"""
|
|
1616
|
+
Delete the default payment method for an organization.
|
|
1617
|
+
|
|
1618
|
+
Parameters
|
|
1619
|
+
----------
|
|
1620
|
+
organization_id : str
|
|
1621
|
+
Organization ID
|
|
1622
|
+
|
|
1623
|
+
model_type : Type[T], optional
|
|
1624
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
1625
|
+
|
|
1626
|
+
Returns
|
|
1627
|
+
-------
|
|
1628
|
+
Organization[T]
|
|
1629
|
+
API response as a typed Pydantic model
|
|
1630
|
+
|
|
1631
|
+
Raises
|
|
1632
|
+
------
|
|
1633
|
+
AppwriteException
|
|
1634
|
+
If API request fails
|
|
1635
|
+
"""
|
|
1636
|
+
|
|
1637
|
+
api_path = '/organizations/{organizationId}/payment-method'
|
|
1638
|
+
api_params = {}
|
|
1639
|
+
if organization_id is None:
|
|
1640
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1641
|
+
|
|
1642
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
response = self.client.call('delete', api_path, {
|
|
1646
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1647
|
+
'content-type': 'application/json',
|
|
1648
|
+
'accept': 'application/json',
|
|
1649
|
+
}, api_params)
|
|
1650
|
+
|
|
1651
|
+
return Organization.with_data(response, model_type)
|
|
1652
|
+
|
|
1653
|
+
|
|
1654
|
+
def set_backup_payment_method(
|
|
1655
|
+
self,
|
|
1656
|
+
organization_id: str,
|
|
1657
|
+
payment_method_id: str,
|
|
1658
|
+
model_type: Type[T] = dict
|
|
1659
|
+
) -> Organization[T]:
|
|
1660
|
+
"""
|
|
1661
|
+
Set an organization's backup payment method.
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
Parameters
|
|
1665
|
+
----------
|
|
1666
|
+
organization_id : str
|
|
1667
|
+
Organization ID
|
|
1668
|
+
payment_method_id : str
|
|
1669
|
+
Unique ID of payment method
|
|
1670
|
+
|
|
1671
|
+
model_type : Type[T], optional
|
|
1672
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
1673
|
+
|
|
1674
|
+
Returns
|
|
1675
|
+
-------
|
|
1676
|
+
Organization[T]
|
|
1677
|
+
API response as a typed Pydantic model
|
|
1678
|
+
|
|
1679
|
+
Raises
|
|
1680
|
+
------
|
|
1681
|
+
AppwriteException
|
|
1682
|
+
If API request fails
|
|
1683
|
+
"""
|
|
1684
|
+
|
|
1685
|
+
api_path = '/organizations/{organizationId}/payment-method/backup'
|
|
1686
|
+
api_params = {}
|
|
1687
|
+
if organization_id is None:
|
|
1688
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1689
|
+
|
|
1690
|
+
if payment_method_id is None:
|
|
1691
|
+
raise AppwriteException('Missing required parameter: "payment_method_id"')
|
|
1692
|
+
|
|
1693
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1694
|
+
|
|
1695
|
+
api_params['paymentMethodId'] = self._normalize_value(payment_method_id)
|
|
1696
|
+
|
|
1697
|
+
response = self.client.call('patch', api_path, {
|
|
1698
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1699
|
+
'content-type': 'application/json',
|
|
1700
|
+
'accept': 'application/json',
|
|
1701
|
+
}, api_params)
|
|
1702
|
+
|
|
1703
|
+
return Organization.with_data(response, model_type)
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
def delete_backup_payment_method(
|
|
1707
|
+
self,
|
|
1708
|
+
organization_id: str,
|
|
1709
|
+
model_type: Type[T] = dict
|
|
1710
|
+
) -> Organization[T]:
|
|
1711
|
+
"""
|
|
1712
|
+
Delete a backup payment method for an organization.
|
|
1713
|
+
|
|
1714
|
+
Parameters
|
|
1715
|
+
----------
|
|
1716
|
+
organization_id : str
|
|
1717
|
+
Organization ID
|
|
1718
|
+
|
|
1719
|
+
model_type : Type[T], optional
|
|
1720
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
1721
|
+
|
|
1722
|
+
Returns
|
|
1723
|
+
-------
|
|
1724
|
+
Organization[T]
|
|
1725
|
+
API response as a typed Pydantic model
|
|
1726
|
+
|
|
1727
|
+
Raises
|
|
1728
|
+
------
|
|
1729
|
+
AppwriteException
|
|
1730
|
+
If API request fails
|
|
1731
|
+
"""
|
|
1732
|
+
|
|
1733
|
+
api_path = '/organizations/{organizationId}/payment-method/backup'
|
|
1734
|
+
api_params = {}
|
|
1735
|
+
if organization_id is None:
|
|
1736
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1737
|
+
|
|
1738
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
response = self.client.call('delete', api_path, {
|
|
1742
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1743
|
+
'content-type': 'application/json',
|
|
1744
|
+
'accept': 'application/json',
|
|
1745
|
+
}, api_params)
|
|
1746
|
+
|
|
1747
|
+
return Organization.with_data(response, model_type)
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
def get_payment_method(
|
|
1751
|
+
self,
|
|
1752
|
+
organization_id: str,
|
|
1753
|
+
payment_method_id: str
|
|
1754
|
+
) -> PaymentMethod:
|
|
1755
|
+
"""
|
|
1756
|
+
Get an organization's payment method using it's payment method ID.
|
|
1757
|
+
|
|
1758
|
+
Parameters
|
|
1759
|
+
----------
|
|
1760
|
+
organization_id : str
|
|
1761
|
+
Organization ID
|
|
1762
|
+
payment_method_id : str
|
|
1763
|
+
Unique ID of payment method
|
|
1764
|
+
|
|
1765
|
+
Returns
|
|
1766
|
+
-------
|
|
1767
|
+
PaymentMethod
|
|
1768
|
+
API response as a typed Pydantic model
|
|
1769
|
+
|
|
1770
|
+
Raises
|
|
1771
|
+
------
|
|
1772
|
+
AppwriteException
|
|
1773
|
+
If API request fails
|
|
1774
|
+
"""
|
|
1775
|
+
|
|
1776
|
+
api_path = '/organizations/{organizationId}/payment-methods/{paymentMethodId}'
|
|
1777
|
+
api_params = {}
|
|
1778
|
+
if organization_id is None:
|
|
1779
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1780
|
+
|
|
1781
|
+
if payment_method_id is None:
|
|
1782
|
+
raise AppwriteException('Missing required parameter: "payment_method_id"')
|
|
1783
|
+
|
|
1784
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1785
|
+
api_path = api_path.replace('{paymentMethodId}', str(self._normalize_value(payment_method_id)))
|
|
1786
|
+
|
|
1787
|
+
|
|
1788
|
+
response = self.client.call('get', api_path, {
|
|
1789
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1790
|
+
'accept': 'application/json',
|
|
1791
|
+
}, api_params)
|
|
1792
|
+
|
|
1793
|
+
return self._parse_response(response, model=PaymentMethod)
|
|
1794
|
+
|
|
1795
|
+
|
|
1796
|
+
def get_plan(
|
|
1797
|
+
self,
|
|
1798
|
+
organization_id: str
|
|
1799
|
+
) -> BillingPlan:
|
|
1800
|
+
"""
|
|
1801
|
+
Get the details of the current billing plan for an organization.
|
|
1802
|
+
|
|
1803
|
+
Parameters
|
|
1804
|
+
----------
|
|
1805
|
+
organization_id : str
|
|
1806
|
+
Organization Unique ID
|
|
1807
|
+
|
|
1808
|
+
Returns
|
|
1809
|
+
-------
|
|
1810
|
+
BillingPlan
|
|
1811
|
+
API response as a typed Pydantic model
|
|
1812
|
+
|
|
1813
|
+
Raises
|
|
1814
|
+
------
|
|
1815
|
+
AppwriteException
|
|
1816
|
+
If API request fails
|
|
1817
|
+
"""
|
|
1818
|
+
|
|
1819
|
+
api_path = '/organizations/{organizationId}/plan'
|
|
1820
|
+
api_params = {}
|
|
1821
|
+
if organization_id is None:
|
|
1822
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1823
|
+
|
|
1824
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
response = self.client.call('get', api_path, {
|
|
1828
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1829
|
+
'accept': 'application/json',
|
|
1830
|
+
}, api_params)
|
|
1831
|
+
|
|
1832
|
+
return self._parse_response(response, model=BillingPlan)
|
|
1833
|
+
|
|
1834
|
+
|
|
1835
|
+
def update_plan(
|
|
1836
|
+
self,
|
|
1837
|
+
organization_id: str,
|
|
1838
|
+
billing_plan: str,
|
|
1839
|
+
payment_method_id: Optional[str] = None,
|
|
1840
|
+
billing_address_id: Optional[str] = None,
|
|
1841
|
+
invites: Optional[List[str]] = None,
|
|
1842
|
+
coupon_id: Optional[str] = None,
|
|
1843
|
+
tax_id: Optional[str] = None,
|
|
1844
|
+
budget: Optional[float] = None,
|
|
1845
|
+
model_type: Type[T] = dict
|
|
1846
|
+
) -> Organization[T]:
|
|
1847
|
+
"""
|
|
1848
|
+
Update the billing plan for an organization.
|
|
1849
|
+
|
|
1850
|
+
Parameters
|
|
1851
|
+
----------
|
|
1852
|
+
organization_id : str
|
|
1853
|
+
Organization Unique ID
|
|
1854
|
+
billing_plan : str
|
|
1855
|
+
Organization billing plan chosen
|
|
1856
|
+
payment_method_id : Optional[str]
|
|
1857
|
+
Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
1858
|
+
billing_address_id : Optional[str]
|
|
1859
|
+
Unique ID of billing address
|
|
1860
|
+
invites : Optional[List[str]]
|
|
1861
|
+
Additional member invites
|
|
1862
|
+
coupon_id : Optional[str]
|
|
1863
|
+
Coupon id
|
|
1864
|
+
tax_id : Optional[str]
|
|
1865
|
+
Tax Id associated to billing.
|
|
1866
|
+
budget : Optional[float]
|
|
1867
|
+
Budget limit for additional usage set for the organization
|
|
1868
|
+
|
|
1869
|
+
model_type : Type[T], optional
|
|
1870
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
1871
|
+
|
|
1872
|
+
Returns
|
|
1873
|
+
-------
|
|
1874
|
+
Organization[T]
|
|
1875
|
+
API response as a typed Pydantic model
|
|
1876
|
+
|
|
1877
|
+
Raises
|
|
1878
|
+
------
|
|
1879
|
+
AppwriteException
|
|
1880
|
+
If API request fails
|
|
1881
|
+
"""
|
|
1882
|
+
|
|
1883
|
+
api_path = '/organizations/{organizationId}/plan'
|
|
1884
|
+
api_params = {}
|
|
1885
|
+
if organization_id is None:
|
|
1886
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1887
|
+
|
|
1888
|
+
if billing_plan is None:
|
|
1889
|
+
raise AppwriteException('Missing required parameter: "billing_plan"')
|
|
1890
|
+
|
|
1891
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1892
|
+
|
|
1893
|
+
api_params['billingPlan'] = self._normalize_value(billing_plan)
|
|
1894
|
+
if payment_method_id is not None:
|
|
1895
|
+
api_params['paymentMethodId'] = self._normalize_value(payment_method_id)
|
|
1896
|
+
if billing_address_id is not None:
|
|
1897
|
+
api_params['billingAddressId'] = self._normalize_value(billing_address_id)
|
|
1898
|
+
if invites is not None:
|
|
1899
|
+
api_params['invites'] = self._normalize_value(invites)
|
|
1900
|
+
if coupon_id is not None:
|
|
1901
|
+
api_params['couponId'] = self._normalize_value(coupon_id)
|
|
1902
|
+
if tax_id is not None:
|
|
1903
|
+
api_params['taxId'] = self._normalize_value(tax_id)
|
|
1904
|
+
if budget is not None:
|
|
1905
|
+
api_params['budget'] = self._normalize_value(budget)
|
|
1906
|
+
|
|
1907
|
+
response = self.client.call('patch', api_path, {
|
|
1908
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1909
|
+
'content-type': 'application/json',
|
|
1910
|
+
'accept': 'application/json',
|
|
1911
|
+
}, api_params)
|
|
1912
|
+
|
|
1913
|
+
return Organization.with_data(response, model_type)
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
def cancel_downgrade(
|
|
1917
|
+
self,
|
|
1918
|
+
organization_id: str,
|
|
1919
|
+
model_type: Type[T] = dict
|
|
1920
|
+
) -> Organization[T]:
|
|
1921
|
+
"""
|
|
1922
|
+
Cancel the downgrade initiated for an organization.
|
|
1923
|
+
|
|
1924
|
+
Parameters
|
|
1925
|
+
----------
|
|
1926
|
+
organization_id : str
|
|
1927
|
+
Organization Unique ID
|
|
1928
|
+
|
|
1929
|
+
model_type : Type[T], optional
|
|
1930
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
1931
|
+
|
|
1932
|
+
Returns
|
|
1933
|
+
-------
|
|
1934
|
+
Organization[T]
|
|
1935
|
+
API response as a typed Pydantic model
|
|
1936
|
+
|
|
1937
|
+
Raises
|
|
1938
|
+
------
|
|
1939
|
+
AppwriteException
|
|
1940
|
+
If API request fails
|
|
1941
|
+
"""
|
|
1942
|
+
|
|
1943
|
+
api_path = '/organizations/{organizationId}/plan/cancel'
|
|
1944
|
+
api_params = {}
|
|
1945
|
+
if organization_id is None:
|
|
1946
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1947
|
+
|
|
1948
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
1949
|
+
|
|
1950
|
+
|
|
1951
|
+
response = self.client.call('patch', api_path, {
|
|
1952
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1953
|
+
'content-type': 'application/json',
|
|
1954
|
+
'accept': 'application/json',
|
|
1955
|
+
}, api_params)
|
|
1956
|
+
|
|
1957
|
+
return Organization.with_data(response, model_type)
|
|
1958
|
+
|
|
1959
|
+
|
|
1960
|
+
def create_plan_estimation(
|
|
1961
|
+
self,
|
|
1962
|
+
organization_id: str,
|
|
1963
|
+
billing_plan: str,
|
|
1964
|
+
invites: Optional[List[str]] = None,
|
|
1965
|
+
coupon_id: Optional[str] = None
|
|
1966
|
+
) -> EstimationPlanChange:
|
|
1967
|
+
"""
|
|
1968
|
+
Create a billing plan estimation for upgrading or downgrading an organization plan.
|
|
1969
|
+
|
|
1970
|
+
|
|
1971
|
+
Parameters
|
|
1972
|
+
----------
|
|
1973
|
+
organization_id : str
|
|
1974
|
+
Organization ID
|
|
1975
|
+
billing_plan : str
|
|
1976
|
+
Target billing plan
|
|
1977
|
+
invites : Optional[List[str]]
|
|
1978
|
+
Additional member invites
|
|
1979
|
+
coupon_id : Optional[str]
|
|
1980
|
+
Coupon id
|
|
1981
|
+
|
|
1982
|
+
Returns
|
|
1983
|
+
-------
|
|
1984
|
+
EstimationPlanChange
|
|
1985
|
+
API response as a typed Pydantic model
|
|
1986
|
+
|
|
1987
|
+
Raises
|
|
1988
|
+
------
|
|
1989
|
+
AppwriteException
|
|
1990
|
+
If API request fails
|
|
1991
|
+
"""
|
|
1992
|
+
|
|
1993
|
+
api_path = '/organizations/{organizationId}/plan/estimations'
|
|
1994
|
+
api_params = {}
|
|
1995
|
+
if organization_id is None:
|
|
1996
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
1997
|
+
|
|
1998
|
+
if billing_plan is None:
|
|
1999
|
+
raise AppwriteException('Missing required parameter: "billing_plan"')
|
|
2000
|
+
|
|
2001
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
2002
|
+
|
|
2003
|
+
api_params['billingPlan'] = self._normalize_value(billing_plan)
|
|
2004
|
+
if invites is not None:
|
|
2005
|
+
api_params['invites'] = self._normalize_value(invites)
|
|
2006
|
+
if coupon_id is not None:
|
|
2007
|
+
api_params['couponId'] = self._normalize_value(coupon_id)
|
|
2008
|
+
|
|
2009
|
+
response = self.client.call('post', api_path, {
|
|
2010
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
2011
|
+
'content-type': 'application/json',
|
|
2012
|
+
'accept': 'application/json',
|
|
2013
|
+
}, api_params)
|
|
2014
|
+
|
|
2015
|
+
return self._parse_response(response, model=EstimationPlanChange)
|
|
2016
|
+
|
|
2017
|
+
|
|
2018
|
+
def list_regions(
|
|
2019
|
+
self,
|
|
2020
|
+
organization_id: str
|
|
2021
|
+
) -> ConsoleRegionList:
|
|
2022
|
+
"""
|
|
2023
|
+
Get all available regions for an organization.
|
|
2024
|
+
|
|
2025
|
+
Parameters
|
|
2026
|
+
----------
|
|
2027
|
+
organization_id : str
|
|
2028
|
+
Team ID.
|
|
2029
|
+
|
|
2030
|
+
Returns
|
|
2031
|
+
-------
|
|
2032
|
+
ConsoleRegionList
|
|
2033
|
+
API response as a typed Pydantic model
|
|
2034
|
+
|
|
2035
|
+
Raises
|
|
2036
|
+
------
|
|
2037
|
+
AppwriteException
|
|
2038
|
+
If API request fails
|
|
2039
|
+
"""
|
|
2040
|
+
|
|
2041
|
+
api_path = '/organizations/{organizationId}/regions'
|
|
2042
|
+
api_params = {}
|
|
2043
|
+
if organization_id is None:
|
|
2044
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
2045
|
+
|
|
2046
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
2047
|
+
|
|
2048
|
+
|
|
2049
|
+
response = self.client.call('get', api_path, {
|
|
2050
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
2051
|
+
'accept': 'application/json',
|
|
2052
|
+
}, api_params)
|
|
2053
|
+
|
|
2054
|
+
return self._parse_response(response, model=ConsoleRegionList)
|
|
2055
|
+
|
|
2056
|
+
|
|
2057
|
+
def get_scopes(
|
|
2058
|
+
self,
|
|
2059
|
+
organization_id: str,
|
|
2060
|
+
project_id: Optional[str] = None
|
|
2061
|
+
) -> Roles:
|
|
2062
|
+
"""
|
|
2063
|
+
Get Scopes
|
|
2064
|
+
|
|
2065
|
+
Parameters
|
|
2066
|
+
----------
|
|
2067
|
+
organization_id : str
|
|
2068
|
+
Organization id
|
|
2069
|
+
project_id : Optional[str]
|
|
2070
|
+
Project id
|
|
2071
|
+
|
|
2072
|
+
Returns
|
|
2073
|
+
-------
|
|
2074
|
+
Roles
|
|
2075
|
+
API response as a typed Pydantic model
|
|
2076
|
+
|
|
2077
|
+
Raises
|
|
2078
|
+
------
|
|
2079
|
+
AppwriteException
|
|
2080
|
+
If API request fails
|
|
2081
|
+
"""
|
|
2082
|
+
|
|
2083
|
+
api_path = '/organizations/{organizationId}/roles'
|
|
2084
|
+
api_params = {}
|
|
2085
|
+
if organization_id is None:
|
|
2086
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
2087
|
+
|
|
2088
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
2089
|
+
|
|
2090
|
+
if project_id is not None:
|
|
2091
|
+
api_params['projectId'] = self._normalize_value(project_id)
|
|
2092
|
+
|
|
2093
|
+
response = self.client.call('get', api_path, {
|
|
2094
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
2095
|
+
'accept': 'application/json',
|
|
2096
|
+
}, api_params)
|
|
2097
|
+
|
|
2098
|
+
return self._parse_response(response, model=Roles)
|
|
2099
|
+
|
|
2100
|
+
|
|
2101
|
+
def set_billing_tax_id(
|
|
2102
|
+
self,
|
|
2103
|
+
organization_id: str,
|
|
2104
|
+
tax_id: Optional[str],
|
|
2105
|
+
model_type: Type[T] = dict
|
|
2106
|
+
) -> Organization[T]:
|
|
2107
|
+
"""
|
|
2108
|
+
Set an organization's billing tax ID.
|
|
2109
|
+
|
|
2110
|
+
Parameters
|
|
2111
|
+
----------
|
|
2112
|
+
organization_id : str
|
|
2113
|
+
Organization ID
|
|
2114
|
+
tax_id : Optional[str]
|
|
2115
|
+
Tax Id associated to billing.
|
|
2116
|
+
|
|
2117
|
+
model_type : Type[T], optional
|
|
2118
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
2119
|
+
|
|
2120
|
+
Returns
|
|
2121
|
+
-------
|
|
2122
|
+
Organization[T]
|
|
2123
|
+
API response as a typed Pydantic model
|
|
2124
|
+
|
|
2125
|
+
Raises
|
|
2126
|
+
------
|
|
2127
|
+
AppwriteException
|
|
2128
|
+
If API request fails
|
|
2129
|
+
"""
|
|
2130
|
+
|
|
2131
|
+
api_path = '/organizations/{organizationId}/taxId'
|
|
2132
|
+
api_params = {}
|
|
2133
|
+
if organization_id is None:
|
|
2134
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
2135
|
+
|
|
2136
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
2137
|
+
|
|
2138
|
+
api_params['taxId'] = self._normalize_value(tax_id)
|
|
2139
|
+
|
|
2140
|
+
response = self.client.call('patch', api_path, {
|
|
2141
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
2142
|
+
'content-type': 'application/json',
|
|
2143
|
+
'accept': 'application/json',
|
|
2144
|
+
}, api_params)
|
|
2145
|
+
|
|
2146
|
+
return Organization.with_data(response, model_type)
|
|
2147
|
+
|
|
2148
|
+
|
|
2149
|
+
def get_usage(
|
|
2150
|
+
self,
|
|
2151
|
+
organization_id: str,
|
|
2152
|
+
start_date: Optional[str] = None,
|
|
2153
|
+
end_date: Optional[str] = None
|
|
2154
|
+
) -> UsageOrganization:
|
|
2155
|
+
"""
|
|
2156
|
+
Get the usage data for an organization.
|
|
2157
|
+
|
|
2158
|
+
Parameters
|
|
2159
|
+
----------
|
|
2160
|
+
organization_id : str
|
|
2161
|
+
Organization ID
|
|
2162
|
+
start_date : Optional[str]
|
|
2163
|
+
Starting date for the usage
|
|
2164
|
+
end_date : Optional[str]
|
|
2165
|
+
End date for the usage
|
|
2166
|
+
|
|
2167
|
+
Returns
|
|
2168
|
+
-------
|
|
2169
|
+
UsageOrganization
|
|
2170
|
+
API response as a typed Pydantic model
|
|
2171
|
+
|
|
2172
|
+
Raises
|
|
2173
|
+
------
|
|
2174
|
+
AppwriteException
|
|
2175
|
+
If API request fails
|
|
2176
|
+
"""
|
|
2177
|
+
|
|
2178
|
+
api_path = '/organizations/{organizationId}/usage'
|
|
2179
|
+
api_params = {}
|
|
2180
|
+
if organization_id is None:
|
|
2181
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
2182
|
+
|
|
2183
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
2184
|
+
|
|
2185
|
+
if start_date is not None:
|
|
2186
|
+
api_params['startDate'] = self._normalize_value(start_date)
|
|
2187
|
+
if end_date is not None:
|
|
2188
|
+
api_params['endDate'] = self._normalize_value(end_date)
|
|
2189
|
+
|
|
2190
|
+
response = self.client.call('get', api_path, {
|
|
2191
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
2192
|
+
'accept': 'application/json',
|
|
2193
|
+
}, api_params)
|
|
2194
|
+
|
|
2195
|
+
return self._parse_response(response, model=UsageOrganization)
|
|
2196
|
+
|
|
2197
|
+
|
|
2198
|
+
def validate_payment(
|
|
2199
|
+
self,
|
|
2200
|
+
organization_id: str,
|
|
2201
|
+
invites: Optional[List[str]] = None,
|
|
2202
|
+
model_type: Type[T] = dict
|
|
2203
|
+
) -> Organization[T]:
|
|
2204
|
+
"""
|
|
2205
|
+
Validate payment for team after creation or upgrade.
|
|
2206
|
+
|
|
2207
|
+
Parameters
|
|
2208
|
+
----------
|
|
2209
|
+
organization_id : str
|
|
2210
|
+
Organization ID
|
|
2211
|
+
invites : Optional[List[str]]
|
|
2212
|
+
Additional member invites
|
|
2213
|
+
|
|
2214
|
+
model_type : Type[T], optional
|
|
2215
|
+
Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
|
|
2216
|
+
|
|
2217
|
+
Returns
|
|
2218
|
+
-------
|
|
2219
|
+
Organization[T]
|
|
2220
|
+
API response as a typed Pydantic model
|
|
2221
|
+
|
|
2222
|
+
Raises
|
|
2223
|
+
------
|
|
2224
|
+
AppwriteException
|
|
2225
|
+
If API request fails
|
|
2226
|
+
"""
|
|
2227
|
+
|
|
2228
|
+
api_path = '/organizations/{organizationId}/validate'
|
|
2229
|
+
api_params = {}
|
|
2230
|
+
if organization_id is None:
|
|
2231
|
+
raise AppwriteException('Missing required parameter: "organization_id"')
|
|
2232
|
+
|
|
2233
|
+
api_path = api_path.replace('{organizationId}', str(self._normalize_value(organization_id)))
|
|
2234
|
+
|
|
2235
|
+
if invites is not None:
|
|
2236
|
+
api_params['invites'] = self._normalize_value(invites)
|
|
2237
|
+
|
|
2238
|
+
response = self.client.call('patch', api_path, {
|
|
2239
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
2240
|
+
'content-type': 'application/json',
|
|
2241
|
+
'accept': 'application/json',
|
|
2242
|
+
}, api_params)
|
|
2243
|
+
|
|
2244
|
+
return Organization.with_data(response, model_type)
|
|
2245
|
+
|