From 315eaaa562d91e7b25d0cd5b1f263d3fabbaad87 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 22 Nov 2022 19:19:43 +0000 Subject: [PATCH] Update examples for Swift, Kotlin, Web, Android and Apple --- .../java/account/create-anonymous-session.md | 56 ++++++++++++---- .../java/account/create-email-session.md | 63 ++++++++++++----- .../java/account/create-j-w-t.md | 56 ++++++++++++---- .../account/create-magic-u-r-l-session.md | 63 ++++++++++++----- .../java/account/create-o-auth2session.md | 59 +++++++++++----- .../java/account/create-phone-session.md | 63 ++++++++++++----- .../java/account/create-phone-verification.md | 56 ++++++++++++---- .../java/account/create-recovery.md | 63 ++++++++++++----- .../java/account/create-verification.md | 61 ++++++++++++----- .../client-android/java/account/create.md | 65 ++++++++++++------ .../java/account/delete-session.md | 61 ++++++++++++----- .../java/account/delete-sessions.md | 56 ++++++++++++---- .../client-android/java/account/get-prefs.md | 56 ++++++++++++---- .../java/account/get-session.md | 61 ++++++++++++----- .../1.1.x/client-android/java/account/get.md | 56 ++++++++++++---- .../client-android/java/account/list-logs.md | 59 +++++++++++----- .../java/account/list-sessions.md | 56 ++++++++++++---- .../java/account/update-email.md | 63 ++++++++++++----- .../account/update-magic-u-r-l-session.md | 63 ++++++++++++----- .../java/account/update-name.md | 61 ++++++++++++----- .../java/account/update-password.md | 61 ++++++++++++----- .../java/account/update-phone-session.md | 63 ++++++++++++----- .../java/account/update-phone-verification.md | 63 ++++++++++++----- .../java/account/update-phone.md | 63 ++++++++++++----- .../java/account/update-prefs.md | 61 ++++++++++++----- .../java/account/update-recovery.md | 67 +++++++++++++------ .../java/account/update-session.md | 61 ++++++++++++----- .../java/account/update-status.md | 56 ++++++++++++---- .../java/account/update-verification.md | 63 ++++++++++++----- .../java/avatars/get-browser.md | 61 ++++++++++++----- .../java/avatars/get-credit-card.md | 61 ++++++++++++----- .../java/avatars/get-favicon.md | 61 ++++++++++++----- .../client-android/java/avatars/get-flag.md | 61 ++++++++++++----- .../client-android/java/avatars/get-image.md | 61 ++++++++++++----- .../java/avatars/get-initials.md | 59 +++++++++++----- .../client-android/java/avatars/get-q-r.md | 61 ++++++++++++----- .../java/databases/create-document.md | 67 +++++++++++++------ .../java/databases/delete-document.md | 65 ++++++++++++------ .../java/databases/get-document.md | 65 ++++++++++++------ .../java/databases/list-documents.md | 63 ++++++++++++----- .../java/databases/update-document.md | 65 ++++++++++++------ .../java/functions/create-execution.md | 61 ++++++++++++----- .../java/functions/get-execution.md | 63 ++++++++++++----- .../java/functions/list-executions.md | 61 ++++++++++++----- .../1.1.x/client-android/java/locale/get.md | 56 ++++++++++++---- .../java/locale/list-continents.md | 56 ++++++++++++---- .../java/locale/list-countries-e-u.md | 56 ++++++++++++---- .../java/locale/list-countries-phones.md | 56 ++++++++++++---- .../java/locale/list-countries.md | 56 ++++++++++++---- .../java/locale/list-currencies.md | 56 ++++++++++++---- .../java/locale/list-languages.md | 56 ++++++++++++---- .../java/storage/create-file.md | 67 +++++++++++++------ .../java/storage/delete-file.md | 63 ++++++++++++----- .../java/storage/get-file-download.md | 63 ++++++++++++----- .../java/storage/get-file-preview.md | 63 ++++++++++++----- .../java/storage/get-file-view.md | 63 ++++++++++++----- .../client-android/java/storage/get-file.md | 63 ++++++++++++----- .../client-android/java/storage/list-files.md | 61 ++++++++++++----- .../java/storage/update-file.md | 63 ++++++++++++----- .../java/teams/create-membership.md | 67 +++++++++++++------ .../1.1.x/client-android/java/teams/create.md | 63 ++++++++++++----- .../java/teams/delete-membership.md | 63 ++++++++++++----- .../1.1.x/client-android/java/teams/delete.md | 61 ++++++++++++----- .../java/teams/get-membership.md | 63 ++++++++++++----- .../1.1.x/client-android/java/teams/get.md | 61 ++++++++++++----- .../java/teams/list-memberships.md | 61 ++++++++++++----- .../1.1.x/client-android/java/teams/list.md | 59 +++++++++++----- .../java/teams/update-membership-roles.md | 65 ++++++++++++------ .../java/teams/update-membership-status.md | 67 +++++++++++++------ .../1.1.x/client-android/java/teams/update.md | 63 ++++++++++++----- .../account/create-anonymous-session.md | 24 +++++-- .../kotlin/account/create-email-session.md | 30 ++++++--- .../kotlin/account/create-j-w-t.md | 24 +++++-- .../account/create-magic-u-r-l-session.md | 30 ++++++--- .../kotlin/account/create-o-auth2session.md | 29 ++++++-- .../kotlin/account/create-phone-session.md | 30 ++++++--- .../account/create-phone-verification.md | 24 +++++-- .../kotlin/account/create-recovery.md | 30 ++++++--- .../kotlin/account/create-verification.md | 28 ++++++-- .../client-android/kotlin/account/create.md | 32 ++++++--- .../kotlin/account/delete-session.md | 28 ++++++-- .../kotlin/account/delete-sessions.md | 24 +++++-- .../kotlin/account/get-prefs.md | 24 +++++-- .../kotlin/account/get-session.md | 28 ++++++-- .../client-android/kotlin/account/get.md | 24 +++++-- .../kotlin/account/list-logs.md | 26 +++++-- .../kotlin/account/list-sessions.md | 24 +++++-- .../kotlin/account/update-email.md | 30 ++++++--- .../account/update-magic-u-r-l-session.md | 30 ++++++--- .../kotlin/account/update-name.md | 28 ++++++-- .../kotlin/account/update-password.md | 28 ++++++-- .../kotlin/account/update-phone-session.md | 30 ++++++--- .../account/update-phone-verification.md | 30 ++++++--- .../kotlin/account/update-phone.md | 30 ++++++--- .../kotlin/account/update-prefs.md | 28 ++++++-- .../kotlin/account/update-recovery.md | 34 +++++++--- .../kotlin/account/update-session.md | 28 ++++++-- .../kotlin/account/update-status.md | 24 +++++-- .../kotlin/account/update-verification.md | 30 ++++++--- .../kotlin/avatars/get-browser.md | 28 ++++++-- .../kotlin/avatars/get-credit-card.md | 28 ++++++-- .../kotlin/avatars/get-favicon.md | 28 ++++++-- .../client-android/kotlin/avatars/get-flag.md | 28 ++++++-- .../kotlin/avatars/get-image.md | 28 ++++++-- .../kotlin/avatars/get-initials.md | 26 +++++-- .../client-android/kotlin/avatars/get-q-r.md | 28 ++++++-- .../kotlin/databases/create-document.md | 34 +++++++--- .../kotlin/databases/delete-document.md | 32 ++++++--- .../kotlin/databases/get-document.md | 32 ++++++--- .../kotlin/databases/list-documents.md | 30 ++++++--- .../kotlin/databases/update-document.md | 32 ++++++--- .../kotlin/functions/create-execution.md | 28 ++++++-- .../kotlin/functions/get-execution.md | 30 ++++++--- .../kotlin/functions/list-executions.md | 28 ++++++-- .../1.1.x/client-android/kotlin/locale/get.md | 24 +++++-- .../kotlin/locale/list-continents.md | 24 +++++-- .../kotlin/locale/list-countries-e-u.md | 24 +++++-- .../kotlin/locale/list-countries-phones.md | 24 +++++-- .../kotlin/locale/list-countries.md | 24 +++++-- .../kotlin/locale/list-currencies.md | 24 +++++-- .../kotlin/locale/list-languages.md | 24 +++++-- .../kotlin/storage/create-file.md | 32 ++++++--- .../kotlin/storage/delete-file.md | 30 ++++++--- .../kotlin/storage/get-file-download.md | 30 ++++++--- .../kotlin/storage/get-file-preview.md | 30 ++++++--- .../kotlin/storage/get-file-view.md | 30 ++++++--- .../client-android/kotlin/storage/get-file.md | 30 ++++++--- .../kotlin/storage/list-files.md | 28 ++++++-- .../kotlin/storage/update-file.md | 30 ++++++--- .../kotlin/teams/create-membership.md | 34 +++++++--- .../client-android/kotlin/teams/create.md | 30 ++++++--- .../kotlin/teams/delete-membership.md | 30 ++++++--- .../client-android/kotlin/teams/delete.md | 28 ++++++-- .../kotlin/teams/get-membership.md | 30 ++++++--- .../1.1.x/client-android/kotlin/teams/get.md | 28 ++++++-- .../kotlin/teams/list-memberships.md | 28 ++++++-- .../1.1.x/client-android/kotlin/teams/list.md | 26 +++++-- .../kotlin/teams/update-membership-roles.md | 32 ++++++--- .../kotlin/teams/update-membership-status.md | 34 +++++++--- .../client-android/kotlin/teams/update.md | 30 ++++++--- .../account/create-anonymous-session.md | 15 +++-- .../examples/account/create-email-session.md | 21 +++--- .../examples/account/create-j-w-t.md | 15 +++-- .../account/create-magic-u-r-l-session.md | 21 +++--- .../examples/account/create-o-auth2session.md | 19 +++--- .../examples/account/create-phone-session.md | 21 +++--- .../account/create-phone-verification.md | 15 +++-- .../examples/account/create-recovery.md | 21 +++--- .../examples/account/create-verification.md | 19 +++--- .../client-apple/examples/account/create.md | 23 ++++--- .../examples/account/delete-session.md | 19 +++--- .../examples/account/delete-sessions.md | 15 +++-- .../examples/account/get-prefs.md | 15 +++-- .../examples/account/get-session.md | 19 +++--- .../client-apple/examples/account/get.md | 15 +++-- .../examples/account/list-logs.md | 15 +++-- .../examples/account/list-sessions.md | 15 +++-- .../examples/account/update-email.md | 21 +++--- .../account/update-magic-u-r-l-session.md | 21 +++--- .../examples/account/update-name.md | 19 +++--- .../examples/account/update-password.md | 19 +++--- .../examples/account/update-phone-session.md | 21 +++--- .../account/update-phone-verification.md | 21 +++--- .../examples/account/update-phone.md | 21 +++--- .../examples/account/update-prefs.md | 19 +++--- .../examples/account/update-recovery.md | 25 +++---- .../examples/account/update-session.md | 19 +++--- .../examples/account/update-status.md | 15 +++-- .../examples/account/update-verification.md | 21 +++--- .../examples/avatars/get-browser.md | 19 +++--- .../examples/avatars/get-credit-card.md | 19 +++--- .../examples/avatars/get-favicon.md | 19 +++--- .../client-apple/examples/avatars/get-flag.md | 19 +++--- .../examples/avatars/get-image.md | 19 +++--- .../examples/avatars/get-initials.md | 15 +++-- .../client-apple/examples/avatars/get-q-r.md | 19 +++--- .../examples/databases/create-document.md | 25 +++---- .../examples/databases/delete-document.md | 23 ++++--- .../examples/databases/get-document.md | 23 ++++--- .../examples/databases/list-documents.md | 21 +++--- .../examples/databases/update-document.md | 23 ++++--- .../examples/functions/create-execution.md | 19 +++--- .../examples/functions/get-execution.md | 21 +++--- .../examples/functions/list-executions.md | 19 +++--- .../1.1.x/client-apple/examples/locale/get.md | 15 +++-- .../examples/locale/list-continents.md | 15 +++-- .../examples/locale/list-countries-e-u.md | 15 +++-- .../examples/locale/list-countries-phones.md | 15 +++-- .../examples/locale/list-countries.md | 15 +++-- .../examples/locale/list-currencies.md | 15 +++-- .../examples/locale/list-languages.md | 15 +++-- .../examples/storage/create-file.md | 23 ++++--- .../examples/storage/delete-file.md | 21 +++--- .../examples/storage/get-file-download.md | 21 +++--- .../examples/storage/get-file-preview.md | 21 +++--- .../examples/storage/get-file-view.md | 21 +++--- .../client-apple/examples/storage/get-file.md | 21 +++--- .../examples/storage/list-files.md | 19 +++--- .../examples/storage/update-file.md | 21 +++--- .../examples/teams/create-membership.md | 25 +++---- .../client-apple/examples/teams/create.md | 21 +++--- .../examples/teams/delete-membership.md | 21 +++--- .../client-apple/examples/teams/delete.md | 19 +++--- .../examples/teams/get-membership.md | 21 +++--- .../1.1.x/client-apple/examples/teams/get.md | 19 +++--- .../examples/teams/list-memberships.md | 19 +++--- .../1.1.x/client-apple/examples/teams/list.md | 15 +++-- .../examples/teams/update-membership-roles.md | 23 ++++--- .../teams/update-membership-status.md | 25 +++---- .../client-apple/examples/teams/update.md | 21 +++--- .../account/create-anonymous-session.md | 2 +- .../examples/account/create-email-session.md | 2 +- .../examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-session.md | 2 +- .../examples/account/create-o-auth2session.md | 2 +- .../examples/account/create-phone-session.md | 2 +- .../account/create-phone-verification.md | 2 +- .../examples/account/create-recovery.md | 2 +- .../examples/account/create-verification.md | 2 +- .../client-web/examples/account/create.md | 2 +- .../examples/account/delete-session.md | 2 +- .../examples/account/delete-sessions.md | 2 +- .../client-web/examples/account/get-prefs.md | 2 +- .../examples/account/get-session.md | 2 +- .../1.1.x/client-web/examples/account/get.md | 2 +- .../client-web/examples/account/list-logs.md | 2 +- .../examples/account/list-sessions.md | 2 +- .../examples/account/update-email.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../examples/account/update-name.md | 2 +- .../examples/account/update-password.md | 2 +- .../examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- .../examples/account/update-phone.md | 2 +- .../examples/account/update-prefs.md | 2 +- .../examples/account/update-recovery.md | 2 +- .../examples/account/update-session.md | 2 +- .../examples/account/update-status.md | 2 +- .../examples/account/update-verification.md | 2 +- .../examples/avatars/get-browser.md | 2 +- .../examples/avatars/get-credit-card.md | 2 +- .../examples/avatars/get-favicon.md | 2 +- .../client-web/examples/avatars/get-flag.md | 2 +- .../client-web/examples/avatars/get-image.md | 2 +- .../examples/avatars/get-initials.md | 2 +- .../client-web/examples/avatars/get-q-r.md | 2 +- .../examples/databases/create-document.md | 2 +- .../examples/databases/delete-document.md | 2 +- .../examples/databases/get-document.md | 2 +- .../examples/databases/list-documents.md | 2 +- .../examples/databases/update-document.md | 2 +- .../examples/functions/create-execution.md | 2 +- .../examples/functions/get-execution.md | 2 +- .../examples/functions/list-executions.md | 2 +- .../1.1.x/client-web/examples/locale/get.md | 2 +- .../examples/locale/list-continents.md | 2 +- .../examples/locale/list-countries-e-u.md | 2 +- .../examples/locale/list-countries-phones.md | 2 +- .../examples/locale/list-countries.md | 2 +- .../examples/locale/list-currencies.md | 2 +- .../examples/locale/list-languages.md | 2 +- .../examples/storage/create-file.md | 2 +- .../examples/storage/delete-file.md | 2 +- .../examples/storage/get-file-download.md | 2 +- .../examples/storage/get-file-preview.md | 2 +- .../examples/storage/get-file-view.md | 2 +- .../client-web/examples/storage/get-file.md | 2 +- .../client-web/examples/storage/list-files.md | 2 +- .../examples/storage/update-file.md | 2 +- .../examples/teams/create-membership.md | 2 +- .../1.1.x/client-web/examples/teams/create.md | 2 +- .../examples/teams/delete-membership.md | 2 +- .../1.1.x/client-web/examples/teams/delete.md | 2 +- .../examples/teams/get-membership.md | 2 +- .../1.1.x/client-web/examples/teams/get.md | 2 +- .../examples/teams/list-memberships.md | 2 +- .../1.1.x/client-web/examples/teams/list.md | 2 +- .../examples/teams/update-membership-roles.md | 2 +- .../teams/update-membership-status.md | 2 +- .../1.1.x/client-web/examples/teams/update.md | 2 +- .../account/create-anonymous-session.md | 2 +- .../examples/account/create-email-session.md | 2 +- .../examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-session.md | 2 +- .../examples/account/create-o-auth2session.md | 2 +- .../examples/account/create-phone-session.md | 2 +- .../account/create-phone-verification.md | 2 +- .../examples/account/create-recovery.md | 2 +- .../examples/account/create-verification.md | 2 +- .../console-web/examples/account/create.md | 2 +- .../examples/account/delete-session.md | 2 +- .../examples/account/delete-sessions.md | 2 +- .../console-web/examples/account/get-prefs.md | 2 +- .../examples/account/get-session.md | 2 +- .../1.1.x/console-web/examples/account/get.md | 2 +- .../console-web/examples/account/list-logs.md | 2 +- .../examples/account/list-sessions.md | 2 +- .../examples/account/update-email.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../examples/account/update-name.md | 2 +- .../examples/account/update-password.md | 2 +- .../examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- .../examples/account/update-phone.md | 2 +- .../examples/account/update-prefs.md | 2 +- .../examples/account/update-recovery.md | 2 +- .../examples/account/update-session.md | 2 +- .../examples/account/update-status.md | 2 +- .../examples/account/update-verification.md | 2 +- .../examples/avatars/get-browser.md | 2 +- .../examples/avatars/get-credit-card.md | 2 +- .../examples/avatars/get-favicon.md | 2 +- .../console-web/examples/avatars/get-flag.md | 2 +- .../console-web/examples/avatars/get-image.md | 2 +- .../examples/avatars/get-initials.md | 2 +- .../console-web/examples/avatars/get-q-r.md | 2 +- .../databases/create-boolean-attribute.md | 2 +- .../examples/databases/create-collection.md | 2 +- .../databases/create-datetime-attribute.md | 2 +- .../examples/databases/create-document.md | 2 +- .../databases/create-email-attribute.md | 2 +- .../databases/create-enum-attribute.md | 2 +- .../databases/create-float-attribute.md | 2 +- .../examples/databases/create-index.md | 2 +- .../databases/create-integer-attribute.md | 2 +- .../examples/databases/create-ip-attribute.md | 2 +- .../databases/create-string-attribute.md | 2 +- .../databases/create-url-attribute.md | 2 +- .../console-web/examples/databases/create.md | 2 +- .../examples/databases/delete-attribute.md | 2 +- .../examples/databases/delete-collection.md | 2 +- .../examples/databases/delete-document.md | 2 +- .../examples/databases/delete-index.md | 2 +- .../console-web/examples/databases/delete.md | 2 +- .../examples/databases/get-attribute.md | 2 +- .../databases/get-collection-usage.md | 2 +- .../examples/databases/get-collection.md | 2 +- .../examples/databases/get-database-usage.md | 2 +- .../examples/databases/get-document.md | 2 +- .../examples/databases/get-index.md | 2 +- .../examples/databases/get-usage.md | 2 +- .../console-web/examples/databases/get.md | 2 +- .../examples/databases/list-attributes.md | 2 +- .../databases/list-collection-logs.md | 2 +- .../examples/databases/list-collections.md | 2 +- .../examples/databases/list-document-logs.md | 2 +- .../examples/databases/list-documents.md | 2 +- .../examples/databases/list-indexes.md | 2 +- .../examples/databases/list-logs.md | 2 +- .../console-web/examples/databases/list.md | 2 +- .../examples/databases/update-collection.md | 2 +- .../examples/databases/update-document.md | 2 +- .../console-web/examples/databases/update.md | 2 +- .../examples/functions/create-build.md | 2 +- .../examples/functions/create-deployment.md | 2 +- .../examples/functions/create-execution.md | 2 +- .../examples/functions/create-variable.md | 2 +- .../console-web/examples/functions/create.md | 2 +- .../examples/functions/delete-deployment.md | 2 +- .../examples/functions/delete-variable.md | 2 +- .../console-web/examples/functions/delete.md | 2 +- .../examples/functions/get-deployment.md | 2 +- .../examples/functions/get-execution.md | 2 +- .../examples/functions/get-function-usage.md | 2 +- .../examples/functions/get-usage.md | 2 +- .../examples/functions/get-variable.md | 2 +- .../console-web/examples/functions/get.md | 2 +- .../examples/functions/list-deployments.md | 2 +- .../examples/functions/list-executions.md | 2 +- .../examples/functions/list-runtimes.md | 2 +- .../examples/functions/list-variables.md | 2 +- .../console-web/examples/functions/list.md | 2 +- .../examples/functions/update-deployment.md | 2 +- .../examples/functions/update-variable.md | 2 +- .../console-web/examples/functions/update.md | 2 +- .../examples/health/get-antivirus.md | 2 +- .../console-web/examples/health/get-cache.md | 2 +- .../console-web/examples/health/get-d-b.md | 2 +- .../examples/health/get-queue-certificates.md | 2 +- .../examples/health/get-queue-functions.md | 2 +- .../examples/health/get-queue-logs.md | 2 +- .../examples/health/get-queue-webhooks.md | 2 +- .../examples/health/get-storage-local.md | 2 +- .../console-web/examples/health/get-time.md | 2 +- .../1.1.x/console-web/examples/health/get.md | 2 +- .../1.1.x/console-web/examples/locale/get.md | 2 +- .../examples/locale/list-continents.md | 2 +- .../examples/locale/list-countries-e-u.md | 2 +- .../examples/locale/list-countries-phones.md | 2 +- .../examples/locale/list-countries.md | 2 +- .../examples/locale/list-currencies.md | 2 +- .../examples/locale/list-languages.md | 2 +- .../examples/projects/create-domain.md | 2 +- .../examples/projects/create-key.md | 2 +- .../examples/projects/create-platform.md | 2 +- .../examples/projects/create-webhook.md | 2 +- .../console-web/examples/projects/create.md | 2 +- .../examples/projects/delete-domain.md | 2 +- .../examples/projects/delete-key.md | 2 +- .../examples/projects/delete-platform.md | 2 +- .../examples/projects/delete-webhook.md | 2 +- .../console-web/examples/projects/delete.md | 2 +- .../examples/projects/get-domain.md | 2 +- .../console-web/examples/projects/get-key.md | 2 +- .../examples/projects/get-platform.md | 2 +- .../examples/projects/get-usage.md | 2 +- .../examples/projects/get-webhook.md | 2 +- .../console-web/examples/projects/get.md | 2 +- .../examples/projects/list-domains.md | 2 +- .../examples/projects/list-keys.md | 2 +- .../examples/projects/list-platforms.md | 2 +- .../examples/projects/list-webhooks.md | 2 +- .../console-web/examples/projects/list.md | 2 +- .../examples/projects/update-auth-duration.md | 2 +- .../examples/projects/update-auth-limit.md | 2 +- .../examples/projects/update-auth-status.md | 2 +- .../projects/update-domain-verification.md | 2 +- .../examples/projects/update-key.md | 2 +- .../examples/projects/update-o-auth2.md | 2 +- .../examples/projects/update-platform.md | 2 +- .../projects/update-service-status.md | 2 +- .../projects/update-webhook-signature.md | 2 +- .../examples/projects/update-webhook.md | 2 +- .../console-web/examples/projects/update.md | 2 +- .../examples/storage/create-bucket.md | 2 +- .../examples/storage/create-file.md | 2 +- .../examples/storage/delete-bucket.md | 2 +- .../examples/storage/delete-file.md | 2 +- .../examples/storage/get-bucket-usage.md | 2 +- .../examples/storage/get-bucket.md | 2 +- .../examples/storage/get-file-download.md | 2 +- .../examples/storage/get-file-preview.md | 2 +- .../examples/storage/get-file-view.md | 2 +- .../console-web/examples/storage/get-file.md | 2 +- .../console-web/examples/storage/get-usage.md | 2 +- .../examples/storage/list-buckets.md | 2 +- .../examples/storage/list-files.md | 2 +- .../examples/storage/update-bucket.md | 2 +- .../examples/storage/update-file.md | 2 +- .../examples/teams/create-membership.md | 2 +- .../console-web/examples/teams/create.md | 2 +- .../examples/teams/delete-membership.md | 2 +- .../console-web/examples/teams/delete.md | 2 +- .../examples/teams/get-membership.md | 2 +- .../1.1.x/console-web/examples/teams/get.md | 2 +- .../console-web/examples/teams/list-logs.md | 2 +- .../examples/teams/list-memberships.md | 2 +- .../1.1.x/console-web/examples/teams/list.md | 2 +- .../examples/teams/update-membership-roles.md | 2 +- .../teams/update-membership-status.md | 2 +- .../console-web/examples/teams/update.md | 2 +- .../examples/users/create-argon2user.md | 2 +- .../examples/users/create-bcrypt-user.md | 2 +- .../examples/users/create-m-d5user.md | 2 +- .../examples/users/create-p-h-pass-user.md | 2 +- .../examples/users/create-s-h-a-user.md | 2 +- .../users/create-scrypt-modified-user.md | 2 +- .../examples/users/create-scrypt-user.md | 2 +- .../console-web/examples/users/create.md | 2 +- .../examples/users/delete-session.md | 2 +- .../examples/users/delete-sessions.md | 2 +- .../console-web/examples/users/delete.md | 2 +- .../console-web/examples/users/get-prefs.md | 2 +- .../console-web/examples/users/get-usage.md | 2 +- .../1.1.x/console-web/examples/users/get.md | 2 +- .../console-web/examples/users/list-logs.md | 2 +- .../examples/users/list-memberships.md | 2 +- .../examples/users/list-sessions.md | 2 +- .../1.1.x/console-web/examples/users/list.md | 2 +- .../users/update-email-verification.md | 2 +- .../examples/users/update-email.md | 2 +- .../console-web/examples/users/update-name.md | 2 +- .../examples/users/update-password.md | 2 +- .../users/update-phone-verification.md | 2 +- .../examples/users/update-phone.md | 2 +- .../examples/users/update-prefs.md | 2 +- .../examples/users/update-status.md | 2 +- .../java/account/create-phone-verification.md | 46 ++++++++----- .../java/account/create-recovery.md | 52 ++++++++------ .../java/account/create-verification.md | 50 +++++++++----- .../java/account/delete-session.md | 50 +++++++++----- .../java/account/delete-sessions.md | 46 ++++++++----- .../server-kotlin/java/account/get-prefs.md | 46 ++++++++----- .../server-kotlin/java/account/get-session.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/account/get.md | 46 ++++++++----- .../server-kotlin/java/account/list-logs.md | 48 ++++++++----- .../java/account/list-sessions.md | 46 ++++++++----- .../java/account/update-email.md | 52 ++++++++------ .../server-kotlin/java/account/update-name.md | 50 +++++++++----- .../java/account/update-password.md | 50 +++++++++----- .../java/account/update-phone-verification.md | 52 ++++++++------ .../java/account/update-phone.md | 52 ++++++++------ .../java/account/update-prefs.md | 50 +++++++++----- .../java/account/update-recovery.md | 56 ++++++++++------ .../java/account/update-session.md | 50 +++++++++----- .../java/account/update-status.md | 46 ++++++++----- .../java/account/update-verification.md | 52 ++++++++------ .../server-kotlin/java/avatars/get-browser.md | 50 +++++++++----- .../java/avatars/get-credit-card.md | 50 +++++++++----- .../server-kotlin/java/avatars/get-favicon.md | 50 +++++++++----- .../server-kotlin/java/avatars/get-flag.md | 50 +++++++++----- .../server-kotlin/java/avatars/get-image.md | 50 +++++++++----- .../java/avatars/get-initials.md | 48 ++++++++----- .../server-kotlin/java/avatars/get-q-r.md | 50 +++++++++----- .../databases/create-boolean-attribute.md | 56 ++++++++++------ .../java/databases/create-collection.md | 54 +++++++++------ .../databases/create-datetime-attribute.md | 56 ++++++++++------ .../java/databases/create-document.md | 56 ++++++++++------ .../java/databases/create-email-attribute.md | 56 ++++++++++------ .../java/databases/create-enum-attribute.md | 58 ++++++++++------ .../java/databases/create-float-attribute.md | 56 ++++++++++------ .../java/databases/create-index.md | 58 ++++++++++------ .../databases/create-integer-attribute.md | 56 ++++++++++------ .../java/databases/create-ip-attribute.md | 56 ++++++++++------ .../java/databases/create-string-attribute.md | 58 ++++++++++------ .../java/databases/create-url-attribute.md | 56 ++++++++++------ .../server-kotlin/java/databases/create.md | 52 ++++++++------ .../java/databases/delete-attribute.md | 54 +++++++++------ .../java/databases/delete-collection.md | 52 ++++++++------ .../java/databases/delete-document.md | 54 +++++++++------ .../java/databases/delete-index.md | 54 +++++++++------ .../server-kotlin/java/databases/delete.md | 50 +++++++++----- .../java/databases/get-attribute.md | 54 +++++++++------ .../java/databases/get-collection.md | 52 ++++++++------ .../java/databases/get-document.md | 54 +++++++++------ .../server-kotlin/java/databases/get-index.md | 54 +++++++++------ .../1.1.x/server-kotlin/java/databases/get.md | 50 +++++++++----- .../java/databases/list-attributes.md | 52 ++++++++------ .../java/databases/list-collections.md | 50 +++++++++----- .../java/databases/list-documents.md | 52 ++++++++------ .../java/databases/list-indexes.md | 52 ++++++++------ .../server-kotlin/java/databases/list.md | 48 ++++++++----- .../java/databases/update-collection.md | 54 +++++++++------ .../java/databases/update-document.md | 54 +++++++++------ .../server-kotlin/java/databases/update.md | 52 ++++++++------ .../java/functions/create-build.md | 54 +++++++++------ .../java/functions/create-deployment.md | 58 ++++++++++------ .../java/functions/create-execution.md | 50 +++++++++----- .../java/functions/create-variable.md | 54 +++++++++------ .../server-kotlin/java/functions/create.md | 56 ++++++++++------ .../java/functions/delete-deployment.md | 52 ++++++++------ .../java/functions/delete-variable.md | 52 ++++++++------ .../server-kotlin/java/functions/delete.md | 50 +++++++++----- .../java/functions/get-deployment.md | 52 ++++++++------ .../java/functions/get-execution.md | 52 ++++++++------ .../java/functions/get-variable.md | 52 ++++++++------ .../1.1.x/server-kotlin/java/functions/get.md | 50 +++++++++----- .../java/functions/list-deployments.md | 50 +++++++++----- .../java/functions/list-executions.md | 50 +++++++++----- .../java/functions/list-runtimes.md | 46 ++++++++----- .../java/functions/list-variables.md | 50 +++++++++----- .../server-kotlin/java/functions/list.md | 48 ++++++++----- .../java/functions/update-deployment.md | 52 ++++++++------ .../java/functions/update-variable.md | 54 +++++++++------ .../server-kotlin/java/functions/update.md | 54 +++++++++------ .../java/health/get-antivirus.md | 46 ++++++++----- .../server-kotlin/java/health/get-cache.md | 46 ++++++++----- .../server-kotlin/java/health/get-d-b.md | 46 ++++++++----- .../java/health/get-queue-certificates.md | 46 ++++++++----- .../java/health/get-queue-functions.md | 46 ++++++++----- .../java/health/get-queue-logs.md | 46 ++++++++----- .../java/health/get-queue-webhooks.md | 46 ++++++++----- .../java/health/get-storage-local.md | 46 ++++++++----- .../server-kotlin/java/health/get-time.md | 46 ++++++++----- .../1.1.x/server-kotlin/java/health/get.md | 46 ++++++++----- .../1.1.x/server-kotlin/java/locale/get.md | 46 ++++++++----- .../java/locale/list-continents.md | 46 ++++++++----- .../java/locale/list-countries-e-u.md | 46 ++++++++----- .../java/locale/list-countries-phones.md | 46 ++++++++----- .../java/locale/list-countries.md | 46 ++++++++----- .../java/locale/list-currencies.md | 46 ++++++++----- .../java/locale/list-languages.md | 46 ++++++++----- .../java/storage/create-bucket.md | 52 ++++++++------ .../server-kotlin/java/storage/create-file.md | 56 ++++++++++------ .../java/storage/delete-bucket.md | 50 +++++++++----- .../server-kotlin/java/storage/delete-file.md | 52 ++++++++------ .../server-kotlin/java/storage/get-bucket.md | 50 +++++++++----- .../java/storage/get-file-download.md | 52 ++++++++------ .../java/storage/get-file-preview.md | 52 ++++++++------ .../java/storage/get-file-view.md | 52 ++++++++------ .../server-kotlin/java/storage/get-file.md | 52 ++++++++------ .../java/storage/list-buckets.md | 48 ++++++++----- .../server-kotlin/java/storage/list-files.md | 50 +++++++++----- .../java/storage/update-bucket.md | 52 ++++++++------ .../server-kotlin/java/storage/update-file.md | 52 ++++++++------ .../java/teams/create-membership.md | 56 ++++++++++------ .../1.1.x/server-kotlin/java/teams/create.md | 52 ++++++++------ .../java/teams/delete-membership.md | 52 ++++++++------ .../1.1.x/server-kotlin/java/teams/delete.md | 50 +++++++++----- .../java/teams/get-membership.md | 52 ++++++++------ .../1.1.x/server-kotlin/java/teams/get.md | 50 +++++++++----- .../java/teams/list-memberships.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/teams/list.md | 48 ++++++++----- .../java/teams/update-membership-roles.md | 54 +++++++++------ .../java/teams/update-membership-status.md | 56 ++++++++++------ .../1.1.x/server-kotlin/java/teams/update.md | 52 ++++++++------ .../java/users/create-argon2user.md | 54 +++++++++------ .../java/users/create-bcrypt-user.md | 54 +++++++++------ .../java/users/create-m-d5user.md | 54 +++++++++------ .../java/users/create-p-h-pass-user.md | 54 +++++++++------ .../java/users/create-s-h-a-user.md | 54 +++++++++------ .../java/users/create-scrypt-modified-user.md | 60 ++++++++++------- .../java/users/create-scrypt-user.md | 64 +++++++++++------- .../1.1.x/server-kotlin/java/users/create.md | 50 +++++++++----- .../java/users/delete-session.md | 52 ++++++++------ .../java/users/delete-sessions.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/users/delete.md | 50 +++++++++----- .../server-kotlin/java/users/get-prefs.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/users/get.md | 50 +++++++++----- .../server-kotlin/java/users/list-logs.md | 50 +++++++++----- .../java/users/list-memberships.md | 50 +++++++++----- .../server-kotlin/java/users/list-sessions.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/users/list.md | 48 ++++++++----- .../java/users/update-email-verification.md | 52 ++++++++------ .../server-kotlin/java/users/update-email.md | 52 ++++++++------ .../server-kotlin/java/users/update-name.md | 52 ++++++++------ .../java/users/update-password.md | 52 ++++++++------ .../java/users/update-phone-verification.md | 52 ++++++++------ .../server-kotlin/java/users/update-phone.md | 52 ++++++++------ .../server-kotlin/java/users/update-prefs.md | 52 ++++++++------ .../server-kotlin/java/users/update-status.md | 52 ++++++++------ .../account/create-phone-verification.md | 16 +++-- .../kotlin/account/create-recovery.md | 22 +++--- .../kotlin/account/create-verification.md | 20 +++--- .../kotlin/account/delete-session.md | 20 +++--- .../kotlin/account/delete-sessions.md | 16 +++-- .../server-kotlin/kotlin/account/get-prefs.md | 16 +++-- .../kotlin/account/get-session.md | 20 +++--- .../1.1.x/server-kotlin/kotlin/account/get.md | 16 +++-- .../server-kotlin/kotlin/account/list-logs.md | 18 ++--- .../kotlin/account/list-sessions.md | 16 +++-- .../kotlin/account/update-email.md | 22 +++--- .../kotlin/account/update-name.md | 20 +++--- .../kotlin/account/update-password.md | 20 +++--- .../account/update-phone-verification.md | 22 +++--- .../kotlin/account/update-phone.md | 22 +++--- .../kotlin/account/update-prefs.md | 20 +++--- .../kotlin/account/update-recovery.md | 26 +++---- .../kotlin/account/update-session.md | 20 +++--- .../kotlin/account/update-status.md | 16 +++-- .../kotlin/account/update-verification.md | 22 +++--- .../kotlin/avatars/get-browser.md | 20 +++--- .../kotlin/avatars/get-credit-card.md | 20 +++--- .../kotlin/avatars/get-favicon.md | 20 +++--- .../server-kotlin/kotlin/avatars/get-flag.md | 20 +++--- .../server-kotlin/kotlin/avatars/get-image.md | 20 +++--- .../kotlin/avatars/get-initials.md | 18 ++--- .../server-kotlin/kotlin/avatars/get-q-r.md | 20 +++--- .../databases/create-boolean-attribute.md | 26 +++---- .../kotlin/databases/create-collection.md | 24 ++++--- .../databases/create-datetime-attribute.md | 26 +++---- .../kotlin/databases/create-document.md | 26 +++---- .../databases/create-email-attribute.md | 26 +++---- .../kotlin/databases/create-enum-attribute.md | 28 ++++---- .../databases/create-float-attribute.md | 26 +++---- .../kotlin/databases/create-index.md | 28 ++++---- .../databases/create-integer-attribute.md | 26 +++---- .../kotlin/databases/create-ip-attribute.md | 26 +++---- .../databases/create-string-attribute.md | 28 ++++---- .../kotlin/databases/create-url-attribute.md | 26 +++---- .../server-kotlin/kotlin/databases/create.md | 22 +++--- .../kotlin/databases/delete-attribute.md | 24 ++++--- .../kotlin/databases/delete-collection.md | 22 +++--- .../kotlin/databases/delete-document.md | 24 ++++--- .../kotlin/databases/delete-index.md | 24 ++++--- .../server-kotlin/kotlin/databases/delete.md | 20 +++--- .../kotlin/databases/get-attribute.md | 24 ++++--- .../kotlin/databases/get-collection.md | 22 +++--- .../kotlin/databases/get-document.md | 24 ++++--- .../kotlin/databases/get-index.md | 24 ++++--- .../server-kotlin/kotlin/databases/get.md | 20 +++--- .../kotlin/databases/list-attributes.md | 22 +++--- .../kotlin/databases/list-collections.md | 20 +++--- .../kotlin/databases/list-documents.md | 22 +++--- .../kotlin/databases/list-indexes.md | 22 +++--- .../server-kotlin/kotlin/databases/list.md | 18 ++--- .../kotlin/databases/update-collection.md | 24 ++++--- .../kotlin/databases/update-document.md | 24 ++++--- .../server-kotlin/kotlin/databases/update.md | 22 +++--- .../kotlin/functions/create-build.md | 24 ++++--- .../kotlin/functions/create-deployment.md | 26 +++---- .../kotlin/functions/create-execution.md | 20 +++--- .../kotlin/functions/create-variable.md | 24 ++++--- .../server-kotlin/kotlin/functions/create.md | 26 +++---- .../kotlin/functions/delete-deployment.md | 22 +++--- .../kotlin/functions/delete-variable.md | 22 +++--- .../server-kotlin/kotlin/functions/delete.md | 20 +++--- .../kotlin/functions/get-deployment.md | 22 +++--- .../kotlin/functions/get-execution.md | 22 +++--- .../kotlin/functions/get-variable.md | 22 +++--- .../server-kotlin/kotlin/functions/get.md | 20 +++--- .../kotlin/functions/list-deployments.md | 20 +++--- .../kotlin/functions/list-executions.md | 20 +++--- .../kotlin/functions/list-runtimes.md | 16 +++-- .../kotlin/functions/list-variables.md | 20 +++--- .../server-kotlin/kotlin/functions/list.md | 18 ++--- .../kotlin/functions/update-deployment.md | 22 +++--- .../kotlin/functions/update-variable.md | 24 ++++--- .../server-kotlin/kotlin/functions/update.md | 24 ++++--- .../kotlin/health/get-antivirus.md | 16 +++-- .../server-kotlin/kotlin/health/get-cache.md | 16 +++-- .../server-kotlin/kotlin/health/get-d-b.md | 16 +++-- .../kotlin/health/get-queue-certificates.md | 16 +++-- .../kotlin/health/get-queue-functions.md | 16 +++-- .../kotlin/health/get-queue-logs.md | 16 +++-- .../kotlin/health/get-queue-webhooks.md | 16 +++-- .../kotlin/health/get-storage-local.md | 16 +++-- .../server-kotlin/kotlin/health/get-time.md | 16 +++-- .../1.1.x/server-kotlin/kotlin/health/get.md | 16 +++-- .../1.1.x/server-kotlin/kotlin/locale/get.md | 16 +++-- .../kotlin/locale/list-continents.md | 16 +++-- .../kotlin/locale/list-countries-e-u.md | 16 +++-- .../kotlin/locale/list-countries-phones.md | 16 +++-- .../kotlin/locale/list-countries.md | 16 +++-- .../kotlin/locale/list-currencies.md | 16 +++-- .../kotlin/locale/list-languages.md | 16 +++-- .../kotlin/storage/create-bucket.md | 22 +++--- .../kotlin/storage/create-file.md | 24 ++++--- .../kotlin/storage/delete-bucket.md | 20 +++--- .../kotlin/storage/delete-file.md | 22 +++--- .../kotlin/storage/get-bucket.md | 20 +++--- .../kotlin/storage/get-file-download.md | 22 +++--- .../kotlin/storage/get-file-preview.md | 22 +++--- .../kotlin/storage/get-file-view.md | 22 +++--- .../server-kotlin/kotlin/storage/get-file.md | 22 +++--- .../kotlin/storage/list-buckets.md | 18 ++--- .../kotlin/storage/list-files.md | 20 +++--- .../kotlin/storage/update-bucket.md | 22 +++--- .../kotlin/storage/update-file.md | 22 +++--- .../kotlin/teams/create-membership.md | 26 +++---- .../server-kotlin/kotlin/teams/create.md | 22 +++--- .../kotlin/teams/delete-membership.md | 22 +++--- .../server-kotlin/kotlin/teams/delete.md | 20 +++--- .../kotlin/teams/get-membership.md | 22 +++--- .../1.1.x/server-kotlin/kotlin/teams/get.md | 20 +++--- .../kotlin/teams/list-memberships.md | 20 +++--- .../1.1.x/server-kotlin/kotlin/teams/list.md | 18 ++--- .../kotlin/teams/update-membership-roles.md | 24 ++++--- .../kotlin/teams/update-membership-status.md | 26 +++---- .../server-kotlin/kotlin/teams/update.md | 22 +++--- .../kotlin/users/create-argon2user.md | 24 ++++--- .../kotlin/users/create-bcrypt-user.md | 24 ++++--- .../kotlin/users/create-m-d5user.md | 24 ++++--- .../kotlin/users/create-p-h-pass-user.md | 24 ++++--- .../kotlin/users/create-s-h-a-user.md | 24 ++++--- .../users/create-scrypt-modified-user.md | 30 +++++---- .../kotlin/users/create-scrypt-user.md | 34 +++++----- .../server-kotlin/kotlin/users/create.md | 20 +++--- .../kotlin/users/delete-session.md | 22 +++--- .../kotlin/users/delete-sessions.md | 20 +++--- .../server-kotlin/kotlin/users/delete.md | 20 +++--- .../server-kotlin/kotlin/users/get-prefs.md | 20 +++--- .../1.1.x/server-kotlin/kotlin/users/get.md | 20 +++--- .../server-kotlin/kotlin/users/list-logs.md | 20 +++--- .../kotlin/users/list-memberships.md | 20 +++--- .../kotlin/users/list-sessions.md | 20 +++--- .../1.1.x/server-kotlin/kotlin/users/list.md | 18 ++--- .../kotlin/users/update-email-verification.md | 22 +++--- .../kotlin/users/update-email.md | 22 +++--- .../server-kotlin/kotlin/users/update-name.md | 22 +++--- .../kotlin/users/update-password.md | 22 +++--- .../kotlin/users/update-phone-verification.md | 22 +++--- .../kotlin/users/update-phone.md | 22 +++--- .../kotlin/users/update-prefs.md | 22 +++--- .../kotlin/users/update-status.md | 22 +++--- .../account/create-phone-verification.md | 17 ++--- .../examples/account/create-recovery.md | 23 ++++--- .../examples/account/create-verification.md | 21 +++--- .../examples/account/delete-session.md | 21 +++--- .../examples/account/delete-sessions.md | 17 ++--- .../examples/account/get-prefs.md | 17 ++--- .../examples/account/get-session.md | 21 +++--- .../server-swift/examples/account/get.md | 17 ++--- .../examples/account/list-logs.md | 17 ++--- .../examples/account/list-sessions.md | 17 ++--- .../examples/account/update-email.md | 23 ++++--- .../examples/account/update-name.md | 21 +++--- .../examples/account/update-password.md | 21 +++--- .../account/update-phone-verification.md | 23 ++++--- .../examples/account/update-phone.md | 23 ++++--- .../examples/account/update-prefs.md | 21 +++--- .../examples/account/update-recovery.md | 27 ++++---- .../examples/account/update-session.md | 21 +++--- .../examples/account/update-status.md | 17 ++--- .../examples/account/update-verification.md | 23 ++++--- .../examples/avatars/get-browser.md | 21 +++--- .../examples/avatars/get-credit-card.md | 21 +++--- .../examples/avatars/get-favicon.md | 21 +++--- .../server-swift/examples/avatars/get-flag.md | 21 +++--- .../examples/avatars/get-image.md | 21 +++--- .../examples/avatars/get-initials.md | 17 ++--- .../server-swift/examples/avatars/get-q-r.md | 21 +++--- .../databases/create-boolean-attribute.md | 27 ++++---- .../examples/databases/create-collection.md | 25 +++---- .../databases/create-datetime-attribute.md | 27 ++++---- .../examples/databases/create-document.md | 27 ++++---- .../databases/create-email-attribute.md | 27 ++++---- .../databases/create-enum-attribute.md | 29 ++++---- .../databases/create-float-attribute.md | 27 ++++---- .../examples/databases/create-index.md | 29 ++++---- .../databases/create-integer-attribute.md | 27 ++++---- .../examples/databases/create-ip-attribute.md | 27 ++++---- .../databases/create-string-attribute.md | 29 ++++---- .../databases/create-url-attribute.md | 27 ++++---- .../server-swift/examples/databases/create.md | 23 ++++--- .../examples/databases/delete-attribute.md | 25 +++---- .../examples/databases/delete-collection.md | 23 ++++--- .../examples/databases/delete-document.md | 25 +++---- .../examples/databases/delete-index.md | 25 +++---- .../server-swift/examples/databases/delete.md | 21 +++--- .../examples/databases/get-attribute.md | 25 +++---- .../examples/databases/get-collection.md | 23 ++++--- .../examples/databases/get-document.md | 25 +++---- .../examples/databases/get-index.md | 25 +++---- .../server-swift/examples/databases/get.md | 21 +++--- .../examples/databases/list-attributes.md | 23 ++++--- .../examples/databases/list-collections.md | 21 +++--- .../examples/databases/list-documents.md | 23 ++++--- .../examples/databases/list-indexes.md | 23 ++++--- .../server-swift/examples/databases/list.md | 17 ++--- .../examples/databases/update-collection.md | 25 +++---- .../examples/databases/update-document.md | 25 +++---- .../server-swift/examples/databases/update.md | 23 ++++--- .../examples/functions/create-build.md | 25 +++---- .../examples/functions/create-deployment.md | 27 ++++---- .../examples/functions/create-execution.md | 21 +++--- .../examples/functions/create-variable.md | 25 +++---- .../server-swift/examples/functions/create.md | 27 ++++---- .../examples/functions/delete-deployment.md | 23 ++++--- .../examples/functions/delete-variable.md | 23 ++++--- .../server-swift/examples/functions/delete.md | 21 +++--- .../examples/functions/get-deployment.md | 23 ++++--- .../examples/functions/get-execution.md | 23 ++++--- .../examples/functions/get-variable.md | 23 ++++--- .../server-swift/examples/functions/get.md | 21 +++--- .../examples/functions/list-deployments.md | 21 +++--- .../examples/functions/list-executions.md | 21 +++--- .../examples/functions/list-runtimes.md | 17 ++--- .../examples/functions/list-variables.md | 21 +++--- .../server-swift/examples/functions/list.md | 17 ++--- .../examples/functions/update-deployment.md | 23 ++++--- .../examples/functions/update-variable.md | 25 +++---- .../server-swift/examples/functions/update.md | 25 +++---- .../examples/health/get-antivirus.md | 17 ++--- .../server-swift/examples/health/get-cache.md | 17 ++--- .../server-swift/examples/health/get-d-b.md | 17 ++--- .../examples/health/get-queue-certificates.md | 17 ++--- .../examples/health/get-queue-functions.md | 17 ++--- .../examples/health/get-queue-logs.md | 17 ++--- .../examples/health/get-queue-webhooks.md | 17 ++--- .../examples/health/get-storage-local.md | 17 ++--- .../server-swift/examples/health/get-time.md | 17 ++--- .../1.1.x/server-swift/examples/health/get.md | 17 ++--- .../1.1.x/server-swift/examples/locale/get.md | 17 ++--- .../examples/locale/list-continents.md | 17 ++--- .../examples/locale/list-countries-e-u.md | 17 ++--- .../examples/locale/list-countries-phones.md | 17 ++--- .../examples/locale/list-countries.md | 17 ++--- .../examples/locale/list-currencies.md | 17 ++--- .../examples/locale/list-languages.md | 17 ++--- .../examples/storage/create-bucket.md | 23 ++++--- .../examples/storage/create-file.md | 25 +++---- .../examples/storage/delete-bucket.md | 21 +++--- .../examples/storage/delete-file.md | 23 ++++--- .../examples/storage/get-bucket.md | 21 +++--- .../examples/storage/get-file-download.md | 23 ++++--- .../examples/storage/get-file-preview.md | 23 ++++--- .../examples/storage/get-file-view.md | 23 ++++--- .../server-swift/examples/storage/get-file.md | 23 ++++--- .../examples/storage/list-buckets.md | 17 ++--- .../examples/storage/list-files.md | 21 +++--- .../examples/storage/update-bucket.md | 23 ++++--- .../examples/storage/update-file.md | 23 ++++--- .../examples/teams/create-membership.md | 27 ++++---- .../server-swift/examples/teams/create.md | 23 ++++--- .../examples/teams/delete-membership.md | 23 ++++--- .../server-swift/examples/teams/delete.md | 21 +++--- .../examples/teams/get-membership.md | 23 ++++--- .../1.1.x/server-swift/examples/teams/get.md | 21 +++--- .../examples/teams/list-memberships.md | 21 +++--- .../1.1.x/server-swift/examples/teams/list.md | 17 ++--- .../examples/teams/update-membership-roles.md | 25 +++---- .../teams/update-membership-status.md | 27 ++++---- .../server-swift/examples/teams/update.md | 23 ++++--- .../examples/users/create-argon2user.md | 25 +++---- .../examples/users/create-bcrypt-user.md | 25 +++---- .../examples/users/create-m-d5user.md | 25 +++---- .../examples/users/create-p-h-pass-user.md | 25 +++---- .../examples/users/create-s-h-a-user.md | 25 +++---- .../users/create-scrypt-modified-user.md | 31 ++++----- .../examples/users/create-scrypt-user.md | 35 +++++----- .../server-swift/examples/users/create.md | 21 +++--- .../examples/users/delete-session.md | 23 ++++--- .../examples/users/delete-sessions.md | 21 +++--- .../server-swift/examples/users/delete.md | 21 +++--- .../server-swift/examples/users/get-prefs.md | 21 +++--- .../1.1.x/server-swift/examples/users/get.md | 21 +++--- .../server-swift/examples/users/list-logs.md | 21 +++--- .../examples/users/list-memberships.md | 21 +++--- .../examples/users/list-sessions.md | 21 +++--- .../1.1.x/server-swift/examples/users/list.md | 17 ++--- .../users/update-email-verification.md | 23 ++++--- .../examples/users/update-email.md | 23 ++++--- .../examples/users/update-name.md | 23 ++++--- .../examples/users/update-password.md | 23 ++++--- .../users/update-phone-verification.md | 23 ++++--- .../examples/users/update-phone.md | 23 ++++--- .../examples/users/update-prefs.md | 23 ++++--- .../examples/users/update-status.md | 23 ++++--- 909 files changed, 13585 insertions(+), 8183 deletions(-) diff --git a/docs/examples/1.1.x/client-android/java/account/create-anonymous-session.md b/docs/examples/1.1.x/client-android/java/account/create-anonymous-session.md index 7d2123b58d..b1a2a25828 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-anonymous-session.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createAnonymousSession(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.createAnonymousSession(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-email-session.md b/docs/examples/1.1.x/client-android/java/account/create-email-session.md index 384dbaf342..055b828e9e 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-email-session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-email-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createEmailSession( - "email@example.com", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createEmailSession( + "email@example.com", + "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-j-w-t.md b/docs/examples/1.1.x/client-android/java/account/create-j-w-t.md index 86ad90557d..3a97c334ce 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-j-w-t.md +++ b/docs/examples/1.1.x/client-android/java/account/create-j-w-t.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createJWT(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.createJWT(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/client-android/java/account/create-magic-u-r-l-session.md index 1789eec99a..6c9fa7c662 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-magic-u-r-l-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createMagicURLSession( - "[USER_ID]", - "email@example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createMagicURLSession( + "[USER_ID]", + "email@example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-o-auth2session.md b/docs/examples/1.1.x/client-android/java/account/create-o-auth2session.md index a2f5d02dcf..e4cfb8d471 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-o-auth2session.md @@ -1,21 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createOAuth2Session( - "amazon", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createOAuth2Session( + this, + "amazon", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-phone-session.md b/docs/examples/1.1.x/client-android/java/account/create-phone-session.md index 7c54dbdcc6..94178d448d 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-phone-session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-phone-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createPhoneSession( - "[USER_ID]", - "+12065550100" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createPhoneSession( + "[USER_ID]", + "+12065550100" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-phone-verification.md b/docs/examples/1.1.x/client-android/java/account/create-phone-verification.md index f3e95265b2..401b942888 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-phone-verification.md +++ b/docs/examples/1.1.x/client-android/java/account/create-phone-verification.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.createPhoneVerification(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-recovery.md b/docs/examples/1.1.x/client-android/java/account/create-recovery.md index 44773dd24c..459213bce9 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-recovery.md +++ b/docs/examples/1.1.x/client-android/java/account/create-recovery.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createRecovery( - "email@example.com", - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createRecovery( + "email@example.com", + "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-verification.md b/docs/examples/1.1.x/client-android/java/account/create-verification.md index 02d29345ee..b8b1c206bf 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-verification.md +++ b/docs/examples/1.1.x/client-android/java/account/create-verification.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createVerification( - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createVerification( + "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create.md b/docs/examples/1.1.x/client-android/java/account/create.md index af0965e8a0..11a5168d60 100644 --- a/docs/examples/1.1.x/client-android/java/account/create.md +++ b/docs/examples/1.1.x/client-android/java/account/create.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.create( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.create( + "[USER_ID]", + "email@example.com", + "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/delete-session.md b/docs/examples/1.1.x/client-android/java/account/delete-session.md index b42b841bd1..b3549c708b 100644 --- a/docs/examples/1.1.x/client-android/java/account/delete-session.md +++ b/docs/examples/1.1.x/client-android/java/account/delete-session.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.deleteSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.deleteSession( + "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/delete-sessions.md b/docs/examples/1.1.x/client-android/java/account/delete-sessions.md index 847c5c138e..153c323b56 100644 --- a/docs/examples/1.1.x/client-android/java/account/delete-sessions.md +++ b/docs/examples/1.1.x/client-android/java/account/delete-sessions.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.deleteSessions(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.deleteSessions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/get-prefs.md b/docs/examples/1.1.x/client-android/java/account/get-prefs.md index d7777d8b3b..25ab6c3951 100644 --- a/docs/examples/1.1.x/client-android/java/account/get-prefs.md +++ b/docs/examples/1.1.x/client-android/java/account/get-prefs.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.getPrefs(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.getPrefs(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/get-session.md b/docs/examples/1.1.x/client-android/java/account/get-session.md index b7861b2198..8d4c95aaf2 100644 --- a/docs/examples/1.1.x/client-android/java/account/get-session.md +++ b/docs/examples/1.1.x/client-android/java/account/get-session.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.getSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.getSession( + "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/get.md b/docs/examples/1.1.x/client-android/java/account/get.md index 13516525bf..146a5e501d 100644 --- a/docs/examples/1.1.x/client-android/java/account/get.md +++ b/docs/examples/1.1.x/client-android/java/account/get.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.get(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/list-logs.md b/docs/examples/1.1.x/client-android/java/account/list-logs.md index d073d4e416..f33c413938 100644 --- a/docs/examples/1.1.x/client-android/java/account/list-logs.md +++ b/docs/examples/1.1.x/client-android/java/account/list-logs.md @@ -1,20 +1,47 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.listLogs( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.listLogs( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/list-sessions.md b/docs/examples/1.1.x/client-android/java/account/list-sessions.md index 91888bcbbc..5933f0399c 100644 --- a/docs/examples/1.1.x/client-android/java/account/list-sessions.md +++ b/docs/examples/1.1.x/client-android/java/account/list-sessions.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.listSessions(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.listSessions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-email.md b/docs/examples/1.1.x/client-android/java/account/update-email.md index 53dd0bd529..56a1bc0206 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-email.md +++ b/docs/examples/1.1.x/client-android/java/account/update-email.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateEmail( - "email@example.com", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateEmail( + "email@example.com", + "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/client-android/java/account/update-magic-u-r-l-session.md index e56da73dbf..d0734e18ee 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-android/java/account/update-magic-u-r-l-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateMagicURLSession( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateMagicURLSession( + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-name.md b/docs/examples/1.1.x/client-android/java/account/update-name.md index c722c85412..9842a2216e 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-name.md +++ b/docs/examples/1.1.x/client-android/java/account/update-name.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateName( - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateName( + "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-password.md b/docs/examples/1.1.x/client-android/java/account/update-password.md index e16aac5095..468bdc21da 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-password.md +++ b/docs/examples/1.1.x/client-android/java/account/update-password.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePassword( - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePassword( + "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-phone-session.md b/docs/examples/1.1.x/client-android/java/account/update-phone-session.md index 952c7e06b1..f8d35c734c 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-phone-session.md +++ b/docs/examples/1.1.x/client-android/java/account/update-phone-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePhoneSession( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePhoneSession( + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-phone-verification.md b/docs/examples/1.1.x/client-android/java/account/update-phone-verification.md index ec5ddf161e..7aec064194 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-phone-verification.md +++ b/docs/examples/1.1.x/client-android/java/account/update-phone-verification.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePhoneVerification( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePhoneVerification( + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-phone.md b/docs/examples/1.1.x/client-android/java/account/update-phone.md index 61cff456d9..77492127de 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-phone.md +++ b/docs/examples/1.1.x/client-android/java/account/update-phone.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePhone( - "+12065550100", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePhone( + "+12065550100", + "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-prefs.md b/docs/examples/1.1.x/client-android/java/account/update-prefs.md index a004b451e3..9f94b8fe59 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-prefs.md +++ b/docs/examples/1.1.x/client-android/java/account/update-prefs.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePrefs( - mapOf( "a" to "b" ) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePrefs( + mapOf( "a" to "b" ) + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-recovery.md b/docs/examples/1.1.x/client-android/java/account/update-recovery.md index e565a6bf0b..bfcc89ed19 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-recovery.md +++ b/docs/examples/1.1.x/client-android/java/account/update-recovery.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateRecovery( - "[USER_ID]", - "[SECRET]", - "password", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateRecovery( + "[USER_ID]", + "[SECRET]", + "password", + "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-session.md b/docs/examples/1.1.x/client-android/java/account/update-session.md index 4c5d975b19..80aff11b98 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-session.md +++ b/docs/examples/1.1.x/client-android/java/account/update-session.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateSession( + "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-status.md b/docs/examples/1.1.x/client-android/java/account/update-status.md index 739469ad89..0ef6a6e1f8 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-status.md +++ b/docs/examples/1.1.x/client-android/java/account/update-status.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateStatus(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.updateStatus(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-verification.md b/docs/examples/1.1.x/client-android/java/account/update-verification.md index b05dbc2b29..8cf8d67363 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-verification.md +++ b/docs/examples/1.1.x/client-android/java/account/update-verification.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateVerification( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateVerification( + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-browser.md b/docs/examples/1.1.x/client-android/java/avatars/get-browser.md index 8ad3f18828..fa88749dff 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-browser.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-browser.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getBrowser( - "aa", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getBrowser( + "aa", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-credit-card.md b/docs/examples/1.1.x/client-android/java/avatars/get-credit-card.md index 453718b36e..2ddda86cce 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-credit-card.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getCreditCard( - "amex", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getCreditCard( + "amex", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-favicon.md b/docs/examples/1.1.x/client-android/java/avatars/get-favicon.md index a5b9fa6756..39c1432260 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-favicon.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-favicon.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getFavicon( - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getFavicon( + "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-flag.md b/docs/examples/1.1.x/client-android/java/avatars/get-flag.md index 0bc48963c8..77bf3b1b1f 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-flag.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-flag.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getFlag( - "af", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getFlag( + "af", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-image.md b/docs/examples/1.1.x/client-android/java/avatars/get-image.md index d77d79c2bb..69371da6d3 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-image.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-image.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getImage( - "https://example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getImage( + "https://example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-initials.md b/docs/examples/1.1.x/client-android/java/avatars/get-initials.md index 491724f019..eea5669c2c 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-initials.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-initials.md @@ -1,20 +1,47 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getInitials( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getInitials( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-q-r.md b/docs/examples/1.1.x/client-android/java/avatars/get-q-r.md index ae1a11df2f..e2c48cdded 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-q-r.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-q-r.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getQR( - "[TEXT]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getQR( + "[TEXT]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/create-document.md b/docs/examples/1.1.x/client-android/java/databases/create-document.md index d4412ce4e6..7fc322b8ca 100644 --- a/docs/examples/1.1.x/client-android/java/databases/create-document.md +++ b/docs/examples/1.1.x/client-android/java/databases/create-document.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.createDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - mapOf( "a" to "b" ), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.createDocument( + "[DATABASE_ID]", + "[COLLECTION_ID]", + "[DOCUMENT_ID]", + mapOf( "a" to "b" ), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/delete-document.md b/docs/examples/1.1.x/client-android/java/databases/delete-document.md index 90ad1cedb9..f42a09b498 100644 --- a/docs/examples/1.1.x/client-android/java/databases/delete-document.md +++ b/docs/examples/1.1.x/client-android/java/databases/delete-document.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.deleteDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.deleteDocument( + "[DATABASE_ID]", + "[COLLECTION_ID]", + "[DOCUMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/get-document.md b/docs/examples/1.1.x/client-android/java/databases/get-document.md index f4e7dc68cf..f1a4d449b4 100644 --- a/docs/examples/1.1.x/client-android/java/databases/get-document.md +++ b/docs/examples/1.1.x/client-android/java/databases/get-document.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.getDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.getDocument( + "[DATABASE_ID]", + "[COLLECTION_ID]", + "[DOCUMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/list-documents.md b/docs/examples/1.1.x/client-android/java/databases/list-documents.md index 6b897df50e..93d73336ec 100644 --- a/docs/examples/1.1.x/client-android/java/databases/list-documents.md +++ b/docs/examples/1.1.x/client-android/java/databases/list-documents.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.listDocuments( - "[DATABASE_ID]", - "[COLLECTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.listDocuments( + "[DATABASE_ID]", + "[COLLECTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/update-document.md b/docs/examples/1.1.x/client-android/java/databases/update-document.md index 7f04c8ed12..81e55d48f1 100644 --- a/docs/examples/1.1.x/client-android/java/databases/update-document.md +++ b/docs/examples/1.1.x/client-android/java/databases/update-document.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.updateDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.updateDocument( + "[DATABASE_ID]", + "[COLLECTION_ID]", + "[DOCUMENT_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/functions/create-execution.md b/docs/examples/1.1.x/client-android/java/functions/create-execution.md index ee4eaf5761..ea30faddf3 100644 --- a/docs/examples/1.1.x/client-android/java/functions/create-execution.md +++ b/docs/examples/1.1.x/client-android/java/functions/create-execution.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Functions functions = new Functions(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -functions.createExecution( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Functions functions = new Functions(client); + + functions.createExecution( + "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/functions/get-execution.md b/docs/examples/1.1.x/client-android/java/functions/get-execution.md index 90153f5f40..2f4e57edce 100644 --- a/docs/examples/1.1.x/client-android/java/functions/get-execution.md +++ b/docs/examples/1.1.x/client-android/java/functions/get-execution.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Functions functions = new Functions(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -functions.getExecution( - "[FUNCTION_ID]", - "[EXECUTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Functions functions = new Functions(client); + + functions.getExecution( + "[FUNCTION_ID]", + "[EXECUTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/functions/list-executions.md b/docs/examples/1.1.x/client-android/java/functions/list-executions.md index fca903b1d3..68f767db9c 100644 --- a/docs/examples/1.1.x/client-android/java/functions/list-executions.md +++ b/docs/examples/1.1.x/client-android/java/functions/list-executions.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Functions functions = new Functions(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -functions.listExecutions( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Functions functions = new Functions(client); + + functions.listExecutions( + "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/get.md b/docs/examples/1.1.x/client-android/java/locale/get.md index 89de3696f6..417fc16f23 100644 --- a/docs/examples/1.1.x/client-android/java/locale/get.md +++ b/docs/examples/1.1.x/client-android/java/locale/get.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.get(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-continents.md b/docs/examples/1.1.x/client-android/java/locale/list-continents.md index 7205ad6444..970f066d51 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-continents.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-continents.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listContinents(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listContinents(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-countries-e-u.md b/docs/examples/1.1.x/client-android/java/locale/list-countries-e-u.md index d6f37be680..b2d0b29b6a 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-countries-e-u.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listCountriesEU(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-countries-phones.md b/docs/examples/1.1.x/client-android/java/locale/list-countries-phones.md index 1f947fe372..ed4d1f4f84 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-countries-phones.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listCountriesPhones(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-countries.md b/docs/examples/1.1.x/client-android/java/locale/list-countries.md index 5b8c0ba122..cb4000f464 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-countries.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-countries.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listCountries(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listCountries(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-currencies.md b/docs/examples/1.1.x/client-android/java/locale/list-currencies.md index 880e1b2e25..5423698276 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-currencies.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-currencies.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listCurrencies(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listCurrencies(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-languages.md b/docs/examples/1.1.x/client-android/java/locale/list-languages.md index 318c6dc6e7..158c0e5722 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-languages.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-languages.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listLanguages(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listLanguages(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/create-file.md b/docs/examples/1.1.x/client-android/java/storage/create-file.md index 161f882886..32e0fd09f2 100644 --- a/docs/examples/1.1.x/client-android/java/storage/create-file.md +++ b/docs/examples/1.1.x/client-android/java/storage/create-file.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.models.InputFile; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.models.InputFile +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.createFile( - "[BUCKET_ID]", - "[FILE_ID]", - InputFile.fromPath("file.png"), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.createFile( + "[BUCKET_ID]", + "[FILE_ID]", + InputFile.fromPath("file.png"), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/delete-file.md b/docs/examples/1.1.x/client-android/java/storage/delete-file.md index 654c12735f..585593a8cb 100644 --- a/docs/examples/1.1.x/client-android/java/storage/delete-file.md +++ b/docs/examples/1.1.x/client-android/java/storage/delete-file.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.deleteFile( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.deleteFile( + "[BUCKET_ID]", + "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/get-file-download.md b/docs/examples/1.1.x/client-android/java/storage/get-file-download.md index f12302a31b..b16224804a 100644 --- a/docs/examples/1.1.x/client-android/java/storage/get-file-download.md +++ b/docs/examples/1.1.x/client-android/java/storage/get-file-download.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.getFileDownload( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.getFileDownload( + "[BUCKET_ID]", + "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/get-file-preview.md b/docs/examples/1.1.x/client-android/java/storage/get-file-preview.md index 8487922189..583c1a0a3c 100644 --- a/docs/examples/1.1.x/client-android/java/storage/get-file-preview.md +++ b/docs/examples/1.1.x/client-android/java/storage/get-file-preview.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.getFilePreview( - "[BUCKET_ID]", - "[FILE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.getFilePreview( + "[BUCKET_ID]", + "[FILE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/get-file-view.md b/docs/examples/1.1.x/client-android/java/storage/get-file-view.md index 825b538d6b..21a5074aca 100644 --- a/docs/examples/1.1.x/client-android/java/storage/get-file-view.md +++ b/docs/examples/1.1.x/client-android/java/storage/get-file-view.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.getFileView( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.getFileView( + "[BUCKET_ID]", + "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/get-file.md b/docs/examples/1.1.x/client-android/java/storage/get-file.md index bf9792216f..61740a9a46 100644 --- a/docs/examples/1.1.x/client-android/java/storage/get-file.md +++ b/docs/examples/1.1.x/client-android/java/storage/get-file.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.getFile( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.getFile( + "[BUCKET_ID]", + "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/list-files.md b/docs/examples/1.1.x/client-android/java/storage/list-files.md index fdf3e4fe80..a7ea06ec5b 100644 --- a/docs/examples/1.1.x/client-android/java/storage/list-files.md +++ b/docs/examples/1.1.x/client-android/java/storage/list-files.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.listFiles( - "[BUCKET_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.listFiles( + "[BUCKET_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/update-file.md b/docs/examples/1.1.x/client-android/java/storage/update-file.md index 9d9f1928be..b3e8e904ef 100644 --- a/docs/examples/1.1.x/client-android/java/storage/update-file.md +++ b/docs/examples/1.1.x/client-android/java/storage/update-file.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.updateFile( - "[BUCKET_ID]", - "[FILE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.updateFile( + "[BUCKET_ID]", + "[FILE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/create-membership.md b/docs/examples/1.1.x/client-android/java/teams/create-membership.md index 9d567d6443..f4d96de575 100644 --- a/docs/examples/1.1.x/client-android/java/teams/create-membership.md +++ b/docs/examples/1.1.x/client-android/java/teams/create-membership.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.createMembership( - "[TEAM_ID]", - "email@example.com", - listOf(), - "https://example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.createMembership( + "[TEAM_ID]", + "email@example.com", + listOf(), + "https://example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/create.md b/docs/examples/1.1.x/client-android/java/teams/create.md index 52207c64d1..3723b30b03 100644 --- a/docs/examples/1.1.x/client-android/java/teams/create.md +++ b/docs/examples/1.1.x/client-android/java/teams/create.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.create( - "[TEAM_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.create( + "[TEAM_ID]", + "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/delete-membership.md b/docs/examples/1.1.x/client-android/java/teams/delete-membership.md index 92d6d377f5..98cb29ac75 100644 --- a/docs/examples/1.1.x/client-android/java/teams/delete-membership.md +++ b/docs/examples/1.1.x/client-android/java/teams/delete-membership.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.deleteMembership( - "[TEAM_ID]", - "[MEMBERSHIP_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.deleteMembership( + "[TEAM_ID]", + "[MEMBERSHIP_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/delete.md b/docs/examples/1.1.x/client-android/java/teams/delete.md index ed811951e0..828b457217 100644 --- a/docs/examples/1.1.x/client-android/java/teams/delete.md +++ b/docs/examples/1.1.x/client-android/java/teams/delete.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.delete( - "[TEAM_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.delete( + "[TEAM_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/get-membership.md b/docs/examples/1.1.x/client-android/java/teams/get-membership.md index 7e291715be..87c0160bf1 100644 --- a/docs/examples/1.1.x/client-android/java/teams/get-membership.md +++ b/docs/examples/1.1.x/client-android/java/teams/get-membership.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.getMembership( - "[TEAM_ID]", - "[MEMBERSHIP_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.getMembership( + "[TEAM_ID]", + "[MEMBERSHIP_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/get.md b/docs/examples/1.1.x/client-android/java/teams/get.md index 36063c5b6b..53ba33c4ca 100644 --- a/docs/examples/1.1.x/client-android/java/teams/get.md +++ b/docs/examples/1.1.x/client-android/java/teams/get.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.get( - "[TEAM_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.get( + "[TEAM_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/list-memberships.md b/docs/examples/1.1.x/client-android/java/teams/list-memberships.md index d195978b18..c53493d954 100644 --- a/docs/examples/1.1.x/client-android/java/teams/list-memberships.md +++ b/docs/examples/1.1.x/client-android/java/teams/list-memberships.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.listMemberships( - "[TEAM_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.listMemberships( + "[TEAM_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/list.md b/docs/examples/1.1.x/client-android/java/teams/list.md index b4998ffd49..61c2aa3f8e 100644 --- a/docs/examples/1.1.x/client-android/java/teams/list.md +++ b/docs/examples/1.1.x/client-android/java/teams/list.md @@ -1,20 +1,47 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/update-membership-roles.md b/docs/examples/1.1.x/client-android/java/teams/update-membership-roles.md index 680c9a3d56..ef6c67307e 100644 --- a/docs/examples/1.1.x/client-android/java/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/client-android/java/teams/update-membership-roles.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.updateMembershipRoles( - "[TEAM_ID]", - "[MEMBERSHIP_ID]", - listOf() - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.updateMembershipRoles( + "[TEAM_ID]", + "[MEMBERSHIP_ID]", + listOf() + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/update-membership-status.md b/docs/examples/1.1.x/client-android/java/teams/update-membership-status.md index 1015b2ead6..447d0da2c9 100644 --- a/docs/examples/1.1.x/client-android/java/teams/update-membership-status.md +++ b/docs/examples/1.1.x/client-android/java/teams/update-membership-status.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.updateMembershipStatus( - "[TEAM_ID]", - "[MEMBERSHIP_ID]", - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.updateMembershipStatus( + "[TEAM_ID]", + "[MEMBERSHIP_ID]", + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/update.md b/docs/examples/1.1.x/client-android/java/teams/update.md index 86d6a3f8dc..b4df429a07 100644 --- a/docs/examples/1.1.x/client-android/java/teams/update.md +++ b/docs/examples/1.1.x/client-android/java/teams/update.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.update( - "[TEAM_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.update( + "[TEAM_ID]", + "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-anonymous-session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-anonymous-session.md index ccefc0a055..5fa06994fb 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-anonymous-session.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createAnonymousSession() + val account = Account(client) + + GlobalScope.launch { + val response = account.createAnonymousSession() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-email-session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-email-session.md index c58799c15d..5dcec231b1 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-email-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-email-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createEmailSession( - email = "email@example.com", - password = "password" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createEmailSession( + email = "email@example.com", + password = "password" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-j-w-t.md b/docs/examples/1.1.x/client-android/kotlin/account/create-j-w-t.md index 59b73985a3..212838b7fd 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-j-w-t.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-j-w-t.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createJWT() + val account = Account(client) + + GlobalScope.launch { + val response = account.createJWT() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-magic-u-r-l-session.md index 5f36940107..15fa1c7a9f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-magic-u-r-l-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createMagicURLSession( - userId = "[USER_ID]", - email = "email@example.com", -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createMagicURLSession( + userId = "[USER_ID]", + email = "email@example.com", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-o-auth2session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-o-auth2session.md index f909b596b3..baf993069a 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-o-auth2session.md @@ -1,12 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -account.createOAuth2Session( - provider = "amazon", -) + val account = Account(client) + + GlobalScope.launch { + account.createOAuth2Session( + activity = this@MainActivity, + provider = "amazon", + ) + + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-phone-session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-phone-session.md index 8f63c64e5b..d71c1d336f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-phone-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-phone-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createPhoneSession( - userId = "[USER_ID]", - phone = "+12065550100" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createPhoneSession( + userId = "[USER_ID]", + phone = "+12065550100" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-phone-verification.md b/docs/examples/1.1.x/client-android/kotlin/account/create-phone-verification.md index af36502534..ab0eccfb54 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-phone-verification.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-phone-verification.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createPhoneVerification() + val account = Account(client) + + GlobalScope.launch { + val response = account.createPhoneVerification() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-recovery.md b/docs/examples/1.1.x/client-android/kotlin/account/create-recovery.md index 23a3424836..2c1e7597b9 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-recovery.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-recovery.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createRecovery( - email = "email@example.com", - url = "https://example.com" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createRecovery( + email = "email@example.com", + url = "https://example.com" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-verification.md b/docs/examples/1.1.x/client-android/kotlin/account/create-verification.md index 3fed01ba1f..1ebddee5cf 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-verification.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-verification.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createVerification( - url = "https://example.com" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createVerification( + url = "https://example.com" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create.md b/docs/examples/1.1.x/client-android/kotlin/account/create.md index 2a55fb1641..ab2534f1db 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.create( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val account = Account(client) + + GlobalScope.launch { + val response = account.create( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/delete-session.md b/docs/examples/1.1.x/client-android/kotlin/account/delete-session.md index 5c8988f40f..e670623490 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/delete-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/delete-session.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.deleteSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.deleteSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/delete-sessions.md b/docs/examples/1.1.x/client-android/kotlin/account/delete-sessions.md index 86c9bc96ca..ec30efdb8f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/delete-sessions.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/delete-sessions.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.deleteSessions() + val account = Account(client) + + GlobalScope.launch { + val response = account.deleteSessions() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/get-prefs.md b/docs/examples/1.1.x/client-android/kotlin/account/get-prefs.md index 70fa29176c..9378cd2456 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/get-prefs.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/get-prefs.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.getPrefs() + val account = Account(client) + + GlobalScope.launch { + val response = account.getPrefs() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/get-session.md b/docs/examples/1.1.x/client-android/kotlin/account/get-session.md index 58248aed39..45f00b69fc 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/get-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/get-session.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.getSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.getSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/get.md b/docs/examples/1.1.x/client-android/kotlin/account/get.md index 09b0a17f19..c4c81a20aa 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/get.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/get.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.get() + val account = Account(client) + + GlobalScope.launch { + val response = account.get() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/list-logs.md b/docs/examples/1.1.x/client-android/kotlin/account/list-logs.md index dda9c721fe..397906b921 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/list-logs.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/list-logs.md @@ -1,11 +1,25 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.listLogs( -) + val account = Account(client) + + GlobalScope.launch { + val response = account.listLogs( + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/list-sessions.md b/docs/examples/1.1.x/client-android/kotlin/account/list-sessions.md index b7bb447b2d..0a0bc73ebc 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/list-sessions.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/list-sessions.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.listSessions() + val account = Account(client) + + GlobalScope.launch { + val response = account.listSessions() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-email.md b/docs/examples/1.1.x/client-android/kotlin/account/update-email.md index 2d1b66bdc0..a9ec88b8a4 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-email.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-email.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateEmail( - email = "email@example.com", - password = "password" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateEmail( + email = "email@example.com", + password = "password" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/client-android/kotlin/account/update-magic-u-r-l-session.md index 49af2177b6..3fe1b7c26e 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-magic-u-r-l-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateMagicURLSession( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateMagicURLSession( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-name.md b/docs/examples/1.1.x/client-android/kotlin/account/update-name.md index 5799344941..ce9d8a368f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-name.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-name.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateName( - name = "[NAME]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateName( + name = "[NAME]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-password.md b/docs/examples/1.1.x/client-android/kotlin/account/update-password.md index cdf8178441..edee78eab9 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-password.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-password.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePassword( - password = "password", -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePassword( + password = "password", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-phone-session.md b/docs/examples/1.1.x/client-android/kotlin/account/update-phone-session.md index 6efa2a4edb..c981991720 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-phone-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-phone-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePhoneSession( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePhoneSession( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-phone-verification.md b/docs/examples/1.1.x/client-android/kotlin/account/update-phone-verification.md index 1b90372faf..aa5eea3425 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-phone-verification.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-phone-verification.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePhoneVerification( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePhoneVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-phone.md b/docs/examples/1.1.x/client-android/kotlin/account/update-phone.md index 0534220eaa..72e612fa8b 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-phone.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-phone.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePhone( - phone = "+12065550100", - password = "password" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePhone( + phone = "+12065550100", + password = "password" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-prefs.md b/docs/examples/1.1.x/client-android/kotlin/account/update-prefs.md index 408988b28b..3059bc8196 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-prefs.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-prefs.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePrefs( - prefs = mapOf( "a" to "b" ) -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePrefs( + prefs = mapOf( "a" to "b" ) + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-recovery.md b/docs/examples/1.1.x/client-android/kotlin/account/update-recovery.md index fd28f6e600..81c00b4f26 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-recovery.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-recovery.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateRecovery( - userId = "[USER_ID]", - secret = "[SECRET]", - password = "password", - passwordAgain = "password" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateRecovery( + userId = "[USER_ID]", + secret = "[SECRET]", + password = "password", + passwordAgain = "password" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-session.md b/docs/examples/1.1.x/client-android/kotlin/account/update-session.md index 67d900e047..465320d097 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-session.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-status.md b/docs/examples/1.1.x/client-android/kotlin/account/update-status.md index 35a4027fc2..e138751287 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-status.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-status.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateStatus() + val account = Account(client) + + GlobalScope.launch { + val response = account.updateStatus() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-verification.md b/docs/examples/1.1.x/client-android/kotlin/account/update-verification.md index f87192e2f3..cea2592a73 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-verification.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-verification.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateVerification( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-browser.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-browser.md index 9ea67395b3..95a2201d6a 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-browser.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-browser.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getBrowser( - code = "aa", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getBrowser( + code = "aa", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-credit-card.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-credit-card.md index cf82474c17..7507c40c5c 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-credit-card.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getCreditCard( - code = "amex", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getCreditCard( + code = "amex", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-favicon.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-favicon.md index 102d7731b8..f8e2b400a8 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-favicon.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-favicon.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getFavicon( - url = "https://example.com" -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getFavicon( + url = "https://example.com" + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-flag.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-flag.md index 7a618a78d7..738ec8a91f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-flag.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-flag.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getFlag( - code = "af", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getFlag( + code = "af", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-image.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-image.md index fc1fe1d418..25171b1447 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-image.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-image.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getImage( - url = "https://example.com", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getImage( + url = "https://example.com", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-initials.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-initials.md index 448467e94f..e53a647b09 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-initials.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-initials.md @@ -1,11 +1,25 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getInitials( -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getInitials( + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-q-r.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-q-r.md index 8d24934b25..c9d60ea9c7 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-q-r.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-q-r.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getQR( - text = "[TEXT]", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getQR( + text = "[TEXT]", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/create-document.md b/docs/examples/1.1.x/client-android/kotlin/databases/create-document.md index da4d1eba8d..8a755a265b 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/create-document.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/create-document.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.createDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.createDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + data = mapOf( "a" to "b" ), + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/delete-document.md b/docs/examples/1.1.x/client-android/kotlin/databases/delete-document.md index bb2193ebe1..f56293b880 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/delete-document.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/delete-document.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.deleteDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.deleteDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/get-document.md b/docs/examples/1.1.x/client-android/kotlin/databases/get-document.md index b81f3404ac..1f5bf29b10 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/get-document.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/get-document.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.getDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.getDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/list-documents.md b/docs/examples/1.1.x/client-android/kotlin/databases/list-documents.md index 0c2be1ade2..5277b46a01 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/list-documents.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/list-documents.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.listDocuments( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.listDocuments( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/update-document.md b/docs/examples/1.1.x/client-android/kotlin/databases/update-document.md index 68cc42ee37..7807f5218f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/update-document.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/update-document.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.updateDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.updateDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/functions/create-execution.md b/docs/examples/1.1.x/client-android/kotlin/functions/create-execution.md index b064201dbd..3a7e599f8c 100644 --- a/docs/examples/1.1.x/client-android/kotlin/functions/create-execution.md +++ b/docs/examples/1.1.x/client-android/kotlin/functions/create-execution.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val functions = Functions(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = functions.createExecution( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + + GlobalScope.launch { + val response = functions.createExecution( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/functions/get-execution.md b/docs/examples/1.1.x/client-android/kotlin/functions/get-execution.md index 2f9d5ef776..781f26c743 100644 --- a/docs/examples/1.1.x/client-android/kotlin/functions/get-execution.md +++ b/docs/examples/1.1.x/client-android/kotlin/functions/get-execution.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val functions = Functions(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = functions.getExecution( - functionId = "[FUNCTION_ID]", - executionId = "[EXECUTION_ID]" -) + val functions = Functions(client) + + GlobalScope.launch { + val response = functions.getExecution( + functionId = "[FUNCTION_ID]", + executionId = "[EXECUTION_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/functions/list-executions.md b/docs/examples/1.1.x/client-android/kotlin/functions/list-executions.md index d8a1aa1057..4f11574f0d 100644 --- a/docs/examples/1.1.x/client-android/kotlin/functions/list-executions.md +++ b/docs/examples/1.1.x/client-android/kotlin/functions/list-executions.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val functions = Functions(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = functions.listExecutions( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + + GlobalScope.launch { + val response = functions.listExecutions( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/get.md b/docs/examples/1.1.x/client-android/kotlin/locale/get.md index da6b040309..f89c66a7ed 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/get.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/get.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.get() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.get() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-continents.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-continents.md index 8836a6c17a..b582b40114 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-continents.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-continents.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listContinents() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listContinents() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-e-u.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-e-u.md index 051c1910d0..133da97f4b 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-e-u.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listCountriesEU() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listCountriesEU() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-phones.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-phones.md index c6efaaea79..7f17f47b7f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-phones.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listCountriesPhones() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listCountriesPhones() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries.md index 4e2eeeffdb..1d83452953 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listCountries() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listCountries() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-currencies.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-currencies.md index f565be6836..657652f3a0 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-currencies.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-currencies.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listCurrencies() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listCurrencies() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-languages.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-languages.md index 284f5ba803..bdf023ef9b 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-languages.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-languages.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listLanguages() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listLanguages() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/create-file.md b/docs/examples/1.1.x/client-android/kotlin/storage/create-file.md index fd52716182..d3d7c608e4 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/create-file.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/create-file.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.models.InputFile import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.createFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", - file = InputFile.fromPath("file.png"), -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.createFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + file = InputFile.fromPath("file.png"), + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/delete-file.md b/docs/examples/1.1.x/client-android/kotlin/storage/delete-file.md index 945e1b9720..1a4a5b9da1 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/delete-file.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/delete-file.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.deleteFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.deleteFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-download.md b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-download.md index b5fde879c0..3970fb8245 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-download.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-download.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = storage.getFileDownload( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + + GlobalScope.launch { + val result = storage.getFileDownload( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-preview.md b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-preview.md index ea7d8d4e90..780452729e 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-preview.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-preview.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = storage.getFilePreview( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", -) + val storage = Storage(client) + + GlobalScope.launch { + val result = storage.getFilePreview( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-view.md b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-view.md index c266fca1bc..107ad45679 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-view.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-view.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = storage.getFileView( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + + GlobalScope.launch { + val result = storage.getFileView( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/get-file.md b/docs/examples/1.1.x/client-android/kotlin/storage/get-file.md index 73fd9a8c44..30f640ba35 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/get-file.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/get-file.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.getFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.getFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/list-files.md b/docs/examples/1.1.x/client-android/kotlin/storage/list-files.md index f915e5ae31..20a253ab07 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/list-files.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/list-files.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.listFiles( - bucketId = "[BUCKET_ID]", -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.listFiles( + bucketId = "[BUCKET_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/update-file.md b/docs/examples/1.1.x/client-android/kotlin/storage/update-file.md index 23ce52a822..35b1afb939 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/update-file.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/update-file.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.updateFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.updateFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/create-membership.md b/docs/examples/1.1.x/client-android/kotlin/teams/create-membership.md index 60d39c037c..e2b7d16bfc 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/create-membership.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/create-membership.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.createMembership( - teamId = "[TEAM_ID]", - email = "email@example.com", - roles = listOf(), - url = "https://example.com", -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.createMembership( + teamId = "[TEAM_ID]", + email = "email@example.com", + roles = listOf(), + url = "https://example.com", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/create.md b/docs/examples/1.1.x/client-android/kotlin/teams/create.md index 26bef655e9..73857b80bb 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/create.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/create.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.create( - teamId = "[TEAM_ID]", - name = "[NAME]", -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.create( + teamId = "[TEAM_ID]", + name = "[NAME]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/delete-membership.md b/docs/examples/1.1.x/client-android/kotlin/teams/delete-membership.md index ac1b37a3c7..6545af5de7 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/delete-membership.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/delete-membership.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.deleteMembership( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.deleteMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/delete.md b/docs/examples/1.1.x/client-android/kotlin/teams/delete.md index c5bcd372e0..de12449562 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/delete.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/delete.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.delete( - teamId = "[TEAM_ID]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.delete( + teamId = "[TEAM_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/get-membership.md b/docs/examples/1.1.x/client-android/kotlin/teams/get-membership.md index 1ee6ec0c75..aa3f29e74d 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/get-membership.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/get-membership.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.getMembership( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.getMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/get.md b/docs/examples/1.1.x/client-android/kotlin/teams/get.md index 557e998942..54550b3ed6 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/get.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/get.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.get( - teamId = "[TEAM_ID]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.get( + teamId = "[TEAM_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/list-memberships.md b/docs/examples/1.1.x/client-android/kotlin/teams/list-memberships.md index d7f2920683..32ef3bd823 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/list-memberships.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/list-memberships.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.listMemberships( - teamId = "[TEAM_ID]", -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.listMemberships( + teamId = "[TEAM_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/list.md b/docs/examples/1.1.x/client-android/kotlin/teams/list.md index f056d33d81..6444205472 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/list.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/list.md @@ -1,11 +1,25 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.list( -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.list( + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-roles.md b/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-roles.md index 5727e111e1..d9a8a41895 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-roles.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.updateMembershipRoles( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]", - roles = listOf() -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.updateMembershipRoles( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + roles = listOf() + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-status.md b/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-status.md index a36b7100fe..f8e10fdafc 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-status.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-status.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.updateMembershipStatus( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]", - userId = "[USER_ID]", - secret = "[SECRET]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.updateMembershipStatus( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/update.md b/docs/examples/1.1.x/client-android/kotlin/teams/update.md index 1a54434fd0..59dd69f081 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/update.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/update.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.update( - teamId = "[TEAM_ID]", - name = "[NAME]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.update( + teamId = "[TEAM_ID]", + name = "[NAME]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-anonymous-session.md b/docs/examples/1.1.x/client-apple/examples/account/create-anonymous-session.md index 866786858d..d2d71b9f00 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-anonymous-session.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.createAnonymousSession() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.createAnonymousSession() + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-email-session.md b/docs/examples/1.1.x/client-apple/examples/account/create-email-session.md index 9535bd3f39..e8e52ed637 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-email-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-email-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.createEmailSession( - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.createEmailSession( + email: "email@example.com", + password: "password" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-j-w-t.md b/docs/examples/1.1.x/client-apple/examples/account/create-j-w-t.md index 5a8ae637a9..51952f9953 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-j-w-t.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-j-w-t.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let jwt = try await account.createJWT() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let jwt = try await account.createJWT() + print(String(describing: jwt) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/client-apple/examples/account/create-magic-u-r-l-session.md index ad342dc2d4..3eab67aac4 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-magic-u-r-l-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createMagicURLSession( - userId: "[USER_ID]", - email: "email@example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createMagicURLSession( + userId: "[USER_ID]", + email: "email@example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-o-auth2session.md b/docs/examples/1.1.x/client-apple/examples/account/create-o-auth2session.md index 44b9229ae5..ddd7eb28a4 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-o-auth2session.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let success = try await account.createOAuth2Session( - provider: "amazon" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let success = try await account.createOAuth2Session( + provider: "amazon" + ) + print(String(describing: success) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-phone-session.md b/docs/examples/1.1.x/client-apple/examples/account/create-phone-session.md index c6b9f41c46..8b1dffa030 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-phone-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-phone-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createPhoneSession( - userId: "[USER_ID]", - phone: "+12065550100" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createPhoneSession( + userId: "[USER_ID]", + phone: "+12065550100" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-phone-verification.md b/docs/examples/1.1.x/client-apple/examples/account/create-phone-verification.md index 08a6367d8e..1033795be1 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-phone-verification.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-phone-verification.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createPhoneVerification() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createPhoneVerification() + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-recovery.md b/docs/examples/1.1.x/client-apple/examples/account/create-recovery.md index a946bfdde5..1f2d9b9e05 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-recovery.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-recovery.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createRecovery( - email: "email@example.com", - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createRecovery( + email: "email@example.com", + url: "https://example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-verification.md b/docs/examples/1.1.x/client-apple/examples/account/create-verification.md index 6ce12ba9a5..cd0f9d5c87 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-verification.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-verification.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createVerification( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createVerification( + url: "https://example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create.md b/docs/examples/1.1.x/client-apple/examples/account/create.md index 1031c8f3b3..bd6e152e53 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.create( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.create( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/delete-session.md b/docs/examples/1.1.x/client-apple/examples/account/delete-session.md index 3040b28a41..6f3dd76905 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/delete-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/delete-session.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let result = try await account.deleteSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let result = try await account.deleteSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/delete-sessions.md b/docs/examples/1.1.x/client-apple/examples/account/delete-sessions.md index e46d607fd5..f2721be95e 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/delete-sessions.md +++ b/docs/examples/1.1.x/client-apple/examples/account/delete-sessions.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let result = try await account.deleteSessions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let result = try await account.deleteSessions() + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/get-prefs.md b/docs/examples/1.1.x/client-apple/examples/account/get-prefs.md index 93c17c0d8b..6fb47ce31f 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/get-prefs.md +++ b/docs/examples/1.1.x/client-apple/examples/account/get-prefs.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let preferences = try await account.getPrefs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let preferences = try await account.getPrefs() + print(String(describing: preferences) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/get-session.md b/docs/examples/1.1.x/client-apple/examples/account/get-session.md index c291d10375..fa15d6d222 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/get-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/get-session.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.getSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.getSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/get.md b/docs/examples/1.1.x/client-apple/examples/account/get.md index f1c84ab8e9..09fd44655f 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/get.md +++ b/docs/examples/1.1.x/client-apple/examples/account/get.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.get() + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/list-logs.md b/docs/examples/1.1.x/client-apple/examples/account/list-logs.md index 830524e254..882df254ab 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/list-logs.md +++ b/docs/examples/1.1.x/client-apple/examples/account/list-logs.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let logList = try await account.listLogs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let logList = try await account.listLogs() + print(String(describing: logList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/list-sessions.md b/docs/examples/1.1.x/client-apple/examples/account/list-sessions.md index 4f7957adb8..1583fa43fd 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/list-sessions.md +++ b/docs/examples/1.1.x/client-apple/examples/account/list-sessions.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let sessionList = try await account.listSessions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let sessionList = try await account.listSessions() + print(String(describing: sessionList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-email.md b/docs/examples/1.1.x/client-apple/examples/account/update-email.md index 8355aad529..67e1275783 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-email.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-email.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updateEmail( - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updateEmail( + email: "email@example.com", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/client-apple/examples/account/update-magic-u-r-l-session.md index e522009087..34bfab9e80 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-magic-u-r-l-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.updateMagicURLSession( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.updateMagicURLSession( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-name.md b/docs/examples/1.1.x/client-apple/examples/account/update-name.md index c8e2a314e6..0ceff078a6 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-name.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-name.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updateName( - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updateName( + name: "[NAME]" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-password.md b/docs/examples/1.1.x/client-apple/examples/account/update-password.md index a3fe5703a1..a94bb2c3e6 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-password.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-password.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updatePassword( - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updatePassword( + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-phone-session.md b/docs/examples/1.1.x/client-apple/examples/account/update-phone-session.md index 125c68a00d..21d018ea2a 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-phone-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-phone-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.updatePhoneSession( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.updatePhoneSession( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-phone-verification.md b/docs/examples/1.1.x/client-apple/examples/account/update-phone-verification.md index e3e7bbf022..f148346920 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-phone-verification.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-phone-verification.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.updatePhoneVerification( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.updatePhoneVerification( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-phone.md b/docs/examples/1.1.x/client-apple/examples/account/update-phone.md index d56b7557b8..8f47342b25 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-phone.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-phone.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updatePhone( - phone: "+12065550100", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updatePhone( + phone: "+12065550100", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-prefs.md b/docs/examples/1.1.x/client-apple/examples/account/update-prefs.md index 53ef8add5f..ebccea57b3 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-prefs.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-prefs.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updatePrefs( - prefs: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updatePrefs( + prefs: [:] + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-recovery.md b/docs/examples/1.1.x/client-apple/examples/account/update-recovery.md index faec91819c..f412c0f35a 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-recovery.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-recovery.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.updateRecovery( - userId: "[USER_ID]", - secret: "[SECRET]", - password: "password", - passwordAgain: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.updateRecovery( + userId: "[USER_ID]", + secret: "[SECRET]", + password: "password", + passwordAgain: "password" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-session.md b/docs/examples/1.1.x/client-apple/examples/account/update-session.md index 712f3055a9..1d9282641c 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-session.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.updateSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.updateSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-status.md b/docs/examples/1.1.x/client-apple/examples/account/update-status.md index df5dd6747e..172eae0478 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-status.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-status.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updateStatus() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updateStatus() + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-verification.md b/docs/examples/1.1.x/client-apple/examples/account/update-verification.md index 15f936799d..10e46b19d1 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-verification.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-verification.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.updateVerification( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.updateVerification( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-browser.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-browser.md index a76a736e6f..536d9b6167 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-browser.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-browser.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getBrowser( - code: "aa" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getBrowser( + code: "aa" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-credit-card.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-credit-card.md index 7bcae6512b..7dff9411d0 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-credit-card.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getCreditCard( - code: "amex" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getCreditCard( + code: "amex" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-favicon.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-favicon.md index f0290354fa..1e2afab969 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-favicon.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-favicon.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getFavicon( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getFavicon( + url: "https://example.com" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-flag.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-flag.md index ceb3fe7ee3..43035a3530 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-flag.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-flag.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getFlag( - code: "af" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getFlag( + code: "af" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-image.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-image.md index e69ac106fd..a28299c153 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-image.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-image.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getImage( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getImage( + url: "https://example.com" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-initials.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-initials.md index 98086ca581..df22100428 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-initials.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-initials.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getInitials() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getInitials() + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-q-r.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-q-r.md index c03754442a..a9e3e9bae1 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-q-r.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-q-r.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getQR( - text: "[TEXT]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getQR( + text: "[TEXT]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/create-document.md b/docs/examples/1.1.x/client-apple/examples/databases/create-document.md index efe8ca0e14..e97fa29bbe 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/create-document.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/create-document.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let document = try await databases.createDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]", - data: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let document = try await databases.createDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]", + data: [:] + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/delete-document.md b/docs/examples/1.1.x/client-apple/examples/databases/delete-document.md index 37b06a4abb..b8fec29238 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/delete-document.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/delete-document.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let result = try await databases.deleteDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let result = try await databases.deleteDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/get-document.md b/docs/examples/1.1.x/client-apple/examples/databases/get-document.md index ec9a78cff6..8d8999dde9 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/get-document.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/get-document.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let document = try await databases.getDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let document = try await databases.getDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/list-documents.md b/docs/examples/1.1.x/client-apple/examples/databases/list-documents.md index 75e97b0cdc..3468cf8fc3 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/list-documents.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/list-documents.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let documentList = try await databases.listDocuments( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let documentList = try await databases.listDocuments( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: documentList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/update-document.md b/docs/examples/1.1.x/client-apple/examples/databases/update-document.md index 2aa6bfd36e..5f88a6253b 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/update-document.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/update-document.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let document = try await databases.updateDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let document = try await databases.updateDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/client-apple/examples/functions/create-execution.md b/docs/examples/1.1.x/client-apple/examples/functions/create-execution.md index 768b3a651e..f086125c35 100644 --- a/docs/examples/1.1.x/client-apple/examples/functions/create-execution.md +++ b/docs/examples/1.1.x/client-apple/examples/functions/create-execution.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let functions = Functions(client) - -let execution = try await functions.createExecution( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let functions = Functions(client) + let execution = try await functions.createExecution( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: execution) +} diff --git a/docs/examples/1.1.x/client-apple/examples/functions/get-execution.md b/docs/examples/1.1.x/client-apple/examples/functions/get-execution.md index cad2cd18f0..503c7f5412 100644 --- a/docs/examples/1.1.x/client-apple/examples/functions/get-execution.md +++ b/docs/examples/1.1.x/client-apple/examples/functions/get-execution.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let functions = Functions(client) - -let execution = try await functions.getExecution( - functionId: "[FUNCTION_ID]", - executionId: "[EXECUTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let functions = Functions(client) + let execution = try await functions.getExecution( + functionId: "[FUNCTION_ID]", + executionId: "[EXECUTION_ID]" + ) + print(String(describing: execution) +} diff --git a/docs/examples/1.1.x/client-apple/examples/functions/list-executions.md b/docs/examples/1.1.x/client-apple/examples/functions/list-executions.md index b3d2de15b6..45da8ee7a2 100644 --- a/docs/examples/1.1.x/client-apple/examples/functions/list-executions.md +++ b/docs/examples/1.1.x/client-apple/examples/functions/list-executions.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let functions = Functions(client) - -let executionList = try await functions.listExecutions( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let functions = Functions(client) + let executionList = try await functions.listExecutions( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: executionList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/get.md b/docs/examples/1.1.x/client-apple/examples/locale/get.md index 4c72036a6a..2b6101c5ed 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/get.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/get.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let locale = try await locale.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let locale = try await locale.get() + print(String(describing: locale) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-continents.md b/docs/examples/1.1.x/client-apple/examples/locale/list-continents.md index e6c1c41a15..03f3aa7631 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-continents.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-continents.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let continentList = try await locale.listContinents() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let continentList = try await locale.listContinents() + print(String(describing: continentList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-countries-e-u.md b/docs/examples/1.1.x/client-apple/examples/locale/list-countries-e-u.md index 8666c5a2ba..f25e383da6 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-countries-e-u.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let countryList = try await locale.listCountriesEU() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let countryList = try await locale.listCountriesEU() + print(String(describing: countryList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-countries-phones.md b/docs/examples/1.1.x/client-apple/examples/locale/list-countries-phones.md index 150dfbfdb6..31af0e230d 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-countries-phones.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let phoneList = try await locale.listCountriesPhones() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let phoneList = try await locale.listCountriesPhones() + print(String(describing: phoneList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-countries.md b/docs/examples/1.1.x/client-apple/examples/locale/list-countries.md index 0901da1cc5..29ac42ea59 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-countries.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-countries.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let countryList = try await locale.listCountries() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let countryList = try await locale.listCountries() + print(String(describing: countryList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-currencies.md b/docs/examples/1.1.x/client-apple/examples/locale/list-currencies.md index e43a416b48..aa0f6a0f0e 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-currencies.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-currencies.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let currencyList = try await locale.listCurrencies() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let currencyList = try await locale.listCurrencies() + print(String(describing: currencyList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-languages.md b/docs/examples/1.1.x/client-apple/examples/locale/list-languages.md index 06d0ba6968..043690a4eb 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-languages.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-languages.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let languageList = try await locale.listLanguages() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let languageList = try await locale.listLanguages() + print(String(describing: languageList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/create-file.md b/docs/examples/1.1.x/client-apple/examples/storage/create-file.md index ff16ebf8ce..050dc8fc08 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/create-file.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/create-file.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let file = try await storage.createFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]", - file: InputFile.fromPath("file.png") -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let file = try await storage.createFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]", + file: InputFile.fromPath("file.png") + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/delete-file.md b/docs/examples/1.1.x/client-apple/examples/storage/delete-file.md index db31d920cd..5bad56677d 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/delete-file.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/delete-file.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let result = try await storage.deleteFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let result = try await storage.deleteFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/get-file-download.md b/docs/examples/1.1.x/client-apple/examples/storage/get-file-download.md index f139482ff8..1504f78d33 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/get-file-download.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/get-file-download.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let byteBuffer = try await storage.getFileDownload( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let byteBuffer = try await storage.getFileDownload( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/get-file-preview.md b/docs/examples/1.1.x/client-apple/examples/storage/get-file-preview.md index 09b28dcfa6..33b80c49ae 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/get-file-preview.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/get-file-preview.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let byteBuffer = try await storage.getFilePreview( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let byteBuffer = try await storage.getFilePreview( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/get-file-view.md b/docs/examples/1.1.x/client-apple/examples/storage/get-file-view.md index 819fdab39c..7e3524aabb 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/get-file-view.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/get-file-view.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let byteBuffer = try await storage.getFileView( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let byteBuffer = try await storage.getFileView( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/get-file.md b/docs/examples/1.1.x/client-apple/examples/storage/get-file.md index 9e274fc28e..1f2fae973d 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/get-file.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/get-file.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let file = try await storage.getFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let file = try await storage.getFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/list-files.md b/docs/examples/1.1.x/client-apple/examples/storage/list-files.md index 5d33f1b11f..01ae959e43 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/list-files.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/list-files.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let fileList = try await storage.listFiles( - bucketId: "[BUCKET_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let fileList = try await storage.listFiles( + bucketId: "[BUCKET_ID]" + ) + print(String(describing: fileList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/update-file.md b/docs/examples/1.1.x/client-apple/examples/storage/update-file.md index ab33b619a2..85503f0199 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/update-file.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/update-file.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let file = try await storage.updateFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let file = try await storage.updateFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/create-membership.md b/docs/examples/1.1.x/client-apple/examples/teams/create-membership.md index c21c26814f..5a81e431d9 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/create-membership.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/create-membership.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membership = try await teams.createMembership( - teamId: "[TEAM_ID]", - email: "email@example.com", - roles: [], - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membership = try await teams.createMembership( + teamId: "[TEAM_ID]", + email: "email@example.com", + roles: [], + url: "https://example.com" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/create.md b/docs/examples/1.1.x/client-apple/examples/teams/create.md index 5fe1c087e7..227ceb37b2 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/create.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/create.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let team = try await teams.create( - teamId: "[TEAM_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let team = try await teams.create( + teamId: "[TEAM_ID]", + name: "[NAME]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/delete-membership.md b/docs/examples/1.1.x/client-apple/examples/teams/delete-membership.md index 7ee2d2a3a0..46a1ad7728 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/delete-membership.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/delete-membership.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let result = try await teams.deleteMembership( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let result = try await teams.deleteMembership( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/delete.md b/docs/examples/1.1.x/client-apple/examples/teams/delete.md index 6a0346ca6a..d117a8bbf7 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/delete.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/delete.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let result = try await teams.delete( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let result = try await teams.delete( + teamId: "[TEAM_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/get-membership.md b/docs/examples/1.1.x/client-apple/examples/teams/get-membership.md index 6c1ef643ed..8d19d11072 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/get-membership.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/get-membership.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membership = try await teams.getMembership( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membership = try await teams.getMembership( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/get.md b/docs/examples/1.1.x/client-apple/examples/teams/get.md index 68b5db8115..e4e0b9b68b 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/get.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/get.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let team = try await teams.get( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let team = try await teams.get( + teamId: "[TEAM_ID]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/list-memberships.md b/docs/examples/1.1.x/client-apple/examples/teams/list-memberships.md index eac7535ca9..3e3d89ff6f 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/list-memberships.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/list-memberships.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membershipList = try await teams.listMemberships( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membershipList = try await teams.listMemberships( + teamId: "[TEAM_ID]" + ) + print(String(describing: membershipList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/list.md b/docs/examples/1.1.x/client-apple/examples/teams/list.md index 7d662d2cfd..a1e454fd6c 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/list.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/list.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let teamList = try await teams.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let teamList = try await teams.list() + print(String(describing: teamList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/update-membership-roles.md b/docs/examples/1.1.x/client-apple/examples/teams/update-membership-roles.md index c59bf9223a..68ed875e42 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/update-membership-roles.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membership = try await teams.updateMembershipRoles( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]", - roles: [] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membership = try await teams.updateMembershipRoles( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]", + roles: [] + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/update-membership-status.md b/docs/examples/1.1.x/client-apple/examples/teams/update-membership-status.md index a98095445d..9712539a6e 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/update-membership-status.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/update-membership-status.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membership = try await teams.updateMembershipStatus( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]", - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membership = try await teams.updateMembershipStatus( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]", + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/update.md b/docs/examples/1.1.x/client-apple/examples/teams/update.md index 36bc40fe60..90a4332756 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/update.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/update.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let team = try await teams.update( - teamId: "[TEAM_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let team = try await teams.update( + teamId: "[TEAM_ID]", + name: "[NAME]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/client-web/examples/account/create-anonymous-session.md b/docs/examples/1.1.x/client-web/examples/account/create-anonymous-session.md index e1c53e7462..a1ff484477 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-anonymous-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-email-session.md b/docs/examples/1.1.x/client-web/examples/account/create-email-session.md index a8d5698bb1..43a0aa25a0 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-email-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-email-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-j-w-t.md b/docs/examples/1.1.x/client-web/examples/account/create-j-w-t.md index 97b608e052..3b5c7ed679 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-j-w-t.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-j-w-t.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/client-web/examples/account/create-magic-u-r-l-session.md index 6377e1d5a8..9339d6742c 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-magic-u-r-l-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-o-auth2session.md b/docs/examples/1.1.x/client-web/examples/account/create-o-auth2session.md index ca177f2094..25e67b15ec 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-o-auth2session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-phone-session.md b/docs/examples/1.1.x/client-web/examples/account/create-phone-session.md index 5b2c8be4db..df2efe0722 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-phone-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-phone-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-phone-verification.md b/docs/examples/1.1.x/client-web/examples/account/create-phone-verification.md index b22afc2fc7..f325a9210f 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-phone-verification.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-recovery.md b/docs/examples/1.1.x/client-web/examples/account/create-recovery.md index 389aeeedbe..4f737edf3d 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-recovery.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-recovery.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-verification.md b/docs/examples/1.1.x/client-web/examples/account/create-verification.md index c78f25dd95..0e7162c8cf 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-verification.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create.md b/docs/examples/1.1.x/client-web/examples/account/create.md index 6a8a39755c..5b275bd1ba 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create.md +++ b/docs/examples/1.1.x/client-web/examples/account/create.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/delete-session.md b/docs/examples/1.1.x/client-web/examples/account/delete-session.md index 2387a17237..a23a1f25e5 100644 --- a/docs/examples/1.1.x/client-web/examples/account/delete-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/delete-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/delete-sessions.md b/docs/examples/1.1.x/client-web/examples/account/delete-sessions.md index d587a898f5..58495385f1 100644 --- a/docs/examples/1.1.x/client-web/examples/account/delete-sessions.md +++ b/docs/examples/1.1.x/client-web/examples/account/delete-sessions.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/get-prefs.md b/docs/examples/1.1.x/client-web/examples/account/get-prefs.md index a4d8a3ca8a..a355c68ee0 100644 --- a/docs/examples/1.1.x/client-web/examples/account/get-prefs.md +++ b/docs/examples/1.1.x/client-web/examples/account/get-prefs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/get-session.md b/docs/examples/1.1.x/client-web/examples/account/get-session.md index a15fbab92c..dd0c08633e 100644 --- a/docs/examples/1.1.x/client-web/examples/account/get-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/get-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/get.md b/docs/examples/1.1.x/client-web/examples/account/get.md index f5b1d15148..fd26ad70dc 100644 --- a/docs/examples/1.1.x/client-web/examples/account/get.md +++ b/docs/examples/1.1.x/client-web/examples/account/get.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/list-logs.md b/docs/examples/1.1.x/client-web/examples/account/list-logs.md index 193ea1328f..4ce60e4314 100644 --- a/docs/examples/1.1.x/client-web/examples/account/list-logs.md +++ b/docs/examples/1.1.x/client-web/examples/account/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/list-sessions.md b/docs/examples/1.1.x/client-web/examples/account/list-sessions.md index 9518040303..d7e901c406 100644 --- a/docs/examples/1.1.x/client-web/examples/account/list-sessions.md +++ b/docs/examples/1.1.x/client-web/examples/account/list-sessions.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-email.md b/docs/examples/1.1.x/client-web/examples/account/update-email.md index e2a89ae63b..6e3d603801 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-email.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-email.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/client-web/examples/account/update-magic-u-r-l-session.md index 1941af7f45..1934263b69 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-magic-u-r-l-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-name.md b/docs/examples/1.1.x/client-web/examples/account/update-name.md index ce9d2cc884..24a27f1363 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-name.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-name.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-password.md b/docs/examples/1.1.x/client-web/examples/account/update-password.md index b57d34fbd9..5ace968e6b 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-password.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-password.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-phone-session.md b/docs/examples/1.1.x/client-web/examples/account/update-phone-session.md index 6c8507cc31..8ad2051057 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-phone-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-phone-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-phone-verification.md b/docs/examples/1.1.x/client-web/examples/account/update-phone-verification.md index a9580ddd8d..b96f3bea21 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-phone-verification.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-phone.md b/docs/examples/1.1.x/client-web/examples/account/update-phone.md index b1562bfadd..33dac5105f 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-phone.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-phone.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-prefs.md b/docs/examples/1.1.x/client-web/examples/account/update-prefs.md index 2d7dd060de..4948631a27 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-prefs.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-prefs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-recovery.md b/docs/examples/1.1.x/client-web/examples/account/update-recovery.md index 7c8c39b6fa..85915f1ab9 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-recovery.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-recovery.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-session.md b/docs/examples/1.1.x/client-web/examples/account/update-session.md index d02b49dc56..70fe5faa11 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-status.md b/docs/examples/1.1.x/client-web/examples/account/update-status.md index 8706f50504..a7c7817338 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-status.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-status.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-verification.md b/docs/examples/1.1.x/client-web/examples/account/update-verification.md index c75aa5fba3..27d5cbc2f7 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-verification.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-browser.md b/docs/examples/1.1.x/client-web/examples/avatars/get-browser.md index 8c7c3f2a34..20480ce124 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-browser.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-browser.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-credit-card.md b/docs/examples/1.1.x/client-web/examples/avatars/get-credit-card.md index 219ac51f6b..cdbc4a0067 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-credit-card.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-favicon.md b/docs/examples/1.1.x/client-web/examples/avatars/get-favicon.md index dcd749e7ef..f8db5c378c 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-favicon.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-favicon.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-flag.md b/docs/examples/1.1.x/client-web/examples/avatars/get-flag.md index 22a3cc024f..e609fb299d 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-flag.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-flag.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-image.md b/docs/examples/1.1.x/client-web/examples/avatars/get-image.md index 7b5c024d71..468f6a3c54 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-image.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-image.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-initials.md b/docs/examples/1.1.x/client-web/examples/avatars/get-initials.md index 3a016333c1..d061813297 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-initials.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-initials.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-q-r.md b/docs/examples/1.1.x/client-web/examples/avatars/get-q-r.md index e4cefc4d23..86fed127e9 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-q-r.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-q-r.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/create-document.md b/docs/examples/1.1.x/client-web/examples/databases/create-document.md index 94afca4aad..5b8d89ad47 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/create-document.md +++ b/docs/examples/1.1.x/client-web/examples/databases/create-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/delete-document.md b/docs/examples/1.1.x/client-web/examples/databases/delete-document.md index 1603c98ca7..e201280445 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/delete-document.md +++ b/docs/examples/1.1.x/client-web/examples/databases/delete-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/get-document.md b/docs/examples/1.1.x/client-web/examples/databases/get-document.md index 397c1044aa..89314e880a 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/get-document.md +++ b/docs/examples/1.1.x/client-web/examples/databases/get-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/list-documents.md b/docs/examples/1.1.x/client-web/examples/databases/list-documents.md index 6c396a3c4d..a4afd21031 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/list-documents.md +++ b/docs/examples/1.1.x/client-web/examples/databases/list-documents.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/update-document.md b/docs/examples/1.1.x/client-web/examples/databases/update-document.md index f1bb79da58..2d59a8ad85 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/update-document.md +++ b/docs/examples/1.1.x/client-web/examples/databases/update-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/functions/create-execution.md b/docs/examples/1.1.x/client-web/examples/functions/create-execution.md index 99535d633e..2b64bc9f7b 100644 --- a/docs/examples/1.1.x/client-web/examples/functions/create-execution.md +++ b/docs/examples/1.1.x/client-web/examples/functions/create-execution.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/functions/get-execution.md b/docs/examples/1.1.x/client-web/examples/functions/get-execution.md index e607477fe2..f5046a08c4 100644 --- a/docs/examples/1.1.x/client-web/examples/functions/get-execution.md +++ b/docs/examples/1.1.x/client-web/examples/functions/get-execution.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/functions/list-executions.md b/docs/examples/1.1.x/client-web/examples/functions/list-executions.md index bcf2a7a48d..99186a95de 100644 --- a/docs/examples/1.1.x/client-web/examples/functions/list-executions.md +++ b/docs/examples/1.1.x/client-web/examples/functions/list-executions.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/get.md b/docs/examples/1.1.x/client-web/examples/locale/get.md index f952603a8a..634256c83e 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/get.md +++ b/docs/examples/1.1.x/client-web/examples/locale/get.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-continents.md b/docs/examples/1.1.x/client-web/examples/locale/list-continents.md index 7df98f8862..e79a8eab5c 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-continents.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-continents.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-countries-e-u.md b/docs/examples/1.1.x/client-web/examples/locale/list-countries-e-u.md index 8a26c02bd3..964bed390b 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-countries-e-u.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-countries-phones.md b/docs/examples/1.1.x/client-web/examples/locale/list-countries-phones.md index c1b9c48b55..65ec4f4dbd 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-countries-phones.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-countries.md b/docs/examples/1.1.x/client-web/examples/locale/list-countries.md index 8ef34dc6d9..6b7e8e665f 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-countries.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-countries.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-currencies.md b/docs/examples/1.1.x/client-web/examples/locale/list-currencies.md index 80efe589c7..3638c2e1bb 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-currencies.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-currencies.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-languages.md b/docs/examples/1.1.x/client-web/examples/locale/list-languages.md index 3c1253e4c5..bffa5eb0c6 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-languages.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-languages.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/create-file.md b/docs/examples/1.1.x/client-web/examples/storage/create-file.md index 710adbade3..10992d2b89 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/create-file.md +++ b/docs/examples/1.1.x/client-web/examples/storage/create-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/delete-file.md b/docs/examples/1.1.x/client-web/examples/storage/delete-file.md index 7b5ecaa599..4512a8c1ce 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/delete-file.md +++ b/docs/examples/1.1.x/client-web/examples/storage/delete-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/get-file-download.md b/docs/examples/1.1.x/client-web/examples/storage/get-file-download.md index 0fdd3c5614..17c06600b3 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/get-file-download.md +++ b/docs/examples/1.1.x/client-web/examples/storage/get-file-download.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/get-file-preview.md b/docs/examples/1.1.x/client-web/examples/storage/get-file-preview.md index 262cd023bf..52866d108a 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/get-file-preview.md +++ b/docs/examples/1.1.x/client-web/examples/storage/get-file-preview.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/get-file-view.md b/docs/examples/1.1.x/client-web/examples/storage/get-file-view.md index bae90e9d31..7bb6c67d51 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/get-file-view.md +++ b/docs/examples/1.1.x/client-web/examples/storage/get-file-view.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/get-file.md b/docs/examples/1.1.x/client-web/examples/storage/get-file.md index 3f6741a5e3..3263865c73 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/get-file.md +++ b/docs/examples/1.1.x/client-web/examples/storage/get-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/list-files.md b/docs/examples/1.1.x/client-web/examples/storage/list-files.md index 7868a925f6..92d75742a5 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/list-files.md +++ b/docs/examples/1.1.x/client-web/examples/storage/list-files.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/update-file.md b/docs/examples/1.1.x/client-web/examples/storage/update-file.md index 8f3e2484f8..1313e30cff 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/update-file.md +++ b/docs/examples/1.1.x/client-web/examples/storage/update-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/create-membership.md b/docs/examples/1.1.x/client-web/examples/teams/create-membership.md index 005980871a..6cb7d87b7f 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/create-membership.md +++ b/docs/examples/1.1.x/client-web/examples/teams/create-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/create.md b/docs/examples/1.1.x/client-web/examples/teams/create.md index 2879eaa6ae..2c40c9017d 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/create.md +++ b/docs/examples/1.1.x/client-web/examples/teams/create.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/delete-membership.md b/docs/examples/1.1.x/client-web/examples/teams/delete-membership.md index 3275878b9b..828674a86f 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/delete-membership.md +++ b/docs/examples/1.1.x/client-web/examples/teams/delete-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/delete.md b/docs/examples/1.1.x/client-web/examples/teams/delete.md index 806ef8f60e..b9b79ed1b7 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/delete.md +++ b/docs/examples/1.1.x/client-web/examples/teams/delete.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/get-membership.md b/docs/examples/1.1.x/client-web/examples/teams/get-membership.md index aa583b3e12..cce63e7fba 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/get-membership.md +++ b/docs/examples/1.1.x/client-web/examples/teams/get-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/get.md b/docs/examples/1.1.x/client-web/examples/teams/get.md index cfcafefc03..3a7185319a 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/get.md +++ b/docs/examples/1.1.x/client-web/examples/teams/get.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/list-memberships.md b/docs/examples/1.1.x/client-web/examples/teams/list-memberships.md index b507f82e92..12bef1a6f8 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/list-memberships.md +++ b/docs/examples/1.1.x/client-web/examples/teams/list-memberships.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/list.md b/docs/examples/1.1.x/client-web/examples/teams/list.md index 2333ab4155..1aea267038 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/list.md +++ b/docs/examples/1.1.x/client-web/examples/teams/list.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/update-membership-roles.md b/docs/examples/1.1.x/client-web/examples/teams/update-membership-roles.md index e5ab84867e..ca76ead1d6 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/client-web/examples/teams/update-membership-roles.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/update-membership-status.md b/docs/examples/1.1.x/client-web/examples/teams/update-membership-status.md index fdd391ca22..4a29cdc116 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/update-membership-status.md +++ b/docs/examples/1.1.x/client-web/examples/teams/update-membership-status.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/update.md b/docs/examples/1.1.x/client-web/examples/teams/update.md index ce54a850d8..a59cc80000 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/update.md +++ b/docs/examples/1.1.x/client-web/examples/teams/update.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-anonymous-session.md b/docs/examples/1.1.x/console-web/examples/account/create-anonymous-session.md index e1c53e7462..a1ff484477 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-anonymous-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-email-session.md b/docs/examples/1.1.x/console-web/examples/account/create-email-session.md index a8d5698bb1..43a0aa25a0 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-email-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-email-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-j-w-t.md b/docs/examples/1.1.x/console-web/examples/account/create-j-w-t.md index 97b608e052..3b5c7ed679 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-j-w-t.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-j-w-t.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/console-web/examples/account/create-magic-u-r-l-session.md index 6377e1d5a8..9339d6742c 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-magic-u-r-l-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-o-auth2session.md b/docs/examples/1.1.x/console-web/examples/account/create-o-auth2session.md index ca177f2094..25e67b15ec 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-o-auth2session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-phone-session.md b/docs/examples/1.1.x/console-web/examples/account/create-phone-session.md index 5b2c8be4db..df2efe0722 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-phone-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-phone-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-phone-verification.md b/docs/examples/1.1.x/console-web/examples/account/create-phone-verification.md index b22afc2fc7..f325a9210f 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-phone-verification.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-recovery.md b/docs/examples/1.1.x/console-web/examples/account/create-recovery.md index 389aeeedbe..4f737edf3d 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-recovery.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-recovery.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-verification.md b/docs/examples/1.1.x/console-web/examples/account/create-verification.md index c78f25dd95..0e7162c8cf 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-verification.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create.md b/docs/examples/1.1.x/console-web/examples/account/create.md index 6a8a39755c..5b275bd1ba 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create.md +++ b/docs/examples/1.1.x/console-web/examples/account/create.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/delete-session.md b/docs/examples/1.1.x/console-web/examples/account/delete-session.md index 2387a17237..a23a1f25e5 100644 --- a/docs/examples/1.1.x/console-web/examples/account/delete-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/delete-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/delete-sessions.md b/docs/examples/1.1.x/console-web/examples/account/delete-sessions.md index d587a898f5..58495385f1 100644 --- a/docs/examples/1.1.x/console-web/examples/account/delete-sessions.md +++ b/docs/examples/1.1.x/console-web/examples/account/delete-sessions.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/get-prefs.md b/docs/examples/1.1.x/console-web/examples/account/get-prefs.md index a4d8a3ca8a..a355c68ee0 100644 --- a/docs/examples/1.1.x/console-web/examples/account/get-prefs.md +++ b/docs/examples/1.1.x/console-web/examples/account/get-prefs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/get-session.md b/docs/examples/1.1.x/console-web/examples/account/get-session.md index a15fbab92c..dd0c08633e 100644 --- a/docs/examples/1.1.x/console-web/examples/account/get-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/get-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/get.md b/docs/examples/1.1.x/console-web/examples/account/get.md index f5b1d15148..fd26ad70dc 100644 --- a/docs/examples/1.1.x/console-web/examples/account/get.md +++ b/docs/examples/1.1.x/console-web/examples/account/get.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/list-logs.md b/docs/examples/1.1.x/console-web/examples/account/list-logs.md index 193ea1328f..4ce60e4314 100644 --- a/docs/examples/1.1.x/console-web/examples/account/list-logs.md +++ b/docs/examples/1.1.x/console-web/examples/account/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/list-sessions.md b/docs/examples/1.1.x/console-web/examples/account/list-sessions.md index 9518040303..d7e901c406 100644 --- a/docs/examples/1.1.x/console-web/examples/account/list-sessions.md +++ b/docs/examples/1.1.x/console-web/examples/account/list-sessions.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-email.md b/docs/examples/1.1.x/console-web/examples/account/update-email.md index e2a89ae63b..6e3d603801 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-email.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-email.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/console-web/examples/account/update-magic-u-r-l-session.md index 1941af7f45..1934263b69 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-magic-u-r-l-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-name.md b/docs/examples/1.1.x/console-web/examples/account/update-name.md index ce9d2cc884..24a27f1363 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-name.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-name.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-password.md b/docs/examples/1.1.x/console-web/examples/account/update-password.md index b57d34fbd9..5ace968e6b 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-password.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-password.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-phone-session.md b/docs/examples/1.1.x/console-web/examples/account/update-phone-session.md index 6c8507cc31..8ad2051057 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-phone-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-phone-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-phone-verification.md b/docs/examples/1.1.x/console-web/examples/account/update-phone-verification.md index a9580ddd8d..b96f3bea21 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-phone-verification.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-phone.md b/docs/examples/1.1.x/console-web/examples/account/update-phone.md index b1562bfadd..33dac5105f 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-phone.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-phone.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-prefs.md b/docs/examples/1.1.x/console-web/examples/account/update-prefs.md index 2d7dd060de..4948631a27 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-prefs.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-prefs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-recovery.md b/docs/examples/1.1.x/console-web/examples/account/update-recovery.md index 7c8c39b6fa..85915f1ab9 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-recovery.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-recovery.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-session.md b/docs/examples/1.1.x/console-web/examples/account/update-session.md index d02b49dc56..70fe5faa11 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-status.md b/docs/examples/1.1.x/console-web/examples/account/update-status.md index 8706f50504..a7c7817338 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-status.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-status.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-verification.md b/docs/examples/1.1.x/console-web/examples/account/update-verification.md index c75aa5fba3..27d5cbc2f7 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-verification.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-browser.md b/docs/examples/1.1.x/console-web/examples/avatars/get-browser.md index 8c7c3f2a34..20480ce124 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-browser.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-browser.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-credit-card.md b/docs/examples/1.1.x/console-web/examples/avatars/get-credit-card.md index 219ac51f6b..cdbc4a0067 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-credit-card.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-favicon.md b/docs/examples/1.1.x/console-web/examples/avatars/get-favicon.md index dcd749e7ef..f8db5c378c 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-favicon.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-favicon.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-flag.md b/docs/examples/1.1.x/console-web/examples/avatars/get-flag.md index 22a3cc024f..e609fb299d 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-flag.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-flag.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-image.md b/docs/examples/1.1.x/console-web/examples/avatars/get-image.md index 7b5c024d71..468f6a3c54 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-image.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-image.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-initials.md b/docs/examples/1.1.x/console-web/examples/avatars/get-initials.md index 3a016333c1..d061813297 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-initials.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-initials.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-q-r.md b/docs/examples/1.1.x/console-web/examples/avatars/get-q-r.md index e4cefc4d23..86fed127e9 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-q-r.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-q-r.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-boolean-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-boolean-attribute.md index aea33103a3..b8a2143814 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-boolean-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-boolean-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-collection.md b/docs/examples/1.1.x/console-web/examples/databases/create-collection.md index ab2f5da6e3..d5367d03bc 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-collection.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-collection.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-datetime-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-datetime-attribute.md index d0457e1bd2..a3921bbf2b 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-datetime-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-datetime-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-document.md b/docs/examples/1.1.x/console-web/examples/databases/create-document.md index 94afca4aad..5b8d89ad47 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-document.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-email-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-email-attribute.md index 464eb29f82..50557c0742 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-email-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-email-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-enum-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-enum-attribute.md index 7d418539ca..92e8fae071 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-enum-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-enum-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-float-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-float-attribute.md index 23d346ad52..4c4159f625 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-float-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-float-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-index.md b/docs/examples/1.1.x/console-web/examples/databases/create-index.md index 956a037c99..b706ae69e5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-index.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-index.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-integer-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-integer-attribute.md index 913915b03f..534a61d29b 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-integer-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-integer-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-ip-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-ip-attribute.md index 7014400cf0..9ef9ad780c 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-ip-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-ip-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-string-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-string-attribute.md index 4c4e6f6c16..1553ea92f1 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-string-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-string-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-url-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-url-attribute.md index ac26031f57..8e75affb69 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-url-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-url-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create.md b/docs/examples/1.1.x/console-web/examples/databases/create.md index aedacac821..7936a85aa5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/delete-attribute.md index d80e5aa16e..8a2ec9b4e5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete-collection.md b/docs/examples/1.1.x/console-web/examples/databases/delete-collection.md index f7b4519d1f..724ae217cf 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete-collection.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete-collection.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete-document.md b/docs/examples/1.1.x/console-web/examples/databases/delete-document.md index 1603c98ca7..e201280445 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete-document.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete-index.md b/docs/examples/1.1.x/console-web/examples/databases/delete-index.md index f28465eb8c..ecd0b48009 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete-index.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete-index.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete.md b/docs/examples/1.1.x/console-web/examples/databases/delete.md index 18cea6a280..a625395209 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/get-attribute.md index 68fc2b3045..de4352449d 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-collection-usage.md b/docs/examples/1.1.x/console-web/examples/databases/get-collection-usage.md index 834fe83dd5..67fc1702de 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-collection-usage.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-collection-usage.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-collection.md b/docs/examples/1.1.x/console-web/examples/databases/get-collection.md index 91a73990e9..ec069bc3bb 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-collection.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-collection.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-database-usage.md b/docs/examples/1.1.x/console-web/examples/databases/get-database-usage.md index 7a79f193cd..d9cbedcdbb 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-database-usage.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-database-usage.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-document.md b/docs/examples/1.1.x/console-web/examples/databases/get-document.md index 397c1044aa..89314e880a 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-document.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-index.md b/docs/examples/1.1.x/console-web/examples/databases/get-index.md index 34fc88ab6e..ccb19134ef 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-index.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-index.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-usage.md b/docs/examples/1.1.x/console-web/examples/databases/get-usage.md index dedd2d19ee..9408c58613 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get.md b/docs/examples/1.1.x/console-web/examples/databases/get.md index f56bbada76..0f376138c5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-attributes.md b/docs/examples/1.1.x/console-web/examples/databases/list-attributes.md index 1dd98ebad1..22f0df4830 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-attributes.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-attributes.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-collection-logs.md b/docs/examples/1.1.x/console-web/examples/databases/list-collection-logs.md index bf3b774c2a..d8cf623af1 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-collection-logs.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-collection-logs.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-collections.md b/docs/examples/1.1.x/console-web/examples/databases/list-collections.md index f01351a532..5f757022de 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-collections.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-collections.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-document-logs.md b/docs/examples/1.1.x/console-web/examples/databases/list-document-logs.md index 1fde4cddc5..220fb282d5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-document-logs.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-document-logs.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-documents.md b/docs/examples/1.1.x/console-web/examples/databases/list-documents.md index 6c396a3c4d..a4afd21031 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-documents.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-documents.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-indexes.md b/docs/examples/1.1.x/console-web/examples/databases/list-indexes.md index 46cb061b7f..33dfdd3f7d 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-indexes.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-indexes.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-logs.md b/docs/examples/1.1.x/console-web/examples/databases/list-logs.md index ad1af2cf87..e9af3195af 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-logs.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list.md b/docs/examples/1.1.x/console-web/examples/databases/list.md index 651f5fbdec..44a0fd9436 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/update-collection.md b/docs/examples/1.1.x/console-web/examples/databases/update-collection.md index 964b8107c9..a46583f436 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/update-collection.md +++ b/docs/examples/1.1.x/console-web/examples/databases/update-collection.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/update-document.md b/docs/examples/1.1.x/console-web/examples/databases/update-document.md index f1bb79da58..2d59a8ad85 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/update-document.md +++ b/docs/examples/1.1.x/console-web/examples/databases/update-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/update.md b/docs/examples/1.1.x/console-web/examples/databases/update.md index 7dd37f2a34..3bb577d50b 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/update.md +++ b/docs/examples/1.1.x/console-web/examples/databases/update.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create-build.md b/docs/examples/1.1.x/console-web/examples/functions/create-build.md index 80e18f4014..6e99308986 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create-build.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create-build.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create-deployment.md b/docs/examples/1.1.x/console-web/examples/functions/create-deployment.md index 215264f1c4..57687bc535 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create-deployment.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create-deployment.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create-execution.md b/docs/examples/1.1.x/console-web/examples/functions/create-execution.md index 99535d633e..2b64bc9f7b 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create-execution.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create-execution.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create-variable.md b/docs/examples/1.1.x/console-web/examples/functions/create-variable.md index 963828bc1c..972830719e 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create-variable.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create-variable.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create.md b/docs/examples/1.1.x/console-web/examples/functions/create.md index dac95b2651..4fe6fec973 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/delete-deployment.md b/docs/examples/1.1.x/console-web/examples/functions/delete-deployment.md index 6722645453..8f2c646401 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/delete-deployment.md +++ b/docs/examples/1.1.x/console-web/examples/functions/delete-deployment.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/delete-variable.md b/docs/examples/1.1.x/console-web/examples/functions/delete-variable.md index 2f1beb7728..5cb80d2106 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/delete-variable.md +++ b/docs/examples/1.1.x/console-web/examples/functions/delete-variable.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/delete.md b/docs/examples/1.1.x/console-web/examples/functions/delete.md index f5f2dcffd0..4ac987df81 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/delete.md +++ b/docs/examples/1.1.x/console-web/examples/functions/delete.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-deployment.md b/docs/examples/1.1.x/console-web/examples/functions/get-deployment.md index 75c63dcc4e..a07fb7e844 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-deployment.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-deployment.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-execution.md b/docs/examples/1.1.x/console-web/examples/functions/get-execution.md index e607477fe2..f5046a08c4 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-execution.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-execution.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-function-usage.md b/docs/examples/1.1.x/console-web/examples/functions/get-function-usage.md index a2c9f48f35..f9d416319f 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-function-usage.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-function-usage.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-usage.md b/docs/examples/1.1.x/console-web/examples/functions/get-usage.md index 5fe6af9a5f..d183a45f19 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-variable.md b/docs/examples/1.1.x/console-web/examples/functions/get-variable.md index 015211b000..cca9639434 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-variable.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-variable.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get.md b/docs/examples/1.1.x/console-web/examples/functions/get.md index 10c59ab45e..b6e32b5171 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list-deployments.md b/docs/examples/1.1.x/console-web/examples/functions/list-deployments.md index ef81eafb2e..843dd07a61 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list-deployments.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list-deployments.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list-executions.md b/docs/examples/1.1.x/console-web/examples/functions/list-executions.md index bcf2a7a48d..99186a95de 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list-executions.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list-executions.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list-runtimes.md b/docs/examples/1.1.x/console-web/examples/functions/list-runtimes.md index ff37c68866..d5e1f6630e 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list-runtimes.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list-runtimes.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list-variables.md b/docs/examples/1.1.x/console-web/examples/functions/list-variables.md index f6ab0863c4..9461ce60f0 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list-variables.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list-variables.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list.md b/docs/examples/1.1.x/console-web/examples/functions/list.md index dab9a8ab28..730a90fff6 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/update-deployment.md b/docs/examples/1.1.x/console-web/examples/functions/update-deployment.md index 80f0d5b3ae..b231ae593e 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/update-deployment.md +++ b/docs/examples/1.1.x/console-web/examples/functions/update-deployment.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/update-variable.md b/docs/examples/1.1.x/console-web/examples/functions/update-variable.md index b09485f35b..b3f0439644 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/update-variable.md +++ b/docs/examples/1.1.x/console-web/examples/functions/update-variable.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/update.md b/docs/examples/1.1.x/console-web/examples/functions/update.md index b67bf06d6e..c025fc73a7 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/update.md +++ b/docs/examples/1.1.x/console-web/examples/functions/update.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-antivirus.md b/docs/examples/1.1.x/console-web/examples/health/get-antivirus.md index 7211653832..0b14fa8acf 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-antivirus.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-antivirus.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-cache.md b/docs/examples/1.1.x/console-web/examples/health/get-cache.md index a8dadc1a94..a754f9be93 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-cache.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-cache.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-d-b.md b/docs/examples/1.1.x/console-web/examples/health/get-d-b.md index b92facbdb9..86ff4a7d84 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-d-b.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-d-b.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-queue-certificates.md b/docs/examples/1.1.x/console-web/examples/health/get-queue-certificates.md index b9d3bf42c7..2b4dc05c37 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-queue-certificates.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-queue-certificates.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-queue-functions.md b/docs/examples/1.1.x/console-web/examples/health/get-queue-functions.md index 0cae096727..9d6f3b7f7d 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-queue-functions.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-queue-functions.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-queue-logs.md b/docs/examples/1.1.x/console-web/examples/health/get-queue-logs.md index a2909db719..010e603f92 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-queue-logs.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-queue-logs.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-queue-webhooks.md b/docs/examples/1.1.x/console-web/examples/health/get-queue-webhooks.md index 4e46c69a85..2687863f12 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-queue-webhooks.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-queue-webhooks.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-storage-local.md b/docs/examples/1.1.x/console-web/examples/health/get-storage-local.md index 9d43db36c1..b11daa2fec 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-storage-local.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-storage-local.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-time.md b/docs/examples/1.1.x/console-web/examples/health/get-time.md index 20314ef83e..1f617e13a2 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-time.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-time.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get.md b/docs/examples/1.1.x/console-web/examples/health/get.md index 3add8a3f09..b1d6be4509 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get.md +++ b/docs/examples/1.1.x/console-web/examples/health/get.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/get.md b/docs/examples/1.1.x/console-web/examples/locale/get.md index f952603a8a..634256c83e 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/get.md +++ b/docs/examples/1.1.x/console-web/examples/locale/get.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-continents.md b/docs/examples/1.1.x/console-web/examples/locale/list-continents.md index 7df98f8862..e79a8eab5c 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-continents.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-continents.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-countries-e-u.md b/docs/examples/1.1.x/console-web/examples/locale/list-countries-e-u.md index 8a26c02bd3..964bed390b 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-countries-e-u.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-countries-phones.md b/docs/examples/1.1.x/console-web/examples/locale/list-countries-phones.md index c1b9c48b55..65ec4f4dbd 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-countries-phones.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-countries.md b/docs/examples/1.1.x/console-web/examples/locale/list-countries.md index 8ef34dc6d9..6b7e8e665f 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-countries.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-countries.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-currencies.md b/docs/examples/1.1.x/console-web/examples/locale/list-currencies.md index 80efe589c7..3638c2e1bb 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-currencies.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-currencies.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-languages.md b/docs/examples/1.1.x/console-web/examples/locale/list-languages.md index 3c1253e4c5..bffa5eb0c6 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-languages.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-languages.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create-domain.md b/docs/examples/1.1.x/console-web/examples/projects/create-domain.md index 496663b38d..452a594c48 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create-domain.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create-domain.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create-key.md b/docs/examples/1.1.x/console-web/examples/projects/create-key.md index 1a962d872a..8bd57d54c6 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create-key.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create-key.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create-platform.md b/docs/examples/1.1.x/console-web/examples/projects/create-platform.md index 1160a7c8b3..c2c6a030b4 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create-platform.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create-platform.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create-webhook.md b/docs/examples/1.1.x/console-web/examples/projects/create-webhook.md index 2ace893691..1469e6b30f 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create-webhook.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create-webhook.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create.md b/docs/examples/1.1.x/console-web/examples/projects/create.md index 74871c1eb7..940b998324 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete-domain.md b/docs/examples/1.1.x/console-web/examples/projects/delete-domain.md index a148b76460..266d343ae1 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete-domain.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete-domain.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete-key.md b/docs/examples/1.1.x/console-web/examples/projects/delete-key.md index b002255793..0b227e7f1a 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete-key.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete-key.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete-platform.md b/docs/examples/1.1.x/console-web/examples/projects/delete-platform.md index b25c7c0e55..681362017c 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete-platform.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete-platform.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete-webhook.md b/docs/examples/1.1.x/console-web/examples/projects/delete-webhook.md index a4466114f1..3edbdadb07 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete-webhook.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete-webhook.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete.md b/docs/examples/1.1.x/console-web/examples/projects/delete.md index b6373978f7..1e479709e9 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-domain.md b/docs/examples/1.1.x/console-web/examples/projects/get-domain.md index dee059f324..a90d5eec33 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-domain.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-domain.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-key.md b/docs/examples/1.1.x/console-web/examples/projects/get-key.md index 1120e0942a..59a4224f78 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-key.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-key.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-platform.md b/docs/examples/1.1.x/console-web/examples/projects/get-platform.md index 5361652cdb..8eaea3371b 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-platform.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-platform.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-usage.md b/docs/examples/1.1.x/console-web/examples/projects/get-usage.md index da49cb704a..be7ee4379e 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-webhook.md b/docs/examples/1.1.x/console-web/examples/projects/get-webhook.md index 78a992de46..b636a797ee 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-webhook.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-webhook.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get.md b/docs/examples/1.1.x/console-web/examples/projects/get.md index 1b6d3845bc..ac20f56023 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list-domains.md b/docs/examples/1.1.x/console-web/examples/projects/list-domains.md index 375d2ba650..2c4a7415d2 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list-domains.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list-domains.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list-keys.md b/docs/examples/1.1.x/console-web/examples/projects/list-keys.md index 4ad7c21a2a..957531a892 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list-keys.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list-keys.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list-platforms.md b/docs/examples/1.1.x/console-web/examples/projects/list-platforms.md index ae2bd8ae45..100be04115 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list-platforms.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list-platforms.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list-webhooks.md b/docs/examples/1.1.x/console-web/examples/projects/list-webhooks.md index 096d62bf50..093b9e91f7 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list-webhooks.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list-webhooks.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list.md b/docs/examples/1.1.x/console-web/examples/projects/list.md index a870d95af5..a576843401 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-auth-duration.md b/docs/examples/1.1.x/console-web/examples/projects/update-auth-duration.md index df3b479631..ab7b01084c 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-auth-duration.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-auth-duration.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-auth-limit.md b/docs/examples/1.1.x/console-web/examples/projects/update-auth-limit.md index 72a2452cb2..7cc850ad2e 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-auth-limit.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-auth-limit.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-auth-status.md b/docs/examples/1.1.x/console-web/examples/projects/update-auth-status.md index 6330048f96..400d5a4f7b 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-auth-status.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-auth-status.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-domain-verification.md b/docs/examples/1.1.x/console-web/examples/projects/update-domain-verification.md index 055b8d8153..c632ad10fb 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-domain-verification.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-domain-verification.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-key.md b/docs/examples/1.1.x/console-web/examples/projects/update-key.md index ef071795d7..627bf6c38b 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-key.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-key.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-o-auth2.md b/docs/examples/1.1.x/console-web/examples/projects/update-o-auth2.md index c4ac006689..df22de53d3 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-o-auth2.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-o-auth2.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-platform.md b/docs/examples/1.1.x/console-web/examples/projects/update-platform.md index f2d97a5951..0d6b91999e 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-platform.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-platform.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-service-status.md b/docs/examples/1.1.x/console-web/examples/projects/update-service-status.md index b9613b08eb..ae95091908 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-service-status.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-service-status.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-webhook-signature.md b/docs/examples/1.1.x/console-web/examples/projects/update-webhook-signature.md index 534ab66532..3545f9a50a 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-webhook-signature.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-webhook-signature.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-webhook.md b/docs/examples/1.1.x/console-web/examples/projects/update-webhook.md index dc94675a17..45ecb8b02d 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-webhook.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-webhook.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update.md b/docs/examples/1.1.x/console-web/examples/projects/update.md index ccc594f390..661eb11920 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/create-bucket.md b/docs/examples/1.1.x/console-web/examples/storage/create-bucket.md index 194f8980b2..e2c8bb3c5d 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/create-bucket.md +++ b/docs/examples/1.1.x/console-web/examples/storage/create-bucket.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/create-file.md b/docs/examples/1.1.x/console-web/examples/storage/create-file.md index 710adbade3..10992d2b89 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/create-file.md +++ b/docs/examples/1.1.x/console-web/examples/storage/create-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/delete-bucket.md b/docs/examples/1.1.x/console-web/examples/storage/delete-bucket.md index e50ec3be46..a8580f9a08 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/delete-bucket.md +++ b/docs/examples/1.1.x/console-web/examples/storage/delete-bucket.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/delete-file.md b/docs/examples/1.1.x/console-web/examples/storage/delete-file.md index 7b5ecaa599..4512a8c1ce 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/delete-file.md +++ b/docs/examples/1.1.x/console-web/examples/storage/delete-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-bucket-usage.md b/docs/examples/1.1.x/console-web/examples/storage/get-bucket-usage.md index c2a372e961..61ef7fa956 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-bucket-usage.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-bucket-usage.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-bucket.md b/docs/examples/1.1.x/console-web/examples/storage/get-bucket.md index 425bebabc1..3ffd9f3b42 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-bucket.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-bucket.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-file-download.md b/docs/examples/1.1.x/console-web/examples/storage/get-file-download.md index 0fdd3c5614..17c06600b3 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-file-download.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-file-download.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-file-preview.md b/docs/examples/1.1.x/console-web/examples/storage/get-file-preview.md index 262cd023bf..52866d108a 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-file-preview.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-file-preview.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-file-view.md b/docs/examples/1.1.x/console-web/examples/storage/get-file-view.md index bae90e9d31..7bb6c67d51 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-file-view.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-file-view.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-file.md b/docs/examples/1.1.x/console-web/examples/storage/get-file.md index 3f6741a5e3..3263865c73 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-file.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-usage.md b/docs/examples/1.1.x/console-web/examples/storage/get-usage.md index 5dff8f3776..a5ce5853e9 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/list-buckets.md b/docs/examples/1.1.x/console-web/examples/storage/list-buckets.md index d3373c5474..4f916c1536 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/list-buckets.md +++ b/docs/examples/1.1.x/console-web/examples/storage/list-buckets.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/list-files.md b/docs/examples/1.1.x/console-web/examples/storage/list-files.md index 7868a925f6..92d75742a5 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/list-files.md +++ b/docs/examples/1.1.x/console-web/examples/storage/list-files.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/update-bucket.md b/docs/examples/1.1.x/console-web/examples/storage/update-bucket.md index b4e866ac3f..c0b6b41fab 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/update-bucket.md +++ b/docs/examples/1.1.x/console-web/examples/storage/update-bucket.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/update-file.md b/docs/examples/1.1.x/console-web/examples/storage/update-file.md index 8f3e2484f8..1313e30cff 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/update-file.md +++ b/docs/examples/1.1.x/console-web/examples/storage/update-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/create-membership.md b/docs/examples/1.1.x/console-web/examples/teams/create-membership.md index 005980871a..6cb7d87b7f 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/create-membership.md +++ b/docs/examples/1.1.x/console-web/examples/teams/create-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/create.md b/docs/examples/1.1.x/console-web/examples/teams/create.md index 2879eaa6ae..2c40c9017d 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/create.md +++ b/docs/examples/1.1.x/console-web/examples/teams/create.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/delete-membership.md b/docs/examples/1.1.x/console-web/examples/teams/delete-membership.md index 3275878b9b..828674a86f 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/delete-membership.md +++ b/docs/examples/1.1.x/console-web/examples/teams/delete-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/delete.md b/docs/examples/1.1.x/console-web/examples/teams/delete.md index 806ef8f60e..b9b79ed1b7 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/delete.md +++ b/docs/examples/1.1.x/console-web/examples/teams/delete.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/get-membership.md b/docs/examples/1.1.x/console-web/examples/teams/get-membership.md index aa583b3e12..cce63e7fba 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/get-membership.md +++ b/docs/examples/1.1.x/console-web/examples/teams/get-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/get.md b/docs/examples/1.1.x/console-web/examples/teams/get.md index cfcafefc03..3a7185319a 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/get.md +++ b/docs/examples/1.1.x/console-web/examples/teams/get.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/list-logs.md b/docs/examples/1.1.x/console-web/examples/teams/list-logs.md index 0e1f7c7e9c..f5120d5b21 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/list-logs.md +++ b/docs/examples/1.1.x/console-web/examples/teams/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/list-memberships.md b/docs/examples/1.1.x/console-web/examples/teams/list-memberships.md index b507f82e92..12bef1a6f8 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/list-memberships.md +++ b/docs/examples/1.1.x/console-web/examples/teams/list-memberships.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/list.md b/docs/examples/1.1.x/console-web/examples/teams/list.md index 2333ab4155..1aea267038 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/list.md +++ b/docs/examples/1.1.x/console-web/examples/teams/list.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/update-membership-roles.md b/docs/examples/1.1.x/console-web/examples/teams/update-membership-roles.md index e5ab84867e..ca76ead1d6 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/console-web/examples/teams/update-membership-roles.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/update-membership-status.md b/docs/examples/1.1.x/console-web/examples/teams/update-membership-status.md index fdd391ca22..4a29cdc116 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/update-membership-status.md +++ b/docs/examples/1.1.x/console-web/examples/teams/update-membership-status.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/update.md b/docs/examples/1.1.x/console-web/examples/teams/update.md index ce54a850d8..a59cc80000 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/update.md +++ b/docs/examples/1.1.x/console-web/examples/teams/update.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-argon2user.md b/docs/examples/1.1.x/console-web/examples/users/create-argon2user.md index 68d41eec7d..e63f9cc083 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-argon2user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-argon2user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-bcrypt-user.md b/docs/examples/1.1.x/console-web/examples/users/create-bcrypt-user.md index 670119c1ef..615ebcd8db 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-bcrypt-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-bcrypt-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-m-d5user.md b/docs/examples/1.1.x/console-web/examples/users/create-m-d5user.md index a4e39d84e8..75778f0c66 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-m-d5user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-m-d5user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-p-h-pass-user.md b/docs/examples/1.1.x/console-web/examples/users/create-p-h-pass-user.md index cdf83907be..054ae92691 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-p-h-pass-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-p-h-pass-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-s-h-a-user.md b/docs/examples/1.1.x/console-web/examples/users/create-s-h-a-user.md index 3f0d2b95fb..1213596592 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-s-h-a-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-s-h-a-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-scrypt-modified-user.md b/docs/examples/1.1.x/console-web/examples/users/create-scrypt-modified-user.md index 14c8cb2f1e..de022f1aa1 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-scrypt-modified-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-scrypt-user.md b/docs/examples/1.1.x/console-web/examples/users/create-scrypt-user.md index ed479f70a7..a6050acfcb 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-scrypt-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-scrypt-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create.md b/docs/examples/1.1.x/console-web/examples/users/create.md index bb62b1531f..7c9644702c 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create.md +++ b/docs/examples/1.1.x/console-web/examples/users/create.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/delete-session.md b/docs/examples/1.1.x/console-web/examples/users/delete-session.md index 3be7607a66..90f0f301ff 100644 --- a/docs/examples/1.1.x/console-web/examples/users/delete-session.md +++ b/docs/examples/1.1.x/console-web/examples/users/delete-session.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/delete-sessions.md b/docs/examples/1.1.x/console-web/examples/users/delete-sessions.md index f930ce40c6..3df8c7bdb6 100644 --- a/docs/examples/1.1.x/console-web/examples/users/delete-sessions.md +++ b/docs/examples/1.1.x/console-web/examples/users/delete-sessions.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/delete.md b/docs/examples/1.1.x/console-web/examples/users/delete.md index 51690fbd31..f7c21f3d55 100644 --- a/docs/examples/1.1.x/console-web/examples/users/delete.md +++ b/docs/examples/1.1.x/console-web/examples/users/delete.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/get-prefs.md b/docs/examples/1.1.x/console-web/examples/users/get-prefs.md index 8bd1a3185f..959c68c7c0 100644 --- a/docs/examples/1.1.x/console-web/examples/users/get-prefs.md +++ b/docs/examples/1.1.x/console-web/examples/users/get-prefs.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/get-usage.md b/docs/examples/1.1.x/console-web/examples/users/get-usage.md index b1694fd826..cca80da32d 100644 --- a/docs/examples/1.1.x/console-web/examples/users/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/users/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/get.md b/docs/examples/1.1.x/console-web/examples/users/get.md index 497c9dfe15..500263dad6 100644 --- a/docs/examples/1.1.x/console-web/examples/users/get.md +++ b/docs/examples/1.1.x/console-web/examples/users/get.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/list-logs.md b/docs/examples/1.1.x/console-web/examples/users/list-logs.md index ece696c12d..9b2d31d95b 100644 --- a/docs/examples/1.1.x/console-web/examples/users/list-logs.md +++ b/docs/examples/1.1.x/console-web/examples/users/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/list-memberships.md b/docs/examples/1.1.x/console-web/examples/users/list-memberships.md index 657801b997..ebd6a38e42 100644 --- a/docs/examples/1.1.x/console-web/examples/users/list-memberships.md +++ b/docs/examples/1.1.x/console-web/examples/users/list-memberships.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/list-sessions.md b/docs/examples/1.1.x/console-web/examples/users/list-sessions.md index 1bb7b88461..c932d6fee7 100644 --- a/docs/examples/1.1.x/console-web/examples/users/list-sessions.md +++ b/docs/examples/1.1.x/console-web/examples/users/list-sessions.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/list.md b/docs/examples/1.1.x/console-web/examples/users/list.md index 9640b5dfcb..49838da24d 100644 --- a/docs/examples/1.1.x/console-web/examples/users/list.md +++ b/docs/examples/1.1.x/console-web/examples/users/list.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-email-verification.md b/docs/examples/1.1.x/console-web/examples/users/update-email-verification.md index bdaa78563e..2abfff8244 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-email-verification.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-email-verification.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-email.md b/docs/examples/1.1.x/console-web/examples/users/update-email.md index 516394bf08..c0427ac6af 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-email.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-email.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-name.md b/docs/examples/1.1.x/console-web/examples/users/update-name.md index 9e7cecd6a3..ed13672a5c 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-name.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-name.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-password.md b/docs/examples/1.1.x/console-web/examples/users/update-password.md index 5e9c314b12..e13d9bcafa 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-password.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-password.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-phone-verification.md b/docs/examples/1.1.x/console-web/examples/users/update-phone-verification.md index c7f7801fa2..63edc56cab 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-phone-verification.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-phone.md b/docs/examples/1.1.x/console-web/examples/users/update-phone.md index 1174f55c42..502bb040fb 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-phone.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-phone.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-prefs.md b/docs/examples/1.1.x/console-web/examples/users/update-prefs.md index 465e6046f2..d1d0a8b1ec 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-prefs.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-prefs.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-status.md b/docs/examples/1.1.x/console-web/examples/users/update-status.md index 9082abcffb..189cbca6d4 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-status.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-status.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/server-kotlin/java/account/create-phone-verification.md b/docs/examples/1.1.x/server-kotlin/java/account/create-phone-verification.md index 949a3c764b..08e28ee63e 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/create-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/create-phone-verification.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.createPhoneVerification(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/create-recovery.md b/docs/examples/1.1.x/server-kotlin/java/account/create-recovery.md index 07bb13584c..83fbe91a95 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/create-recovery.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/create-recovery.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.createRecovery( + email = "email@example.com", + url = "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.createRecovery( - "email@example.com", - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/create-verification.md b/docs/examples/1.1.x/server-kotlin/java/account/create-verification.md index 15d8e4d9cd..2ca770e2e1 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/create-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/create-verification.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.createVerification( + url = "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.createVerification( - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/delete-session.md b/docs/examples/1.1.x/server-kotlin/java/account/delete-session.md index ea3f899f9c..bb925a77e3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/delete-session.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/delete-session.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.deleteSession( + sessionId = "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.deleteSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/delete-sessions.md b/docs/examples/1.1.x/server-kotlin/java/account/delete-sessions.md index 8916b85a22..4cda782b99 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/delete-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/delete-sessions.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.deleteSessions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.deleteSessions(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/get-prefs.md b/docs/examples/1.1.x/server-kotlin/java/account/get-prefs.md index de285877ad..501e2d08c7 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/get-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/get-prefs.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.getPrefs(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.getPrefs(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/get-session.md b/docs/examples/1.1.x/server-kotlin/java/account/get-session.md index 77b7767a43..6f3e9e1a82 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/get-session.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/get-session.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.getSession( + sessionId = "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.getSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/get.md b/docs/examples/1.1.x/server-kotlin/java/account/get.md index 48db0498fb..2429a5d5d9 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/get.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.get(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/list-logs.md b/docs/examples/1.1.x/server-kotlin/java/account/list-logs.md index 65f3b206da..a44e64a3c3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/list-logs.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/list-logs.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.listLogs( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.listLogs( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/list-sessions.md b/docs/examples/1.1.x/server-kotlin/java/account/list-sessions.md index 5294d417bd..41b66ce275 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/list-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/list-sessions.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.listSessions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.listSessions(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-email.md b/docs/examples/1.1.x/server-kotlin/java/account/update-email.md index 4629a17baf..187fa22e2d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-email.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-email.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateEmail( + email = "email@example.com", + password = "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateEmail( - "email@example.com", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-name.md b/docs/examples/1.1.x/server-kotlin/java/account/update-name.md index 4c0579a693..6f15d10e41 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-name.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-name.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateName( + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateName( - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-password.md b/docs/examples/1.1.x/server-kotlin/java/account/update-password.md index 03c5feb54f..5058503b4c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-password.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-password.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updatePassword( + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updatePassword( - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-phone-verification.md b/docs/examples/1.1.x/server-kotlin/java/account/update-phone-verification.md index 2169a61b46..d4716c1173 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-phone-verification.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updatePhoneVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updatePhoneVerification( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-phone.md b/docs/examples/1.1.x/server-kotlin/java/account/update-phone.md index 1b56b7bdb8..40af863e76 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-phone.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-phone.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updatePhone( + phone = "+12065550100", + password = "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updatePhone( - "+12065550100", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-prefs.md b/docs/examples/1.1.x/server-kotlin/java/account/update-prefs.md index ad31ace473..ca085e904c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-prefs.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updatePrefs( + prefs = mapOf( "a" to "b" ) + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updatePrefs( - mapOf( "a" to "b" ) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-recovery.md b/docs/examples/1.1.x/server-kotlin/java/account/update-recovery.md index 94f9216af7..d2b79d3dc5 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-recovery.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-recovery.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateRecovery( + userId = "[USER_ID]", + secret = "[SECRET]", + password = "password", + passwordAgain = "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateRecovery( - "[USER_ID]", - "[SECRET]", - "password", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-session.md b/docs/examples/1.1.x/server-kotlin/java/account/update-session.md index a093bf6f4a..4e41fbb4e1 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-session.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-session.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateSession( + sessionId = "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-status.md b/docs/examples/1.1.x/server-kotlin/java/account/update-status.md index 1f296b9260..6a8e86649f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-status.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-status.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateStatus(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateStatus(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-verification.md b/docs/examples/1.1.x/server-kotlin/java/account/update-verification.md index e5177dc470..0c0eb6c962 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-verification.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateVerification( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-browser.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-browser.md index 279f1cb84c..3042e77002 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-browser.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-browser.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getBrowser( + code = "aa", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getBrowser( - "aa", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-credit-card.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-credit-card.md index 750de69986..956f6b76f3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-credit-card.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getCreditCard( + code = "amex", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getCreditCard( - "amex", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-favicon.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-favicon.md index be2418fd08..35b64fcc0b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-favicon.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-favicon.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getFavicon( + url = "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getFavicon( - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-flag.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-flag.md index 3424345797..ccc90df1e6 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-flag.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-flag.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getFlag( + code = "af", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getFlag( - "af", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-image.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-image.md index 8c8a5cf092..357f6bf29c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-image.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-image.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getImage( + url = "https://example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getImage( - "https://example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-initials.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-initials.md index 345a7e70d8..c6ef8ce8e7 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-initials.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-initials.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getInitials( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getInitials( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-q-r.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-q-r.md index c72eb271dd..07031b38ce 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-q-r.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-q-r.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getQR( + text = "[TEXT]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getQR( - "[TEXT]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-boolean-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-boolean-attribute.md index 9a44dc27cc..008e47a493 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-boolean-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-boolean-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createBooleanAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createBooleanAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-collection.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-collection.md index 6e14c4d214..64b2eca6d0 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-collection.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-collection.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createCollection( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-datetime-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-datetime-attribute.md index 27d5493df1..29d4f1d2ab 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-datetime-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-datetime-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createDatetimeAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createDatetimeAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-document.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-document.md index 5ee69e0512..58819ea4a8 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-document.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-document.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + data = mapOf( "a" to "b" ), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - mapOf( "a" to "b" ), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-email-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-email-attribute.md index bf6e60aa9e..3c79d0bb84 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-email-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-email-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createEmailAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createEmailAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-enum-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-enum-attribute.md index b70ec29ed7..4c58948fbb 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-enum-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-enum-attribute.md @@ -1,26 +1,40 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createEnumAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + elements = listOf(), + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createEnumAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - listOf(), - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-float-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-float-attribute.md index 9c4d60b5a1..0af11fc86b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-float-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-float-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createFloatAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createFloatAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-index.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-index.md index c396a7c462..4b78ce1ed2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-index.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-index.md @@ -1,26 +1,40 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + type = "key", + attributes = listOf(), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createIndex( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - "key", - listOf(), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-integer-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-integer-attribute.md index 86d9bca83a..f6cb49c8dc 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-integer-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-integer-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createIntegerAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createIntegerAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-ip-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-ip-attribute.md index 0fbc87f895..a2c0cd403b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-ip-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-ip-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createIpAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createIpAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-string-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-string-attribute.md index 65bfab776b..8f782ad615 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-string-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-string-attribute.md @@ -1,26 +1,40 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createStringAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + size = 1, + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createStringAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - 1, - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-url-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-url-attribute.md index 1427fee591..09366afc78 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-url-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-url-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createUrlAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createUrlAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create.md b/docs/examples/1.1.x/server-kotlin/java/databases/create.md index ed74fbea0f..e968a53517 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.create( + databaseId = "[DATABASE_ID]", + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.create( - "[DATABASE_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete-attribute.md index 1961089145..b8843ac7ce 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete-attribute.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.deleteAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.deleteAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete-collection.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete-collection.md index bbd6f053e0..e4c999a2af 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete-collection.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete-collection.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.deleteCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.deleteCollection( - "[DATABASE_ID]", - "[COLLECTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete-document.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete-document.md index fa9c8f4bee..71ba4ca7ba 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete-document.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete-document.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.deleteDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.deleteDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete-index.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete-index.md index 83fcd65784..446db766a2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete-index.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete-index.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.deleteIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.deleteIndex( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete.md index 3096ae819f..94c4c30b78 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.delete( + databaseId = "[DATABASE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.delete( - "[DATABASE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/get-attribute.md index bff6826a3c..9be9a32889 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get-attribute.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.getAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.getAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get-collection.md b/docs/examples/1.1.x/server-kotlin/java/databases/get-collection.md index ccfe466236..76e0f796a3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get-collection.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get-collection.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.getCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.getCollection( - "[DATABASE_ID]", - "[COLLECTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get-document.md b/docs/examples/1.1.x/server-kotlin/java/databases/get-document.md index 5461088f85..e5bab16f18 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get-document.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get-document.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.getDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.getDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get-index.md b/docs/examples/1.1.x/server-kotlin/java/databases/get-index.md index 71b6363077..baea8e4011 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get-index.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get-index.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.getIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.getIndex( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get.md b/docs/examples/1.1.x/server-kotlin/java/databases/get.md index 41032825b2..37a3d6d51f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.get( + databaseId = "[DATABASE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.get( - "[DATABASE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list-attributes.md b/docs/examples/1.1.x/server-kotlin/java/databases/list-attributes.md index b9bd7baab1..fbe5fde77a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list-attributes.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list-attributes.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.listAttributes( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.listAttributes( - "[DATABASE_ID]", - "[COLLECTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list-collections.md b/docs/examples/1.1.x/server-kotlin/java/databases/list-collections.md index 07b84560d3..63cfae49e2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list-collections.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list-collections.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.listCollections( + databaseId = "[DATABASE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.listCollections( - "[DATABASE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list-documents.md b/docs/examples/1.1.x/server-kotlin/java/databases/list-documents.md index 4971b99f6a..03b237bba2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list-documents.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list-documents.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.listDocuments( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.listDocuments( - "[DATABASE_ID]", - "[COLLECTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list-indexes.md b/docs/examples/1.1.x/server-kotlin/java/databases/list-indexes.md index 03eeb3f73d..419d118fd7 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list-indexes.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list-indexes.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.listIndexes( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.listIndexes( - "[DATABASE_ID]", - "[COLLECTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list.md b/docs/examples/1.1.x/server-kotlin/java/databases/list.md index fe351bc3a3..cbd316eb0f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/update-collection.md b/docs/examples/1.1.x/server-kotlin/java/databases/update-collection.md index a9fe045f71..d8d7e16dee 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/update-collection.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/update-collection.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.updateCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.updateCollection( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/update-document.md b/docs/examples/1.1.x/server-kotlin/java/databases/update-document.md index 24a20dc8c6..93868d2896 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/update-document.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/update-document.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.updateDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.updateDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/update.md b/docs/examples/1.1.x/server-kotlin/java/databases/update.md index d48903f4d4..43cfce388c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/update.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/update.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.update( + databaseId = "[DATABASE_ID]", + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.update( - "[DATABASE_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create-build.md b/docs/examples/1.1.x/server-kotlin/java/functions/create-build.md index eba921e980..5b1853df0d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create-build.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create-build.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.createBuild( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]", + buildId = "[BUILD_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.createBuild( - "[FUNCTION_ID]", - "[DEPLOYMENT_ID]", - "[BUILD_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create-deployment.md b/docs/examples/1.1.x/server-kotlin/java/functions/create-deployment.md index 1003c6e7e6..bd8a4606cc 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create-deployment.md @@ -1,26 +1,40 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.models.InputFile; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.models.InputFile +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.createDeployment( + functionId = "[FUNCTION_ID]", + entrypoint = "[ENTRYPOINT]", + code = InputFile.fromPath("file.png"), + activate = false + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.createDeployment( - "[FUNCTION_ID]", - "[ENTRYPOINT]", - InputFile.fromPath("file.png"), - false - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create-execution.md b/docs/examples/1.1.x/server-kotlin/java/functions/create-execution.md index dc89de5bb1..eb13aed5c3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create-execution.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create-execution.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.createExecution( + functionId = "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.createExecution( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create-variable.md b/docs/examples/1.1.x/server-kotlin/java/functions/create-variable.md index 5791205ec5..08e572f2b1 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create-variable.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create-variable.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.createVariable( + functionId = "[FUNCTION_ID]", + key = "[KEY]", + value = "[VALUE]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.createVariable( - "[FUNCTION_ID]", - "[KEY]", - "[VALUE]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create.md b/docs/examples/1.1.x/server-kotlin/java/functions/create.md index aac8c64fb1..9448fde2de 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.create( + functionId = "[FUNCTION_ID]", + name = "[NAME]", + execute = listOf("any"), + runtime = "node-14.5", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.create( - "[FUNCTION_ID]", - "[NAME]", - listOf("any"), - "node-14.5", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/delete-deployment.md b/docs/examples/1.1.x/server-kotlin/java/functions/delete-deployment.md index 9a34fa352e..58fbc7cfee 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/delete-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/delete-deployment.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.deleteDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.deleteDeployment( - "[FUNCTION_ID]", - "[DEPLOYMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/delete-variable.md b/docs/examples/1.1.x/server-kotlin/java/functions/delete-variable.md index f55e5f0012..bcb93dd391 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/delete-variable.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/delete-variable.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.deleteVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.deleteVariable( - "[FUNCTION_ID]", - "[VARIABLE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/delete.md b/docs/examples/1.1.x/server-kotlin/java/functions/delete.md index d006a13176..a51709b874 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/delete.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/delete.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.delete( + functionId = "[FUNCTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.delete( - "[FUNCTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/get-deployment.md b/docs/examples/1.1.x/server-kotlin/java/functions/get-deployment.md index 0d0651cf57..276e711bba 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/get-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/get-deployment.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.getDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.getDeployment( - "[FUNCTION_ID]", - "[DEPLOYMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/get-execution.md b/docs/examples/1.1.x/server-kotlin/java/functions/get-execution.md index b8b9b66fad..4161b28eaf 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/get-execution.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/get-execution.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.getExecution( + functionId = "[FUNCTION_ID]", + executionId = "[EXECUTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.getExecution( - "[FUNCTION_ID]", - "[EXECUTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/get-variable.md b/docs/examples/1.1.x/server-kotlin/java/functions/get-variable.md index 7d6320cb30..b6b77c23dc 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/get-variable.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/get-variable.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.getVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.getVariable( - "[FUNCTION_ID]", - "[VARIABLE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/get.md b/docs/examples/1.1.x/server-kotlin/java/functions/get.md index 32aea80181..8e1cd5ef29 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/get.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.get( + functionId = "[FUNCTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.get( - "[FUNCTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list-deployments.md b/docs/examples/1.1.x/server-kotlin/java/functions/list-deployments.md index 60bfd902ef..920684554c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list-deployments.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list-deployments.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.listDeployments( + functionId = "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.listDeployments( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list-executions.md b/docs/examples/1.1.x/server-kotlin/java/functions/list-executions.md index 2c11cee217..915bf64d4b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list-executions.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list-executions.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.listExecutions( + functionId = "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.listExecutions( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list-runtimes.md b/docs/examples/1.1.x/server-kotlin/java/functions/list-runtimes.md index 91739e55f5..e70bd27f76 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list-runtimes.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list-runtimes.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.listRuntimes(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.listRuntimes(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list-variables.md b/docs/examples/1.1.x/server-kotlin/java/functions/list-variables.md index e053e72cdf..abe6f93e3c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list-variables.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list-variables.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.listVariables( + functionId = "[FUNCTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.listVariables( - "[FUNCTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list.md b/docs/examples/1.1.x/server-kotlin/java/functions/list.md index 1dff9a9804..e365f30f1f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/update-deployment.md b/docs/examples/1.1.x/server-kotlin/java/functions/update-deployment.md index ca66695d89..e13f2e2471 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/update-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/update-deployment.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.updateDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.updateDeployment( - "[FUNCTION_ID]", - "[DEPLOYMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/update-variable.md b/docs/examples/1.1.x/server-kotlin/java/functions/update-variable.md index de96ea2bc9..adede4786f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/update-variable.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/update-variable.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.updateVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]", + key = "[KEY]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.updateVariable( - "[FUNCTION_ID]", - "[VARIABLE_ID]", - "[KEY]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/update.md b/docs/examples/1.1.x/server-kotlin/java/functions/update.md index 8157cbb5f9..a9b1f9f787 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/update.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/update.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.update( + functionId = "[FUNCTION_ID]", + name = "[NAME]", + execute = listOf("any"), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.update( - "[FUNCTION_ID]", - "[NAME]", - listOf("any"), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-antivirus.md b/docs/examples/1.1.x/server-kotlin/java/health/get-antivirus.md index ddabb1910b..3a40f730a2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-antivirus.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-antivirus.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getAntivirus(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getAntivirus(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-cache.md b/docs/examples/1.1.x/server-kotlin/java/health/get-cache.md index d80ed9dcdc..e7300a34f4 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-cache.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-cache.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getCache(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getCache(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-d-b.md b/docs/examples/1.1.x/server-kotlin/java/health/get-d-b.md index f4a262bda4..9644806bd2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-d-b.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-d-b.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getDB(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getDB(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-certificates.md b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-certificates.md index ac3ed093d4..084576b65a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-certificates.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-certificates.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getQueueCertificates(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getQueueCertificates(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-functions.md b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-functions.md index f80c151318..9809a03d2f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-functions.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-functions.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getQueueFunctions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getQueueFunctions(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-logs.md b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-logs.md index e639e43505..4a08fa9321 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-logs.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-logs.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getQueueLogs(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getQueueLogs(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-webhooks.md b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-webhooks.md index 120cb1c4c9..d8bc27a2bf 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-webhooks.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-webhooks.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getQueueWebhooks(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getQueueWebhooks(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-storage-local.md b/docs/examples/1.1.x/server-kotlin/java/health/get-storage-local.md index 9ecaf9a739..079eca49e1 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-storage-local.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-storage-local.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getStorageLocal(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getStorageLocal(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-time.md b/docs/examples/1.1.x/server-kotlin/java/health/get-time.md index d28bcac0f5..a8ca3b91de 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-time.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-time.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getTime(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getTime(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get.md b/docs/examples/1.1.x/server-kotlin/java/health/get.md index da31c13879..30adbbbf60 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.get(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/get.md b/docs/examples/1.1.x/server-kotlin/java/locale/get.md index ea30543905..bf2f34fb02 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/get.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.get(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-continents.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-continents.md index 888d85c597..479d82fc5c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-continents.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-continents.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listContinents(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listContinents(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-e-u.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-e-u.md index 5bf264a5f4..ac702cda1f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-e-u.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listCountriesEU(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-phones.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-phones.md index f872d4280c..a16ca213c7 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-phones.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listCountriesPhones(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries.md index 6be2b8eeaf..85271a7a92 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listCountries(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listCountries(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-currencies.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-currencies.md index f954b8118b..9afff9416a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-currencies.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-currencies.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listCurrencies(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listCurrencies(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-languages.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-languages.md index a5fc966d51..71457d837a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-languages.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-languages.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listLanguages(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listLanguages(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/create-bucket.md b/docs/examples/1.1.x/server-kotlin/java/storage/create-bucket.md index 159d5c25fa..6d792e5f5b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/create-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/create-bucket.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.createBucket( + bucketId = "[BUCKET_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.createBucket( - "[BUCKET_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/create-file.md b/docs/examples/1.1.x/server-kotlin/java/storage/create-file.md index 35e4573496..7924fb255f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/create-file.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/create-file.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.models.InputFile; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.models.InputFile +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.createFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + file = InputFile.fromPath("file.png"), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.createFile( - "[BUCKET_ID]", - "[FILE_ID]", - InputFile.fromPath("file.png"), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/delete-bucket.md b/docs/examples/1.1.x/server-kotlin/java/storage/delete-bucket.md index e8cb06f141..5d00b7bc6d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/delete-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/delete-bucket.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.deleteBucket( + bucketId = "[BUCKET_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.deleteBucket( - "[BUCKET_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/delete-file.md b/docs/examples/1.1.x/server-kotlin/java/storage/delete-file.md index 6f6c29a651..3d41866c53 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/delete-file.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/delete-file.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.deleteFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.deleteFile( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-bucket.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-bucket.md index da54b6fb8d..c8b92bda98 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-bucket.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getBucket( + bucketId = "[BUCKET_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getBucket( - "[BUCKET_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-download.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-download.md index 856818ea08..b116d5bb7b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-download.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-download.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getFileDownload( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getFileDownload( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-preview.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-preview.md index fe31fd8b73..32284dc7e3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-preview.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-preview.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getFilePreview( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getFilePreview( - "[BUCKET_ID]", - "[FILE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-view.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-view.md index d7b52635ac..0332da5e89 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-view.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-view.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getFileView( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getFileView( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-file.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-file.md index 2019cea62e..61e3d6c20c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-file.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-file.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getFile( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/list-buckets.md b/docs/examples/1.1.x/server-kotlin/java/storage/list-buckets.md index 30e689a8f0..ffce5eb986 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/list-buckets.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/list-buckets.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.listBuckets( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.listBuckets( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/list-files.md b/docs/examples/1.1.x/server-kotlin/java/storage/list-files.md index 3fde8592f2..de33a00b46 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/list-files.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/list-files.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.listFiles( + bucketId = "[BUCKET_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.listFiles( - "[BUCKET_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/update-bucket.md b/docs/examples/1.1.x/server-kotlin/java/storage/update-bucket.md index e722847f95..d2c6991287 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/update-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/update-bucket.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.updateBucket( + bucketId = "[BUCKET_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.updateBucket( - "[BUCKET_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/update-file.md b/docs/examples/1.1.x/server-kotlin/java/storage/update-file.md index 785bc56093..e1c2ed440c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/update-file.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/update-file.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.updateFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.updateFile( - "[BUCKET_ID]", - "[FILE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/create-membership.md b/docs/examples/1.1.x/server-kotlin/java/teams/create-membership.md index f4afed4c42..077ce3f058 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/create-membership.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/create-membership.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.createMembership( + teamId = "[TEAM_ID]", + email = "email@example.com", + roles = listOf(), + url = "https://example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.createMembership( - "[TEAM_ID]", - "email@example.com", - listOf(), - "https://example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/create.md b/docs/examples/1.1.x/server-kotlin/java/teams/create.md index 48ec37dfd4..3cc1f9d19d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/create.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/create.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.create( + teamId = "[TEAM_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.create( - "[TEAM_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/delete-membership.md b/docs/examples/1.1.x/server-kotlin/java/teams/delete-membership.md index 5039300b4f..7a57a32d9a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/delete-membership.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/delete-membership.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.deleteMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.deleteMembership( - "[TEAM_ID]", - "[MEMBERSHIP_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/delete.md b/docs/examples/1.1.x/server-kotlin/java/teams/delete.md index 012dde8be2..7ace480161 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/delete.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/delete.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.delete( + teamId = "[TEAM_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.delete( - "[TEAM_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/get-membership.md b/docs/examples/1.1.x/server-kotlin/java/teams/get-membership.md index dbf871179f..5d4890693d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/get-membership.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/get-membership.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.getMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.getMembership( - "[TEAM_ID]", - "[MEMBERSHIP_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/get.md b/docs/examples/1.1.x/server-kotlin/java/teams/get.md index b997f2506a..23f52dc5c5 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/get.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.get( + teamId = "[TEAM_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.get( - "[TEAM_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/list-memberships.md b/docs/examples/1.1.x/server-kotlin/java/teams/list-memberships.md index 29fd16ec7a..881b325d99 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/list-memberships.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/list-memberships.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.listMemberships( + teamId = "[TEAM_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.listMemberships( - "[TEAM_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/list.md b/docs/examples/1.1.x/server-kotlin/java/teams/list.md index 29e2dd594f..2a7bf89f6e 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/list.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/list.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-roles.md b/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-roles.md index 79615e199e..7e8d68283d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-roles.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.updateMembershipRoles( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + roles = listOf() + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.updateMembershipRoles( - "[TEAM_ID]", - "[MEMBERSHIP_ID]", - listOf() - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-status.md b/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-status.md index 6fbb53c5d6..0a528d4d81 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-status.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-status.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.updateMembershipStatus( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + userId = "[USER_ID]", + secret = "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.updateMembershipStatus( - "[TEAM_ID]", - "[MEMBERSHIP_ID]", - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/update.md b/docs/examples/1.1.x/server-kotlin/java/teams/update.md index b8ca109237..5c05d6a65f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/update.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/update.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.update( + teamId = "[TEAM_ID]", + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.update( - "[TEAM_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-argon2user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-argon2user.md index 6b55edf749..04a93bb94b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-argon2user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-argon2user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createArgon2User( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createArgon2User( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-bcrypt-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-bcrypt-user.md index bfecdbd354..026b4593a2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-bcrypt-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-bcrypt-user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createBcryptUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createBcryptUser( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-m-d5user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-m-d5user.md index 993390dd07..06b0ee0a38 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-m-d5user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-m-d5user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createMD5User( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createMD5User( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-p-h-pass-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-p-h-pass-user.md index d6a3982d58..5dcc377297 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-p-h-pass-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-p-h-pass-user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createPHPassUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createPHPassUser( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-s-h-a-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-s-h-a-user.md index bcc79e5546..2bb0c18c31 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-s-h-a-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-s-h-a-user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createSHAUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createSHAUser( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-modified-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-modified-user.md index dfd588f23e..2c0c73f72f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-modified-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-modified-user.md @@ -1,27 +1,41 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createScryptModifiedUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + passwordSalt = "[PASSWORD_SALT]", + passwordSaltSeparator = "[PASSWORD_SALT_SEPARATOR]", + passwordSignerKey = "[PASSWORD_SIGNER_KEY]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createScryptModifiedUser( - "[USER_ID]", - "email@example.com", - "password", - "[PASSWORD_SALT]", - "[PASSWORD_SALT_SEPARATOR]", - "[PASSWORD_SIGNER_KEY]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-user.md index 3b37033525..74143e9523 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-user.md @@ -1,29 +1,43 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createScryptUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + passwordSalt = "[PASSWORD_SALT]", + passwordCpu = 0, + passwordMemory = 0, + passwordParallel = 0, + passwordLength = 0, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createScryptUser( - "[USER_ID]", - "email@example.com", - "password", - "[PASSWORD_SALT]", - 0, - 0, - 0, - 0, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create.md b/docs/examples/1.1.x/server-kotlin/java/users/create.md index 6ceaaf11d2..e52912555b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.create( + userId = "[USER_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.create( - "[USER_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/delete-session.md b/docs/examples/1.1.x/server-kotlin/java/users/delete-session.md index 8f10fce2bb..7295506bc2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/delete-session.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/delete-session.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.deleteSession( + userId = "[USER_ID]", + sessionId = "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.deleteSession( - "[USER_ID]", - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/delete-sessions.md b/docs/examples/1.1.x/server-kotlin/java/users/delete-sessions.md index 2f409ae3c6..6fb4028c37 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/delete-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/delete-sessions.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.deleteSessions( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.deleteSessions( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/delete.md b/docs/examples/1.1.x/server-kotlin/java/users/delete.md index db85c034e1..f004170a1e 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/delete.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/delete.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.delete( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.delete( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/get-prefs.md b/docs/examples/1.1.x/server-kotlin/java/users/get-prefs.md index 376aed1ec8..d45fbf4682 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/get-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/get-prefs.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.getPrefs( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.getPrefs( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/get.md b/docs/examples/1.1.x/server-kotlin/java/users/get.md index 55b834335f..98b3df0680 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/get.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.get( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.get( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/list-logs.md b/docs/examples/1.1.x/server-kotlin/java/users/list-logs.md index ac58021b3e..38051cbacd 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/list-logs.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/list-logs.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.listLogs( + userId = "[USER_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.listLogs( - "[USER_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/list-memberships.md b/docs/examples/1.1.x/server-kotlin/java/users/list-memberships.md index 1987671a36..d2f21bc0bd 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/list-memberships.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/list-memberships.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.listMemberships( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.listMemberships( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/list-sessions.md b/docs/examples/1.1.x/server-kotlin/java/users/list-sessions.md index 9c756927fd..9adadf686f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/list-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/list-sessions.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.listSessions( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.listSessions( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/list.md b/docs/examples/1.1.x/server-kotlin/java/users/list.md index 469a47f9a9..f0c4710b65 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/list.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/list.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-email-verification.md b/docs/examples/1.1.x/server-kotlin/java/users/update-email-verification.md index 02df31045a..b7278cad38 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-email-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-email-verification.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updateEmailVerification( + userId = "[USER_ID]", + emailVerification = false + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updateEmailVerification( - "[USER_ID]", - false - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-email.md b/docs/examples/1.1.x/server-kotlin/java/users/update-email.md index 0003961b85..c023caa014 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-email.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-email.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updateEmail( + userId = "[USER_ID]", + email = "email@example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updateEmail( - "[USER_ID]", - "email@example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-name.md b/docs/examples/1.1.x/server-kotlin/java/users/update-name.md index 51a3004c2c..cf760ae78a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-name.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-name.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updateName( + userId = "[USER_ID]", + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updateName( - "[USER_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-password.md b/docs/examples/1.1.x/server-kotlin/java/users/update-password.md index 6d6a9d38e0..a8fc3f3c50 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-password.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-password.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updatePassword( + userId = "[USER_ID]", + password = "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updatePassword( - "[USER_ID]", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-phone-verification.md b/docs/examples/1.1.x/server-kotlin/java/users/update-phone-verification.md index 8c93bf9cac..65b6341f1e 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-phone-verification.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updatePhoneVerification( + userId = "[USER_ID]", + phoneVerification = false + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updatePhoneVerification( - "[USER_ID]", - false - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-phone.md b/docs/examples/1.1.x/server-kotlin/java/users/update-phone.md index af12493e87..1ccbd0cbe6 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-phone.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-phone.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updatePhone( + userId = "[USER_ID]", + number = "+12065550100" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updatePhone( - "[USER_ID]", - "+12065550100" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-prefs.md b/docs/examples/1.1.x/server-kotlin/java/users/update-prefs.md index 5ee41f3076..393366cf10 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-prefs.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updatePrefs( + userId = "[USER_ID]", + prefs = mapOf( "a" to "b" ) + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updatePrefs( - "[USER_ID]", - mapOf( "a" to "b" ) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-status.md b/docs/examples/1.1.x/server-kotlin/java/users/update-status.md index 21b4382dab..e847dcedc3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-status.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-status.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updateStatus( + userId = "[USER_ID]", + status = false + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updateStatus( - "[USER_ID]", - false - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-phone-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-phone-verification.md index 888a22db58..c097b00f88 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-phone-verification.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.createPhoneVerification() + val account = Account(client) + val response = account.createPhoneVerification() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-recovery.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-recovery.md index 200c116210..e43eaf8698 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-recovery.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-recovery.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.createRecovery( - email = "email@example.com", - url = "https://example.com" -) + val account = Account(client) + val response = account.createRecovery( + email = "email@example.com", + url = "https://example.com" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-verification.md index 5ee92f6e5c..41f34631b6 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-verification.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.createVerification( - url = "https://example.com" -) + val account = Account(client) + val response = account.createVerification( + url = "https://example.com" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-session.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-session.md index adfae4336f..11b91b05eb 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-session.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-session.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.deleteSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + val response = account.deleteSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-sessions.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-sessions.md index ca281570e0..5ff7c5ce75 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-sessions.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.deleteSessions() + val account = Account(client) + val response = account.deleteSessions() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/get-prefs.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/get-prefs.md index cf13c75d22..8d836f1a83 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/get-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/get-prefs.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.getPrefs() + val account = Account(client) + val response = account.getPrefs() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/get-session.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/get-session.md index f42507b8f5..3a3ae1fbb3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/get-session.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/get-session.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.getSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + val response = account.getSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/get.md index dcaf9e93de..4195939136 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/get.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.get() + val account = Account(client) + val response = account.get() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/list-logs.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/list-logs.md index 415810b7d6..4fa66a9b72 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/list-logs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/list-logs.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.listLogs( -) + val account = Account(client) + val response = account.listLogs( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/list-sessions.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/list-sessions.md index b9bf3fe7a9..ca8f4f67d4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/list-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/list-sessions.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.listSessions() + val account = Account(client) + val response = account.listSessions() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-email.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-email.md index ae67e105c2..b58849393d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-email.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-email.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateEmail( - email = "email@example.com", - password = "password" -) + val account = Account(client) + val response = account.updateEmail( + email = "email@example.com", + password = "password" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-name.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-name.md index fabf584bfd..c54140f26d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-name.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-name.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateName( - name = "[NAME]" -) + val account = Account(client) + val response = account.updateName( + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-password.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-password.md index 0b22998649..3953718593 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-password.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-password.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updatePassword( - password = "password", -) + val account = Account(client) + val response = account.updatePassword( + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone-verification.md index f5a5faf730..1d601ce54b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone-verification.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updatePhoneVerification( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + val response = account.updatePhoneVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone.md index 8de0b542f5..01bb2b8d43 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updatePhone( - phone = "+12065550100", - password = "password" -) + val account = Account(client) + val response = account.updatePhone( + phone = "+12065550100", + password = "password" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-prefs.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-prefs.md index 6c569affda..39696911d8 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-prefs.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updatePrefs( - prefs = mapOf( "a" to "b" ) -) + val account = Account(client) + val response = account.updatePrefs( + prefs = mapOf( "a" to "b" ) + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-recovery.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-recovery.md index f6c5d75d4e..8d2253a5fb 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-recovery.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-recovery.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateRecovery( - userId = "[USER_ID]", - secret = "[SECRET]", - password = "password", - passwordAgain = "password" -) + val account = Account(client) + val response = account.updateRecovery( + userId = "[USER_ID]", + secret = "[SECRET]", + password = "password", + passwordAgain = "password" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-session.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-session.md index 5b8ee817b0..003d80e688 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-session.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-session.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + val response = account.updateSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-status.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-status.md index 99996a3970..c64ce0c26f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-status.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-status.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateStatus() + val account = Account(client) + val response = account.updateStatus() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-verification.md index ba86276f22..f904f6d2ce 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-verification.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateVerification( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + val response = account.updateVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-browser.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-browser.md index 9fe8b3e76f..d021a952e4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-browser.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-browser.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getBrowser( - code = "aa", -) + val avatars = Avatars(client) + val result = avatars.getBrowser( + code = "aa", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-credit-card.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-credit-card.md index cdf31a270e..61592bc3d9 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-credit-card.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getCreditCard( - code = "amex", -) + val avatars = Avatars(client) + val result = avatars.getCreditCard( + code = "amex", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-favicon.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-favicon.md index 888ba71fa1..3714ac210a 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-favicon.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-favicon.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getFavicon( - url = "https://example.com" -) + val avatars = Avatars(client) + val result = avatars.getFavicon( + url = "https://example.com" + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-flag.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-flag.md index cf3ef4cc38..0efd3c9974 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-flag.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-flag.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getFlag( - code = "af", -) + val avatars = Avatars(client) + val result = avatars.getFlag( + code = "af", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-image.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-image.md index 2de2d65630..0d3f855617 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-image.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-image.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getImage( - url = "https://example.com", -) + val avatars = Avatars(client) + val result = avatars.getImage( + url = "https://example.com", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-initials.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-initials.md index efbd55d31f..de5a30c5c1 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-initials.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-initials.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getInitials( -) + val avatars = Avatars(client) + val result = avatars.getInitials( + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-q-r.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-q-r.md index ab4b35ee78..008922575d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-q-r.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-q-r.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getQR( - text = "[TEXT]", -) + val avatars = Avatars(client) + val result = avatars.getQR( + text = "[TEXT]", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-boolean-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-boolean-attribute.md index 47f5913811..bfcd659979 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-boolean-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-boolean-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createBooleanAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createBooleanAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-collection.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-collection.md index c7ba19fcd7..1e31833d1e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-collection.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-collection.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createCollection( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - name = "[NAME]", -) + val databases = Databases(client) + val response = databases.createCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-datetime-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-datetime-attribute.md index a76f930ee2..c9d45b461d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-datetime-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-datetime-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createDatetimeAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createDatetimeAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-document.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-document.md index ea61d6de17..91519fd570 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-document.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-document.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), -) + val databases = Databases(client) + val response = databases.createDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + data = mapOf( "a" to "b" ), + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-email-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-email-attribute.md index 52a2f3f57f..5dbdd1c769 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-email-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-email-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createEmailAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createEmailAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-enum-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-enum-attribute.md index c8d2304c4b..afb91ed73c 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-enum-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-enum-attribute.md @@ -1,17 +1,19 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createEnumAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - elements = listOf(), - required = false, -) + val databases = Databases(client) + val response = databases.createEnumAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + elements = listOf(), + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-float-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-float-attribute.md index 52caba7a55..e80aa4289a 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-float-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-float-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createFloatAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createFloatAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-index.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-index.md index 01aa222ac4..d3e99bfdcc 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-index.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-index.md @@ -1,17 +1,19 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createIndex( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - type = "key", - attributes = listOf(), -) + val databases = Databases(client) + val response = databases.createIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + type = "key", + attributes = listOf(), + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-integer-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-integer-attribute.md index ddf85f6b3b..81d6d108bf 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-integer-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-integer-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createIntegerAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createIntegerAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-ip-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-ip-attribute.md index 77e6f37ffb..fa5a3c5eaa 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-ip-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-ip-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createIpAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createIpAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-string-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-string-attribute.md index 0cb036e4de..285afc1b31 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-string-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-string-attribute.md @@ -1,17 +1,19 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createStringAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - size = 1, - required = false, -) + val databases = Databases(client) + val response = databases.createStringAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + size = 1, + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-url-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-url-attribute.md index 403e93e2a7..182f63d6ff 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-url-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-url-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createUrlAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createUrlAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create.md index 3a37ddc43c..7a93045eb6 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.create( - databaseId = "[DATABASE_ID]", - name = "[NAME]" -) + val databases = Databases(client) + val response = databases.create( + databaseId = "[DATABASE_ID]", + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-attribute.md index 6fad48dd77..e83088bdef 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-attribute.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.deleteAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "" -) + val databases = Databases(client) + val response = databases.deleteAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-collection.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-collection.md index a03b75c7eb..95e31e3256 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-collection.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-collection.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.deleteCollection( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]" -) + val databases = Databases(client) + val response = databases.deleteCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-document.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-document.md index 93334b3b34..d085c38dfc 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-document.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-document.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.deleteDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" -) + val databases = Databases(client) + val response = databases.deleteDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-index.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-index.md index 9e68f8b5e2..ccb718146f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-index.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-index.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.deleteIndex( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "" -) + val databases = Databases(client) + val response = databases.deleteIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete.md index f7aae2e655..96bb1acf68 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.delete( - databaseId = "[DATABASE_ID]" -) + val databases = Databases(client) + val response = databases.delete( + databaseId = "[DATABASE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-attribute.md index 59f3890e53..acedd9ef9a 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-attribute.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.getAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "" -) + val databases = Databases(client) + val response = databases.getAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-collection.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-collection.md index 6086698a82..8165a3ae97 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-collection.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-collection.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.getCollection( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]" -) + val databases = Databases(client) + val response = databases.getCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-document.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-document.md index 8c3ce7cb81..671d7302cb 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-document.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-document.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.getDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" -) + val databases = Databases(client) + val response = databases.getDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-index.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-index.md index 3e7315b3b8..1f5079c800 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-index.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-index.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.getIndex( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "" -) + val databases = Databases(client) + val response = databases.getIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get.md index 0bd67f6fb8..f8ad2647ed 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.get( - databaseId = "[DATABASE_ID]" -) + val databases = Databases(client) + val response = databases.get( + databaseId = "[DATABASE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-attributes.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-attributes.md index 5652bcb442..65e43d8b76 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-attributes.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-attributes.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.listAttributes( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]" -) + val databases = Databases(client) + val response = databases.listAttributes( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-collections.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-collections.md index 7b37719e6a..c72512f97b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-collections.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-collections.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.listCollections( - databaseId = "[DATABASE_ID]", -) + val databases = Databases(client) + val response = databases.listCollections( + databaseId = "[DATABASE_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-documents.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-documents.md index be97089801..d28ee1bb0f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-documents.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-documents.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.listDocuments( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", -) + val databases = Databases(client) + val response = databases.listDocuments( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-indexes.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-indexes.md index 0b3459544c..0cd2fc8617 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-indexes.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-indexes.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.listIndexes( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]" -) + val databases = Databases(client) + val response = databases.listIndexes( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list.md index 9997b5b5fa..b4ece0a1a3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.list( -) + val databases = Databases(client) + val response = databases.list( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-collection.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-collection.md index dc15ceadc4..a28d88634b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-collection.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-collection.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.updateCollection( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - name = "[NAME]", -) + val databases = Databases(client) + val response = databases.updateCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-document.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-document.md index 9337f56657..8121fdd07c 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-document.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-document.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.updateDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", -) + val databases = Databases(client) + val response = databases.updateDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update.md index 995d681ae9..0e0adee643 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.update( - databaseId = "[DATABASE_ID]", - name = "[NAME]" -) + val databases = Databases(client) + val response = databases.update( + databaseId = "[DATABASE_ID]", + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-build.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-build.md index 4cb3323796..b19c04528b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-build.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-build.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.createBuild( - functionId = "[FUNCTION_ID]", - deploymentId = "[DEPLOYMENT_ID]", - buildId = "[BUILD_ID]" -) + val functions = Functions(client) + val response = functions.createBuild( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]", + buildId = "[BUILD_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-deployment.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-deployment.md index d63625c89e..9a2dc43359 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-deployment.md @@ -2,16 +2,18 @@ import io.appwrite.Client import io.appwrite.models.InputFile import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.createDeployment( - functionId = "[FUNCTION_ID]", - entrypoint = "[ENTRYPOINT]", - code = InputFile.fromPath("file.png"), - activate = false -) + val functions = Functions(client) + val response = functions.createDeployment( + functionId = "[FUNCTION_ID]", + entrypoint = "[ENTRYPOINT]", + code = InputFile.fromPath("file.png"), + activate = false + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-execution.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-execution.md index 086983e620..eeda8daf3e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-execution.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-execution.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.createExecution( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + val response = functions.createExecution( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-variable.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-variable.md index a059845fd4..416e1d09b7 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-variable.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-variable.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.createVariable( - functionId = "[FUNCTION_ID]", - key = "[KEY]", - value = "[VALUE]" -) + val functions = Functions(client) + val response = functions.createVariable( + functionId = "[FUNCTION_ID]", + key = "[KEY]", + value = "[VALUE]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create.md index 9456721680..280b3ec132 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.create( - functionId = "[FUNCTION_ID]", - name = "[NAME]", - execute = listOf("any"), - runtime = "node-14.5", -) + val functions = Functions(client) + val response = functions.create( + functionId = "[FUNCTION_ID]", + name = "[NAME]", + execute = listOf("any"), + runtime = "node-14.5", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-deployment.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-deployment.md index 334ad44d37..cc90059f85 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-deployment.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.deleteDeployment( - functionId = "[FUNCTION_ID]", - deploymentId = "[DEPLOYMENT_ID]" -) + val functions = Functions(client) + val response = functions.deleteDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-variable.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-variable.md index f823e06231..8ca7af63e5 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-variable.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-variable.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.deleteVariable( - functionId = "[FUNCTION_ID]", - variableId = "[VARIABLE_ID]" -) + val functions = Functions(client) + val response = functions.deleteVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete.md index 56ce7c0744..40a7e9682f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.delete( - functionId = "[FUNCTION_ID]" -) + val functions = Functions(client) + val response = functions.delete( + functionId = "[FUNCTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-deployment.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-deployment.md index 9f0d5a7b4e..fa6175271e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-deployment.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.getDeployment( - functionId = "[FUNCTION_ID]", - deploymentId = "[DEPLOYMENT_ID]" -) + val functions = Functions(client) + val response = functions.getDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-execution.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-execution.md index 3905ef28a1..d23e20766e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-execution.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-execution.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.getExecution( - functionId = "[FUNCTION_ID]", - executionId = "[EXECUTION_ID]" -) + val functions = Functions(client) + val response = functions.getExecution( + functionId = "[FUNCTION_ID]", + executionId = "[EXECUTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-variable.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-variable.md index 4b5844ec1c..d277bbb735 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-variable.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-variable.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.getVariable( - functionId = "[FUNCTION_ID]", - variableId = "[VARIABLE_ID]" -) + val functions = Functions(client) + val response = functions.getVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get.md index 6ccb9c0774..76a45b6b26 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.get( - functionId = "[FUNCTION_ID]" -) + val functions = Functions(client) + val response = functions.get( + functionId = "[FUNCTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-deployments.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-deployments.md index 349f43eb78..be30acacef 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-deployments.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-deployments.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.listDeployments( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + val response = functions.listDeployments( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-executions.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-executions.md index 2374601d8f..2427a97644 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-executions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-executions.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.listExecutions( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + val response = functions.listExecutions( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-runtimes.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-runtimes.md index ee853d30fa..7236d74475 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-runtimes.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-runtimes.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.listRuntimes() + val functions = Functions(client) + val response = functions.listRuntimes() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-variables.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-variables.md index 1d75a7cf29..a6adc00c6d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-variables.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-variables.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.listVariables( - functionId = "[FUNCTION_ID]" -) + val functions = Functions(client) + val response = functions.listVariables( + functionId = "[FUNCTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list.md index abe4b24902..1fb1f54a3c 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.list( -) + val functions = Functions(client) + val response = functions.list( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-deployment.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-deployment.md index ec6eeb2e68..fd7a40b2ec 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-deployment.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.updateDeployment( - functionId = "[FUNCTION_ID]", - deploymentId = "[DEPLOYMENT_ID]" -) + val functions = Functions(client) + val response = functions.updateDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-variable.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-variable.md index cca000d758..1cc5563c87 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-variable.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-variable.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.updateVariable( - functionId = "[FUNCTION_ID]", - variableId = "[VARIABLE_ID]", - key = "[KEY]", -) + val functions = Functions(client) + val response = functions.updateVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]", + key = "[KEY]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update.md index ace7b68354..ae5bee1236 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.update( - functionId = "[FUNCTION_ID]", - name = "[NAME]", - execute = listOf("any"), -) + val functions = Functions(client) + val response = functions.update( + functionId = "[FUNCTION_ID]", + name = "[NAME]", + execute = listOf("any"), + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-antivirus.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-antivirus.md index 7818055e7d..fe64ba8ee1 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-antivirus.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-antivirus.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getAntivirus() + val health = Health(client) + val response = health.getAntivirus() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-cache.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-cache.md index 6bda0bfb3e..91dda5e06e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-cache.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-cache.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getCache() + val health = Health(client) + val response = health.getCache() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-d-b.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-d-b.md index 49a983e234..0a15ff78b4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-d-b.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-d-b.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getDB() + val health = Health(client) + val response = health.getDB() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-certificates.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-certificates.md index 12923e30ac..4e51cc625e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-certificates.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-certificates.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getQueueCertificates() + val health = Health(client) + val response = health.getQueueCertificates() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-functions.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-functions.md index 2b0d47a52a..2f49b8f013 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-functions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-functions.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getQueueFunctions() + val health = Health(client) + val response = health.getQueueFunctions() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-logs.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-logs.md index b7a50dd549..0a15075dd7 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-logs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-logs.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getQueueLogs() + val health = Health(client) + val response = health.getQueueLogs() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-webhooks.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-webhooks.md index 64df02ede7..368a4d3cc6 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-webhooks.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-webhooks.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getQueueWebhooks() + val health = Health(client) + val response = health.getQueueWebhooks() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-storage-local.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-storage-local.md index d016deb24b..809c4a92b9 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-storage-local.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-storage-local.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getStorageLocal() + val health = Health(client) + val response = health.getStorageLocal() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-time.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-time.md index c040287f01..9e2b5a9f89 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-time.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-time.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getTime() + val health = Health(client) + val response = health.getTime() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get.md index 0692d55206..5904493e30 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.get() + val health = Health(client) + val response = health.get() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/get.md index e6f78f5f10..d630031194 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/get.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.get() + val locale = Locale(client) + val response = locale.get() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-continents.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-continents.md index 6e533d3dc2..d3f748b1d5 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-continents.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-continents.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listContinents() + val locale = Locale(client) + val response = locale.listContinents() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-e-u.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-e-u.md index 4002981f36..37b19bd551 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-e-u.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listCountriesEU() + val locale = Locale(client) + val response = locale.listCountriesEU() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-phones.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-phones.md index 9002118d19..a001f2a9b3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-phones.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listCountriesPhones() + val locale = Locale(client) + val response = locale.listCountriesPhones() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries.md index ccb09e51b7..54efc257ab 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listCountries() + val locale = Locale(client) + val response = locale.listCountries() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-currencies.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-currencies.md index 677090a327..0875fa8449 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-currencies.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-currencies.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listCurrencies() + val locale = Locale(client) + val response = locale.listCurrencies() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-languages.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-languages.md index 8b363f12ea..a873770896 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-languages.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-languages.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listLanguages() + val locale = Locale(client) + val response = locale.listLanguages() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-bucket.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-bucket.md index 18a9ae00a7..9082399007 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-bucket.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.createBucket( - bucketId = "[BUCKET_ID]", - name = "[NAME]", -) + val storage = Storage(client) + val response = storage.createBucket( + bucketId = "[BUCKET_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-file.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-file.md index 9376d6c9b4..65046d0cc1 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-file.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-file.md @@ -2,15 +2,17 @@ import io.appwrite.Client import io.appwrite.models.InputFile import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.createFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", - file = InputFile.fromPath("file.png"), -) + val storage = Storage(client) + val response = storage.createFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + file = InputFile.fromPath("file.png"), + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-bucket.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-bucket.md index d99a0ee67d..0700ffdb30 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-bucket.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.deleteBucket( - bucketId = "[BUCKET_ID]" -) + val storage = Storage(client) + val response = storage.deleteBucket( + bucketId = "[BUCKET_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-file.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-file.md index 6e98d37705..2749cc2135 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-file.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-file.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.deleteFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + val response = storage.deleteFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-bucket.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-bucket.md index 855daced37..6e421e94af 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-bucket.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.getBucket( - bucketId = "[BUCKET_ID]" -) + val storage = Storage(client) + val response = storage.getBucket( + bucketId = "[BUCKET_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-download.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-download.md index c390616731..5186982a7c 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-download.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-download.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val result = storage.getFileDownload( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + val result = storage.getFileDownload( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-preview.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-preview.md index d2977d4618..d99e28ca94 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-preview.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-preview.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val result = storage.getFilePreview( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", -) + val storage = Storage(client) + val result = storage.getFilePreview( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-view.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-view.md index 49a3d65a24..433364a9c2 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-view.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-view.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val result = storage.getFileView( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + val result = storage.getFileView( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file.md index 2057d11a63..ea76d6f4ac 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.getFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + val response = storage.getFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-buckets.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-buckets.md index 20577467a3..36a0d83232 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-buckets.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-buckets.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.listBuckets( -) + val storage = Storage(client) + val response = storage.listBuckets( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-files.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-files.md index 577643d12e..d84bb4e8c6 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-files.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-files.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.listFiles( - bucketId = "[BUCKET_ID]", -) + val storage = Storage(client) + val response = storage.listFiles( + bucketId = "[BUCKET_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-bucket.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-bucket.md index 773a70aac2..ac25ad0a7f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-bucket.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.updateBucket( - bucketId = "[BUCKET_ID]", - name = "[NAME]", -) + val storage = Storage(client) + val response = storage.updateBucket( + bucketId = "[BUCKET_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-file.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-file.md index ee24542019..a628b54b25 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-file.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-file.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.updateFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", -) + val storage = Storage(client) + val response = storage.updateFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/create-membership.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/create-membership.md index 19432ded9c..ebdd4f3034 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/create-membership.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/create-membership.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.createMembership( - teamId = "[TEAM_ID]", - email = "email@example.com", - roles = listOf(), - url = "https://example.com", -) + val teams = Teams(client) + val response = teams.createMembership( + teamId = "[TEAM_ID]", + email = "email@example.com", + roles = listOf(), + url = "https://example.com", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/create.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/create.md index e69108976c..4b5c5e00e8 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/create.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/create.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.create( - teamId = "[TEAM_ID]", - name = "[NAME]", -) + val teams = Teams(client) + val response = teams.create( + teamId = "[TEAM_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete-membership.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete-membership.md index 1888701c84..fd5cd7485e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete-membership.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete-membership.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.deleteMembership( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]" -) + val teams = Teams(client) + val response = teams.deleteMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete.md index 05440a9702..3806a5e7b8 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.delete( - teamId = "[TEAM_ID]" -) + val teams = Teams(client) + val response = teams.delete( + teamId = "[TEAM_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/get-membership.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/get-membership.md index 79f3b3d608..a0788b2489 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/get-membership.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/get-membership.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.getMembership( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]" -) + val teams = Teams(client) + val response = teams.getMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/get.md index ddc6851da4..c8802a7133 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/get.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.get( - teamId = "[TEAM_ID]" -) + val teams = Teams(client) + val response = teams.get( + teamId = "[TEAM_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/list-memberships.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/list-memberships.md index 6bccd89218..a31428d100 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/list-memberships.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/list-memberships.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.listMemberships( - teamId = "[TEAM_ID]", -) + val teams = Teams(client) + val response = teams.listMemberships( + teamId = "[TEAM_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/list.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/list.md index 8670cc74a8..7aff26e811 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/list.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/list.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.list( -) + val teams = Teams(client) + val response = teams.list( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-roles.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-roles.md index b6bd4db63d..f76601adc4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-roles.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.updateMembershipRoles( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]", - roles = listOf() -) + val teams = Teams(client) + val response = teams.updateMembershipRoles( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + roles = listOf() + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-status.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-status.md index c57222d4c2..56b7dc71c3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-status.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-status.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val teams = Teams(client) - -val response = teams.updateMembershipStatus( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]", - userId = "[USER_ID]", - secret = "[SECRET]" -) + val teams = Teams(client) + val response = teams.updateMembershipStatus( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update.md index 50a315cba6..a558a35216 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.update( - teamId = "[TEAM_ID]", - name = "[NAME]" -) + val teams = Teams(client) + val response = teams.update( + teamId = "[TEAM_ID]", + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-argon2user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-argon2user.md index 6045e15524..13c9d289ce 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-argon2user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-argon2user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createArgon2User( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createArgon2User( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-bcrypt-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-bcrypt-user.md index fa4c6e96e2..061a7a8bac 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-bcrypt-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-bcrypt-user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createBcryptUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createBcryptUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-m-d5user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-m-d5user.md index 75e10456c6..e660302c03 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-m-d5user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-m-d5user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createMD5User( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createMD5User( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-p-h-pass-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-p-h-pass-user.md index 832d6a9bac..3434533569 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-p-h-pass-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-p-h-pass-user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createPHPassUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createPHPassUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-s-h-a-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-s-h-a-user.md index fc005e576f..f057c24860 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-s-h-a-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-s-h-a-user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createSHAUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createSHAUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md index aba7d2e112..42bb6a6df4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md @@ -1,18 +1,20 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createScryptModifiedUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", - passwordSalt = "[PASSWORD_SALT]", - passwordSaltSeparator = "[PASSWORD_SALT_SEPARATOR]", - passwordSignerKey = "[PASSWORD_SIGNER_KEY]", -) + val users = Users(client) + val response = users.createScryptModifiedUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + passwordSalt = "[PASSWORD_SALT]", + passwordSaltSeparator = "[PASSWORD_SALT_SEPARATOR]", + passwordSignerKey = "[PASSWORD_SIGNER_KEY]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-user.md index 7a30521bf7..28903db223 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-user.md @@ -1,20 +1,22 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createScryptUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", - passwordSalt = "[PASSWORD_SALT]", - passwordCpu = 0, - passwordMemory = 0, - passwordParallel = 0, - passwordLength = 0, -) + val users = Users(client) + val response = users.createScryptUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + passwordSalt = "[PASSWORD_SALT]", + passwordCpu = 0, + passwordMemory = 0, + passwordParallel = 0, + passwordLength = 0, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create.md index 0cb1c03d2a..a799a14a87 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.create( - userId = "[USER_ID]", -) + val users = Users(client) + val response = users.create( + userId = "[USER_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-session.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-session.md index 89dde91904..b02b7eda74 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-session.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-session.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.deleteSession( - userId = "[USER_ID]", - sessionId = "[SESSION_ID]" -) + val users = Users(client) + val response = users.deleteSession( + userId = "[USER_ID]", + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-sessions.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-sessions.md index 34ad3e3749..969f5f34b2 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-sessions.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.deleteSessions( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.deleteSessions( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete.md index 779e7ab6f3..7d545cd5fc 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.delete( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.delete( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/get-prefs.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/get-prefs.md index c979a44a4e..681bc0053a 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/get-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/get-prefs.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.getPrefs( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.getPrefs( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/get.md index cd02bed1b2..85cf8cd484 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/get.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.get( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.get( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-logs.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-logs.md index 429db0477f..d3b02a11f0 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-logs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-logs.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.listLogs( - userId = "[USER_ID]", -) + val users = Users(client) + val response = users.listLogs( + userId = "[USER_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-memberships.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-memberships.md index 2b23b42097..04c9d2b307 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-memberships.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-memberships.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.listMemberships( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.listMemberships( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-sessions.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-sessions.md index 0a6ff5a892..604d18b11f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-sessions.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.listSessions( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.listSessions( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/list.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/list.md index 6bbe414b0a..4c6f4a8f96 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/list.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/list.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.list( -) + val users = Users(client) + val response = users.list( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email-verification.md index 6027a384bf..f33c5a7a5e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email-verification.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updateEmailVerification( - userId = "[USER_ID]", - emailVerification = false -) + val users = Users(client) + val response = users.updateEmailVerification( + userId = "[USER_ID]", + emailVerification = false + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email.md index 897aea58f1..eabab2f2af 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updateEmail( - userId = "[USER_ID]", - email = "email@example.com" -) + val users = Users(client) + val response = users.updateEmail( + userId = "[USER_ID]", + email = "email@example.com" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-name.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-name.md index 7b04e7de6d..f4ce93b30b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-name.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-name.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updateName( - userId = "[USER_ID]", - name = "[NAME]" -) + val users = Users(client) + val response = users.updateName( + userId = "[USER_ID]", + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-password.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-password.md index b5e10a84a7..6e6122e297 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-password.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-password.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updatePassword( - userId = "[USER_ID]", - password = "password" -) + val users = Users(client) + val response = users.updatePassword( + userId = "[USER_ID]", + password = "password" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone-verification.md index 40539addec..b237adbcbd 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone-verification.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updatePhoneVerification( - userId = "[USER_ID]", - phoneVerification = false -) + val users = Users(client) + val response = users.updatePhoneVerification( + userId = "[USER_ID]", + phoneVerification = false + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone.md index fe6427dbf9..eccd9009aa 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updatePhone( - userId = "[USER_ID]", - number = "+12065550100" -) + val users = Users(client) + val response = users.updatePhone( + userId = "[USER_ID]", + number = "+12065550100" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-prefs.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-prefs.md index 83442ad387..27c669b141 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-prefs.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updatePrefs( - userId = "[USER_ID]", - prefs = mapOf( "a" to "b" ) -) + val users = Users(client) + val response = users.updatePrefs( + userId = "[USER_ID]", + prefs = mapOf( "a" to "b" ) + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-status.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-status.md index ccf1495026..927e76bee3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-status.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-status.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updateStatus( - userId = "[USER_ID]", - status = false -) + val users = Users(client) + val response = users.updateStatus( + userId = "[USER_ID]", + status = false + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-swift/examples/account/create-phone-verification.md b/docs/examples/1.1.x/server-swift/examples/account/create-phone-verification.md index 9730ff0e9e..79b76da109 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/create-phone-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/account/create-phone-verification.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.createPhoneVerification() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.createPhoneVerification() + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/create-recovery.md b/docs/examples/1.1.x/server-swift/examples/account/create-recovery.md index 7d17a3a507..e0048ea302 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/create-recovery.md +++ b/docs/examples/1.1.x/server-swift/examples/account/create-recovery.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.createRecovery( - email: "email@example.com", - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.createRecovery( + email: "email@example.com", + url: "https://example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/create-verification.md b/docs/examples/1.1.x/server-swift/examples/account/create-verification.md index 96dcd813e9..530dc6638d 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/create-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/account/create-verification.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.createVerification( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.createVerification( + url: "https://example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/delete-session.md b/docs/examples/1.1.x/server-swift/examples/account/delete-session.md index 734d2bdd83..38cdf4ac38 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/delete-session.md +++ b/docs/examples/1.1.x/server-swift/examples/account/delete-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let result = try await account.deleteSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let result = try await account.deleteSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/delete-sessions.md b/docs/examples/1.1.x/server-swift/examples/account/delete-sessions.md index 95968a0745..3ea9dc10d8 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/delete-sessions.md +++ b/docs/examples/1.1.x/server-swift/examples/account/delete-sessions.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let result = try await account.deleteSessions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let result = try await account.deleteSessions() + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/get-prefs.md b/docs/examples/1.1.x/server-swift/examples/account/get-prefs.md index 95e0afe3a3..1585b2b940 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/get-prefs.md +++ b/docs/examples/1.1.x/server-swift/examples/account/get-prefs.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let preferences = try await account.getPrefs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let preferences = try await account.getPrefs() + print(String(describing: preferences) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/get-session.md b/docs/examples/1.1.x/server-swift/examples/account/get-session.md index 53c7e280d5..d21b42a702 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/get-session.md +++ b/docs/examples/1.1.x/server-swift/examples/account/get-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let session = try await account.getSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let session = try await account.getSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/get.md b/docs/examples/1.1.x/server-swift/examples/account/get.md index 78992d9b21..ddd54288e9 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/get.md +++ b/docs/examples/1.1.x/server-swift/examples/account/get.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.get() + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/list-logs.md b/docs/examples/1.1.x/server-swift/examples/account/list-logs.md index 990b507998..a2ec84cf53 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/list-logs.md +++ b/docs/examples/1.1.x/server-swift/examples/account/list-logs.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let logList = try await account.listLogs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let logList = try await account.listLogs() + print(String(describing: logList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/list-sessions.md b/docs/examples/1.1.x/server-swift/examples/account/list-sessions.md index 3e1fe0345a..49a90cae72 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/list-sessions.md +++ b/docs/examples/1.1.x/server-swift/examples/account/list-sessions.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let sessionList = try await account.listSessions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let sessionList = try await account.listSessions() + print(String(describing: sessionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-email.md b/docs/examples/1.1.x/server-swift/examples/account/update-email.md index 8b7ddeff06..ac546af4b3 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-email.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-email.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updateEmail( - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updateEmail( + email: "email@example.com", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-name.md b/docs/examples/1.1.x/server-swift/examples/account/update-name.md index e1e7a35634..aaaa1c5876 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-name.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-name.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updateName( - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updateName( + name: "[NAME]" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-password.md b/docs/examples/1.1.x/server-swift/examples/account/update-password.md index d6299e3b27..223891673b 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-password.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-password.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updatePassword( - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updatePassword( + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-phone-verification.md b/docs/examples/1.1.x/server-swift/examples/account/update-phone-verification.md index 34b002d966..47a2d00923 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-phone-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-phone-verification.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.updatePhoneVerification( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.updatePhoneVerification( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-phone.md b/docs/examples/1.1.x/server-swift/examples/account/update-phone.md index 24148c9d29..c126d7790b 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-phone.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-phone.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updatePhone( - phone: "+12065550100", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updatePhone( + phone: "+12065550100", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-prefs.md b/docs/examples/1.1.x/server-swift/examples/account/update-prefs.md index 6eb5e09113..9babfecf18 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-prefs.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-prefs.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updatePrefs( - prefs: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updatePrefs( + prefs: [:] + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-recovery.md b/docs/examples/1.1.x/server-swift/examples/account/update-recovery.md index 9d44547668..2814bf124f 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-recovery.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-recovery.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.updateRecovery( - userId: "[USER_ID]", - secret: "[SECRET]", - password: "password", - passwordAgain: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.updateRecovery( + userId: "[USER_ID]", + secret: "[SECRET]", + password: "password", + passwordAgain: "password" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-session.md b/docs/examples/1.1.x/server-swift/examples/account/update-session.md index c7df4e4626..8ce9c3ce79 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-session.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let session = try await account.updateSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let session = try await account.updateSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-status.md b/docs/examples/1.1.x/server-swift/examples/account/update-status.md index 7998eee480..eb5a0fee27 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-status.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-status.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updateStatus() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updateStatus() + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-verification.md b/docs/examples/1.1.x/server-swift/examples/account/update-verification.md index d325f03c52..b8255614e6 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-verification.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.updateVerification( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.updateVerification( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-browser.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-browser.md index 59e256ff91..fe5be8cfa4 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-browser.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-browser.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getBrowser( - code: "aa" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getBrowser( + code: "aa" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-credit-card.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-credit-card.md index 9bdc25edc7..ad5296d06c 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-credit-card.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getCreditCard( - code: "amex" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getCreditCard( + code: "amex" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-favicon.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-favicon.md index e96239b5c4..c7cdfa7142 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-favicon.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-favicon.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getFavicon( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getFavicon( + url: "https://example.com" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-flag.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-flag.md index e50498c2a3..7e8e94b4c5 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-flag.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-flag.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getFlag( - code: "af" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getFlag( + code: "af" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-image.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-image.md index cd63a62744..63ba881d4b 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-image.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-image.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getImage( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getImage( + url: "https://example.com" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-initials.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-initials.md index bfc06f838f..e783f5b47d 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-initials.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-initials.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getInitials() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getInitials() + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-q-r.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-q-r.md index 99bc5be320..ae8d51c0a3 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-q-r.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-q-r.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getQR( - text: "[TEXT]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getQR( + text: "[TEXT]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-boolean-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-boolean-attribute.md index ef5e3bbdd1..2e8f78fa8c 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-boolean-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-boolean-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeBoolean = try await databases.createBooleanAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeBoolean = try await databases.createBooleanAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeBoolean) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-collection.md b/docs/examples/1.1.x/server-swift/examples/databases/create-collection.md index d406c194a5..2f279c853f 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-collection.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-collection.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let collection = try await databases.createCollection( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let collection = try await databases.createCollection( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + name: "[NAME]" + ) + print(String(describing: collection) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-datetime-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-datetime-attribute.md index 2baad28f56..f2487f996a 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-datetime-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-datetime-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeDatetime = try await databases.createDatetimeAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeDatetime = try await databases.createDatetimeAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeDatetime) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-document.md b/docs/examples/1.1.x/server-swift/examples/databases/create-document.md index 1d8f604c8d..b93d97ade2 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-document.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-document.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let document = try await databases.createDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]", - data: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let document = try await databases.createDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]", + data: [:] + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-email-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-email-attribute.md index 9e1746c5bd..c2bcb218dd 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-email-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-email-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeEmail = try await databases.createEmailAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeEmail = try await databases.createEmailAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeEmail) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-enum-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-enum-attribute.md index ba538ebcfd..def8bff0bc 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-enum-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-enum-attribute.md @@ -1,17 +1,18 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeEnum = try await databases.createEnumAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - elements: [], - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeEnum = try await databases.createEnumAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + elements: [], + required: xfalse + ) + print(String(describing: attributeEnum) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-float-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-float-attribute.md index bb456f6365..bc8c826356 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-float-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-float-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeFloat = try await databases.createFloatAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeFloat = try await databases.createFloatAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeFloat) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-index.md b/docs/examples/1.1.x/server-swift/examples/databases/create-index.md index 899c84211b..fc85de0092 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-index.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-index.md @@ -1,17 +1,18 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let index = try await databases.createIndex( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - type: "key", - attributes: [] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let index = try await databases.createIndex( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + type: "key", + attributes: [] + ) + print(String(describing: index) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-integer-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-integer-attribute.md index 1c75420075..d45bc4f4a4 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-integer-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-integer-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeInteger = try await databases.createIntegerAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeInteger = try await databases.createIntegerAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeInteger) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-ip-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-ip-attribute.md index b3e03c1dec..971ebcc919 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-ip-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-ip-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeIp = try await databases.createIpAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeIp = try await databases.createIpAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeIp) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-string-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-string-attribute.md index a8e21d5fae..784a859450 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-string-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-string-attribute.md @@ -1,17 +1,18 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeString = try await databases.createStringAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - size: 1, - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeString = try await databases.createStringAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + size: 1, + required: xfalse + ) + print(String(describing: attributeString) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-url-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-url-attribute.md index 7f2be87184..25dcd2a9a6 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-url-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-url-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeUrl = try await databases.createUrlAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeUrl = try await databases.createUrlAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeUrl) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create.md b/docs/examples/1.1.x/server-swift/examples/databases/create.md index 4852651442..5ad5331bf9 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let database = try await databases.create( - databaseId: "[DATABASE_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let database = try await databases.create( + databaseId: "[DATABASE_ID]", + name: "[NAME]" + ) + print(String(describing: database) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/delete-attribute.md index 2b1322efe7..78b4d81fae 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete-attribute.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.deleteAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.deleteAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete-collection.md b/docs/examples/1.1.x/server-swift/examples/databases/delete-collection.md index 30b1cbe9f6..b35a3e250d 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete-collection.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete-collection.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.deleteCollection( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.deleteCollection( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete-document.md b/docs/examples/1.1.x/server-swift/examples/databases/delete-document.md index c794afd4e3..57fb6db16b 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete-document.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete-document.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.deleteDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.deleteDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete-index.md b/docs/examples/1.1.x/server-swift/examples/databases/delete-index.md index a84a642528..eca8f48319 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete-index.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete-index.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.deleteIndex( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.deleteIndex( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete.md b/docs/examples/1.1.x/server-swift/examples/databases/delete.md index fefb4e3515..0cbfbb2dde 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.delete( - databaseId: "[DATABASE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.delete( + databaseId: "[DATABASE_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/get-attribute.md index 18febcfe15..7b8c87def4 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get-attribute.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.getAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.getAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get-collection.md b/docs/examples/1.1.x/server-swift/examples/databases/get-collection.md index 1e8c74612d..c21f6ecd61 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get-collection.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get-collection.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let collection = try await databases.getCollection( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let collection = try await databases.getCollection( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: collection) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get-document.md b/docs/examples/1.1.x/server-swift/examples/databases/get-document.md index c5e5962395..22f66b3551 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get-document.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get-document.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let document = try await databases.getDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let document = try await databases.getDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get-index.md b/docs/examples/1.1.x/server-swift/examples/databases/get-index.md index dc193c09a7..e23bd8109f 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get-index.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get-index.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let index = try await databases.getIndex( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let index = try await databases.getIndex( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "" + ) + print(String(describing: index) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get.md b/docs/examples/1.1.x/server-swift/examples/databases/get.md index 0b894d25c3..912005d73f 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let database = try await databases.get( - databaseId: "[DATABASE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let database = try await databases.get( + databaseId: "[DATABASE_ID]" + ) + print(String(describing: database) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list-attributes.md b/docs/examples/1.1.x/server-swift/examples/databases/list-attributes.md index 48dab7ebcc..f7894174d5 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list-attributes.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list-attributes.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeList = try await databases.listAttributes( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeList = try await databases.listAttributes( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: attributeList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list-collections.md b/docs/examples/1.1.x/server-swift/examples/databases/list-collections.md index efeb6561ca..8d0e0118ed 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list-collections.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list-collections.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let collectionList = try await databases.listCollections( - databaseId: "[DATABASE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let collectionList = try await databases.listCollections( + databaseId: "[DATABASE_ID]" + ) + print(String(describing: collectionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list-documents.md b/docs/examples/1.1.x/server-swift/examples/databases/list-documents.md index a2c49981dc..bdab597e99 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list-documents.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list-documents.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let documentList = try await databases.listDocuments( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let documentList = try await databases.listDocuments( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: documentList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list-indexes.md b/docs/examples/1.1.x/server-swift/examples/databases/list-indexes.md index 3c6767844f..57b5532b8c 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list-indexes.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list-indexes.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let indexList = try await databases.listIndexes( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let indexList = try await databases.listIndexes( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: indexList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list.md b/docs/examples/1.1.x/server-swift/examples/databases/list.md index e7edfc6d0c..f777518fe3 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let databaseList = try await databases.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let databaseList = try await databases.list() + print(String(describing: databaseList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/update-collection.md b/docs/examples/1.1.x/server-swift/examples/databases/update-collection.md index 8e99729c8d..3861de183a 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/update-collection.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/update-collection.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let collection = try await databases.updateCollection( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let collection = try await databases.updateCollection( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + name: "[NAME]" + ) + print(String(describing: collection) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/update-document.md b/docs/examples/1.1.x/server-swift/examples/databases/update-document.md index 133f2c9c22..0ab31e301c 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/update-document.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/update-document.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let document = try await databases.updateDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let document = try await databases.updateDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/update.md b/docs/examples/1.1.x/server-swift/examples/databases/update.md index 71473bff54..f33df0b6b4 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/update.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/update.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let database = try await databases.update( - databaseId: "[DATABASE_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let database = try await databases.update( + databaseId: "[DATABASE_ID]", + name: "[NAME]" + ) + print(String(describing: database) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create-build.md b/docs/examples/1.1.x/server-swift/examples/functions/create-build.md index da6f6c8572..4e0ed0e2ab 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create-build.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create-build.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let result = try await functions.createBuild( - functionId: "[FUNCTION_ID]", - deploymentId: "[DEPLOYMENT_ID]", - buildId: "[BUILD_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let result = try await functions.createBuild( + functionId: "[FUNCTION_ID]", + deploymentId: "[DEPLOYMENT_ID]", + buildId: "[BUILD_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create-deployment.md b/docs/examples/1.1.x/server-swift/examples/functions/create-deployment.md index f9a8a832ae..6ae7f688e6 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create-deployment.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create-deployment.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let deployment = try await functions.createDeployment( - functionId: "[FUNCTION_ID]", - entrypoint: "[ENTRYPOINT]", - code: InputFile.fromPath("file.png"), - activate: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let deployment = try await functions.createDeployment( + functionId: "[FUNCTION_ID]", + entrypoint: "[ENTRYPOINT]", + code: InputFile.fromPath("file.png"), + activate: xfalse + ) + print(String(describing: deployment) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create-execution.md b/docs/examples/1.1.x/server-swift/examples/functions/create-execution.md index 773763f568..02dde0c312 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create-execution.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create-execution.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let execution = try await functions.createExecution( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let execution = try await functions.createExecution( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: execution) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create-variable.md b/docs/examples/1.1.x/server-swift/examples/functions/create-variable.md index 02a383fb38..29a221c0e6 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create-variable.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create-variable.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let variable = try await functions.createVariable( - functionId: "[FUNCTION_ID]", - key: "[KEY]", - value: "[VALUE]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let variable = try await functions.createVariable( + functionId: "[FUNCTION_ID]", + key: "[KEY]", + value: "[VALUE]" + ) + print(String(describing: variable) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create.md b/docs/examples/1.1.x/server-swift/examples/functions/create.md index 74695d314c..85a456040e 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let function = try await functions.create( - functionId: "[FUNCTION_ID]", - name: "[NAME]", - execute: ["any"], - runtime: "node-14.5" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let function = try await functions.create( + functionId: "[FUNCTION_ID]", + name: "[NAME]", + execute: ["any"], + runtime: "node-14.5" + ) + print(String(describing: function) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/delete-deployment.md b/docs/examples/1.1.x/server-swift/examples/functions/delete-deployment.md index a3a5dcd6e0..322c52b7ed 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/delete-deployment.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/delete-deployment.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let result = try await functions.deleteDeployment( - functionId: "[FUNCTION_ID]", - deploymentId: "[DEPLOYMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let result = try await functions.deleteDeployment( + functionId: "[FUNCTION_ID]", + deploymentId: "[DEPLOYMENT_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/delete-variable.md b/docs/examples/1.1.x/server-swift/examples/functions/delete-variable.md index 50767ee295..9feb18b3c2 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/delete-variable.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/delete-variable.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let result = try await functions.deleteVariable( - functionId: "[FUNCTION_ID]", - variableId: "[VARIABLE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let result = try await functions.deleteVariable( + functionId: "[FUNCTION_ID]", + variableId: "[VARIABLE_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/delete.md b/docs/examples/1.1.x/server-swift/examples/functions/delete.md index 62d733e3d2..c5628163da 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/delete.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/delete.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let result = try await functions.delete( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let result = try await functions.delete( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/get-deployment.md b/docs/examples/1.1.x/server-swift/examples/functions/get-deployment.md index c0058d8e87..c5322ee81b 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/get-deployment.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/get-deployment.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let deployment = try await functions.getDeployment( - functionId: "[FUNCTION_ID]", - deploymentId: "[DEPLOYMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let deployment = try await functions.getDeployment( + functionId: "[FUNCTION_ID]", + deploymentId: "[DEPLOYMENT_ID]" + ) + print(String(describing: deployment) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/get-execution.md b/docs/examples/1.1.x/server-swift/examples/functions/get-execution.md index 6a651a62c2..d5bcf092ac 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/get-execution.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/get-execution.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let execution = try await functions.getExecution( - functionId: "[FUNCTION_ID]", - executionId: "[EXECUTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let execution = try await functions.getExecution( + functionId: "[FUNCTION_ID]", + executionId: "[EXECUTION_ID]" + ) + print(String(describing: execution) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/get-variable.md b/docs/examples/1.1.x/server-swift/examples/functions/get-variable.md index bd3bd89813..fd814984e4 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/get-variable.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/get-variable.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let variable = try await functions.getVariable( - functionId: "[FUNCTION_ID]", - variableId: "[VARIABLE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let variable = try await functions.getVariable( + functionId: "[FUNCTION_ID]", + variableId: "[VARIABLE_ID]" + ) + print(String(describing: variable) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/get.md b/docs/examples/1.1.x/server-swift/examples/functions/get.md index 34739d5e60..6675916a47 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/get.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/get.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let function = try await functions.get( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let function = try await functions.get( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: function) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list-deployments.md b/docs/examples/1.1.x/server-swift/examples/functions/list-deployments.md index 450448d91c..fce719736a 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list-deployments.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list-deployments.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let deploymentList = try await functions.listDeployments( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let deploymentList = try await functions.listDeployments( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: deploymentList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list-executions.md b/docs/examples/1.1.x/server-swift/examples/functions/list-executions.md index 96e6e22eb1..95d27cbc05 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list-executions.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list-executions.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let executionList = try await functions.listExecutions( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let executionList = try await functions.listExecutions( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: executionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list-runtimes.md b/docs/examples/1.1.x/server-swift/examples/functions/list-runtimes.md index 194bb6efa9..e87ad2c46c 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list-runtimes.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list-runtimes.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let runtimeList = try await functions.listRuntimes() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let runtimeList = try await functions.listRuntimes() + print(String(describing: runtimeList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list-variables.md b/docs/examples/1.1.x/server-swift/examples/functions/list-variables.md index 581d5cf27a..8952aa6fcd 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list-variables.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list-variables.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let variableList = try await functions.listVariables( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let variableList = try await functions.listVariables( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: variableList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list.md b/docs/examples/1.1.x/server-swift/examples/functions/list.md index ff509f6fb2..695350d95a 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let functionList = try await functions.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let functionList = try await functions.list() + print(String(describing: functionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/update-deployment.md b/docs/examples/1.1.x/server-swift/examples/functions/update-deployment.md index efee130564..37d8cbb8fd 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/update-deployment.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/update-deployment.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let function = try await functions.updateDeployment( - functionId: "[FUNCTION_ID]", - deploymentId: "[DEPLOYMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let function = try await functions.updateDeployment( + functionId: "[FUNCTION_ID]", + deploymentId: "[DEPLOYMENT_ID]" + ) + print(String(describing: function) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/update-variable.md b/docs/examples/1.1.x/server-swift/examples/functions/update-variable.md index d377539dfa..ff22cc2bfd 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/update-variable.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/update-variable.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let variable = try await functions.updateVariable( - functionId: "[FUNCTION_ID]", - variableId: "[VARIABLE_ID]", - key: "[KEY]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let variable = try await functions.updateVariable( + functionId: "[FUNCTION_ID]", + variableId: "[VARIABLE_ID]", + key: "[KEY]" + ) + print(String(describing: variable) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/update.md b/docs/examples/1.1.x/server-swift/examples/functions/update.md index 65300d1b06..c459ae38af 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/update.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/update.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let function = try await functions.update( - functionId: "[FUNCTION_ID]", - name: "[NAME]", - execute: ["any"] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let function = try await functions.update( + functionId: "[FUNCTION_ID]", + name: "[NAME]", + execute: ["any"] + ) + print(String(describing: function) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-antivirus.md b/docs/examples/1.1.x/server-swift/examples/health/get-antivirus.md index a7cf12a742..3eafa2c2f1 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-antivirus.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-antivirus.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthAntivirus = try await health.getAntivirus() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthAntivirus = try await health.getAntivirus() + print(String(describing: healthAntivirus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-cache.md b/docs/examples/1.1.x/server-swift/examples/health/get-cache.md index f49afe03d2..20831b4d39 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-cache.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-cache.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthStatus = try await health.getCache() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthStatus = try await health.getCache() + print(String(describing: healthStatus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-d-b.md b/docs/examples/1.1.x/server-swift/examples/health/get-d-b.md index 63a0e352e1..5808c99a73 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-d-b.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-d-b.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthStatus = try await health.getDB() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthStatus = try await health.getDB() + print(String(describing: healthStatus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-queue-certificates.md b/docs/examples/1.1.x/server-swift/examples/health/get-queue-certificates.md index 679cfce2a1..123b452f99 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-queue-certificates.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-queue-certificates.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthQueue = try await health.getQueueCertificates() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthQueue = try await health.getQueueCertificates() + print(String(describing: healthQueue) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-queue-functions.md b/docs/examples/1.1.x/server-swift/examples/health/get-queue-functions.md index 518f70a9e7..c3949a769c 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-queue-functions.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-queue-functions.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthQueue = try await health.getQueueFunctions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthQueue = try await health.getQueueFunctions() + print(String(describing: healthQueue) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-queue-logs.md b/docs/examples/1.1.x/server-swift/examples/health/get-queue-logs.md index 710339ec78..6a36fa966c 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-queue-logs.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-queue-logs.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthQueue = try await health.getQueueLogs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthQueue = try await health.getQueueLogs() + print(String(describing: healthQueue) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-queue-webhooks.md b/docs/examples/1.1.x/server-swift/examples/health/get-queue-webhooks.md index 6f5fbe7c1e..bc6b7bcb14 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-queue-webhooks.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-queue-webhooks.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthQueue = try await health.getQueueWebhooks() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthQueue = try await health.getQueueWebhooks() + print(String(describing: healthQueue) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-storage-local.md b/docs/examples/1.1.x/server-swift/examples/health/get-storage-local.md index 8fed07b7b7..773d8dd483 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-storage-local.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-storage-local.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthStatus = try await health.getStorageLocal() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthStatus = try await health.getStorageLocal() + print(String(describing: healthStatus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-time.md b/docs/examples/1.1.x/server-swift/examples/health/get-time.md index 7c9d370506..edbc171ea9 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-time.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-time.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthTime = try await health.getTime() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthTime = try await health.getTime() + print(String(describing: healthTime) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get.md b/docs/examples/1.1.x/server-swift/examples/health/get.md index 41a44b163e..770c09aa66 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthStatus = try await health.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthStatus = try await health.get() + print(String(describing: healthStatus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/get.md b/docs/examples/1.1.x/server-swift/examples/locale/get.md index a0353af234..fd0a9dd1e7 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/get.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/get.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let locale = try await locale.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let locale = try await locale.get() + print(String(describing: locale) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-continents.md b/docs/examples/1.1.x/server-swift/examples/locale/list-continents.md index a74cedfc3c..2bd3007391 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-continents.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-continents.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let continentList = try await locale.listContinents() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let continentList = try await locale.listContinents() + print(String(describing: continentList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-countries-e-u.md b/docs/examples/1.1.x/server-swift/examples/locale/list-countries-e-u.md index fcb8fbf186..fd12103165 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-countries-e-u.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let countryList = try await locale.listCountriesEU() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let countryList = try await locale.listCountriesEU() + print(String(describing: countryList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-countries-phones.md b/docs/examples/1.1.x/server-swift/examples/locale/list-countries-phones.md index 04b3206469..e5a2c97ef2 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-countries-phones.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let phoneList = try await locale.listCountriesPhones() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let phoneList = try await locale.listCountriesPhones() + print(String(describing: phoneList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-countries.md b/docs/examples/1.1.x/server-swift/examples/locale/list-countries.md index 356580ba7b..cc38466e79 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-countries.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-countries.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let countryList = try await locale.listCountries() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let countryList = try await locale.listCountries() + print(String(describing: countryList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-currencies.md b/docs/examples/1.1.x/server-swift/examples/locale/list-currencies.md index 630958672f..26d272e536 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-currencies.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-currencies.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let currencyList = try await locale.listCurrencies() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let currencyList = try await locale.listCurrencies() + print(String(describing: currencyList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-languages.md b/docs/examples/1.1.x/server-swift/examples/locale/list-languages.md index 33942e696b..63ccecf206 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-languages.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-languages.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let languageList = try await locale.listLanguages() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let languageList = try await locale.listLanguages() + print(String(describing: languageList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/create-bucket.md b/docs/examples/1.1.x/server-swift/examples/storage/create-bucket.md index 02eeabbec0..6f275b3123 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/create-bucket.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/create-bucket.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let bucket = try await storage.createBucket( - bucketId: "[BUCKET_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let bucket = try await storage.createBucket( + bucketId: "[BUCKET_ID]", + name: "[NAME]" + ) + print(String(describing: bucket) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/create-file.md b/docs/examples/1.1.x/server-swift/examples/storage/create-file.md index 471898cc75..2da22e5372 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/create-file.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/create-file.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let file = try await storage.createFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]", - file: InputFile.fromPath("file.png") -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let file = try await storage.createFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]", + file: InputFile.fromPath("file.png") + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/delete-bucket.md b/docs/examples/1.1.x/server-swift/examples/storage/delete-bucket.md index 018f6b798c..18687fb278 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/delete-bucket.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/delete-bucket.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let result = try await storage.deleteBucket( - bucketId: "[BUCKET_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let result = try await storage.deleteBucket( + bucketId: "[BUCKET_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/delete-file.md b/docs/examples/1.1.x/server-swift/examples/storage/delete-file.md index 9535648df6..305d6e1d81 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/delete-file.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/delete-file.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let result = try await storage.deleteFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let result = try await storage.deleteFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-bucket.md b/docs/examples/1.1.x/server-swift/examples/storage/get-bucket.md index a535fbe74a..f04e2db3c9 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-bucket.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-bucket.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let bucket = try await storage.getBucket( - bucketId: "[BUCKET_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let bucket = try await storage.getBucket( + bucketId: "[BUCKET_ID]" + ) + print(String(describing: bucket) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-file-download.md b/docs/examples/1.1.x/server-swift/examples/storage/get-file-download.md index 030b904c1b..28c427c620 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-file-download.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-file-download.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let byteBuffer = try await storage.getFileDownload( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let byteBuffer = try await storage.getFileDownload( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-file-preview.md b/docs/examples/1.1.x/server-swift/examples/storage/get-file-preview.md index 83e7be45be..20b87191e1 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-file-preview.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-file-preview.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let byteBuffer = try await storage.getFilePreview( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let byteBuffer = try await storage.getFilePreview( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-file-view.md b/docs/examples/1.1.x/server-swift/examples/storage/get-file-view.md index 7cefa52407..a17fba0a14 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-file-view.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-file-view.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let byteBuffer = try await storage.getFileView( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let byteBuffer = try await storage.getFileView( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-file.md b/docs/examples/1.1.x/server-swift/examples/storage/get-file.md index 0a3e472cfc..6b02fcd0ee 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-file.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-file.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let file = try await storage.getFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let file = try await storage.getFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/list-buckets.md b/docs/examples/1.1.x/server-swift/examples/storage/list-buckets.md index 9958dbb410..361ef626b5 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/list-buckets.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/list-buckets.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let bucketList = try await storage.listBuckets() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let bucketList = try await storage.listBuckets() + print(String(describing: bucketList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/list-files.md b/docs/examples/1.1.x/server-swift/examples/storage/list-files.md index d7d63f9412..68a6ca40c4 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/list-files.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/list-files.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let fileList = try await storage.listFiles( - bucketId: "[BUCKET_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let fileList = try await storage.listFiles( + bucketId: "[BUCKET_ID]" + ) + print(String(describing: fileList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/update-bucket.md b/docs/examples/1.1.x/server-swift/examples/storage/update-bucket.md index a6aa0a7cca..3692deec5c 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/update-bucket.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/update-bucket.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let bucket = try await storage.updateBucket( - bucketId: "[BUCKET_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let bucket = try await storage.updateBucket( + bucketId: "[BUCKET_ID]", + name: "[NAME]" + ) + print(String(describing: bucket) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/update-file.md b/docs/examples/1.1.x/server-swift/examples/storage/update-file.md index 579133ba05..12f8150085 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/update-file.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/update-file.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let file = try await storage.updateFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let file = try await storage.updateFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/create-membership.md b/docs/examples/1.1.x/server-swift/examples/teams/create-membership.md index d850862a5d..a732ec676a 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/create-membership.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/create-membership.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let membership = try await teams.createMembership( - teamId: "[TEAM_ID]", - email: "email@example.com", - roles: [], - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let membership = try await teams.createMembership( + teamId: "[TEAM_ID]", + email: "email@example.com", + roles: [], + url: "https://example.com" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/create.md b/docs/examples/1.1.x/server-swift/examples/teams/create.md index 78aac9db1d..80edd0cadc 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/create.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/create.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let team = try await teams.create( - teamId: "[TEAM_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let team = try await teams.create( + teamId: "[TEAM_ID]", + name: "[NAME]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/delete-membership.md b/docs/examples/1.1.x/server-swift/examples/teams/delete-membership.md index 67cf0f9013..84f3157550 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/delete-membership.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/delete-membership.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let result = try await teams.deleteMembership( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let result = try await teams.deleteMembership( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/delete.md b/docs/examples/1.1.x/server-swift/examples/teams/delete.md index da985f9285..d8808a6565 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/delete.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/delete.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let result = try await teams.delete( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let result = try await teams.delete( + teamId: "[TEAM_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/get-membership.md b/docs/examples/1.1.x/server-swift/examples/teams/get-membership.md index 387952b2f1..5d80e2143a 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/get-membership.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/get-membership.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let membership = try await teams.getMembership( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let membership = try await teams.getMembership( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/get.md b/docs/examples/1.1.x/server-swift/examples/teams/get.md index 05eb43bb71..d1c4500442 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/get.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/get.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let team = try await teams.get( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let team = try await teams.get( + teamId: "[TEAM_ID]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/list-memberships.md b/docs/examples/1.1.x/server-swift/examples/teams/list-memberships.md index 38d31f5119..809debaa14 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/list-memberships.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/list-memberships.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let membershipList = try await teams.listMemberships( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let membershipList = try await teams.listMemberships( + teamId: "[TEAM_ID]" + ) + print(String(describing: membershipList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/list.md b/docs/examples/1.1.x/server-swift/examples/teams/list.md index a189b2ab3c..3a9fa822ae 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/list.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/list.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let teamList = try await teams.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let teamList = try await teams.list() + print(String(describing: teamList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/update-membership-roles.md b/docs/examples/1.1.x/server-swift/examples/teams/update-membership-roles.md index 5b6a023888..fd0084786a 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/update-membership-roles.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let membership = try await teams.updateMembershipRoles( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]", - roles: [] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let membership = try await teams.updateMembershipRoles( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]", + roles: [] + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/update-membership-status.md b/docs/examples/1.1.x/server-swift/examples/teams/update-membership-status.md index e55d8f3ca7..4b6f3eda43 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/update-membership-status.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/update-membership-status.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let teams = Teams(client) - -let membership = try await teams.updateMembershipStatus( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]", - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let teams = Teams(client) + let membership = try await teams.updateMembershipStatus( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]", + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/update.md b/docs/examples/1.1.x/server-swift/examples/teams/update.md index 83f1040f37..683dfd4e30 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/update.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/update.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let team = try await teams.update( - teamId: "[TEAM_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let team = try await teams.update( + teamId: "[TEAM_ID]", + name: "[NAME]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-argon2user.md b/docs/examples/1.1.x/server-swift/examples/users/create-argon2user.md index 9524bd0654..f54ebb15ec 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-argon2user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-argon2user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createArgon2User( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createArgon2User( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-bcrypt-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-bcrypt-user.md index d8965a74d5..379bff9c85 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-bcrypt-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-bcrypt-user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createBcryptUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createBcryptUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-m-d5user.md b/docs/examples/1.1.x/server-swift/examples/users/create-m-d5user.md index 32e7812c2a..c1a057ec7b 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-m-d5user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-m-d5user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createMD5User( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createMD5User( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-p-h-pass-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-p-h-pass-user.md index af6e563395..4492272329 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-p-h-pass-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-p-h-pass-user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createPHPassUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createPHPassUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-s-h-a-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-s-h-a-user.md index a6b54bb718..f6b30066d1 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-s-h-a-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-s-h-a-user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createSHAUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createSHAUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-modified-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-modified-user.md index e825f5176c..e5e84fd266 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-modified-user.md @@ -1,18 +1,19 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createScryptModifiedUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password", - passwordSalt: "[PASSWORD_SALT]", - passwordSaltSeparator: "[PASSWORD_SALT_SEPARATOR]", - passwordSignerKey: "[PASSWORD_SIGNER_KEY]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createScryptModifiedUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password", + passwordSalt: "[PASSWORD_SALT]", + passwordSaltSeparator: "[PASSWORD_SALT_SEPARATOR]", + passwordSignerKey: "[PASSWORD_SIGNER_KEY]" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-user.md index b0364c1ae9..d0dc599cb5 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-user.md @@ -1,20 +1,21 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createScryptUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password", - passwordSalt: "[PASSWORD_SALT]", - passwordCpu: 0, - passwordMemory: 0, - passwordParallel: 0, - passwordLength: 0 -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createScryptUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password", + passwordSalt: "[PASSWORD_SALT]", + passwordCpu: 0, + passwordMemory: 0, + passwordParallel: 0, + passwordLength: 0 + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create.md b/docs/examples/1.1.x/server-swift/examples/users/create.md index 780025439d..76b7f22076 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.create( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.create( + userId: "[USER_ID]" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/delete-session.md b/docs/examples/1.1.x/server-swift/examples/users/delete-session.md index 2b16ffeec9..50cbf470d3 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/delete-session.md +++ b/docs/examples/1.1.x/server-swift/examples/users/delete-session.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let result = try await users.deleteSession( - userId: "[USER_ID]", - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let result = try await users.deleteSession( + userId: "[USER_ID]", + sessionId: "[SESSION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/delete-sessions.md b/docs/examples/1.1.x/server-swift/examples/users/delete-sessions.md index 3f0232a72a..a8b7802577 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/delete-sessions.md +++ b/docs/examples/1.1.x/server-swift/examples/users/delete-sessions.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let result = try await users.deleteSessions( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let result = try await users.deleteSessions( + userId: "[USER_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/delete.md b/docs/examples/1.1.x/server-swift/examples/users/delete.md index b9288ed7f9..f970492afa 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/delete.md +++ b/docs/examples/1.1.x/server-swift/examples/users/delete.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let result = try await users.delete( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let result = try await users.delete( + userId: "[USER_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/get-prefs.md b/docs/examples/1.1.x/server-swift/examples/users/get-prefs.md index db810e80d0..d664dbbb0d 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/get-prefs.md +++ b/docs/examples/1.1.x/server-swift/examples/users/get-prefs.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let preferences = try await users.getPrefs( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let preferences = try await users.getPrefs( + userId: "[USER_ID]" + ) + print(String(describing: preferences) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/get.md b/docs/examples/1.1.x/server-swift/examples/users/get.md index 461c169f93..dc57a924ba 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/get.md +++ b/docs/examples/1.1.x/server-swift/examples/users/get.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.get( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.get( + userId: "[USER_ID]" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/list-logs.md b/docs/examples/1.1.x/server-swift/examples/users/list-logs.md index aea2a5791b..78386c8291 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/list-logs.md +++ b/docs/examples/1.1.x/server-swift/examples/users/list-logs.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let logList = try await users.listLogs( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let logList = try await users.listLogs( + userId: "[USER_ID]" + ) + print(String(describing: logList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/list-memberships.md b/docs/examples/1.1.x/server-swift/examples/users/list-memberships.md index 8b0150621f..5fea09e948 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/list-memberships.md +++ b/docs/examples/1.1.x/server-swift/examples/users/list-memberships.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let membershipList = try await users.listMemberships( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let membershipList = try await users.listMemberships( + userId: "[USER_ID]" + ) + print(String(describing: membershipList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/list-sessions.md b/docs/examples/1.1.x/server-swift/examples/users/list-sessions.md index f8ff1f2c85..4339fa1a2f 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/list-sessions.md +++ b/docs/examples/1.1.x/server-swift/examples/users/list-sessions.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let sessionList = try await users.listSessions( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let sessionList = try await users.listSessions( + userId: "[USER_ID]" + ) + print(String(describing: sessionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/list.md b/docs/examples/1.1.x/server-swift/examples/users/list.md index 86afe6e2ab..7ea73d0515 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/list.md +++ b/docs/examples/1.1.x/server-swift/examples/users/list.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let userList = try await users.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let userList = try await users.list() + print(String(describing: userList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-email-verification.md b/docs/examples/1.1.x/server-swift/examples/users/update-email-verification.md index 175d9d7d18..be03932e77 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-email-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-email-verification.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updateEmailVerification( - userId: "[USER_ID]", - emailVerification: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updateEmailVerification( + userId: "[USER_ID]", + emailVerification: xfalse + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-email.md b/docs/examples/1.1.x/server-swift/examples/users/update-email.md index d5df526616..602191c6f0 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-email.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-email.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updateEmail( - userId: "[USER_ID]", - email: "email@example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updateEmail( + userId: "[USER_ID]", + email: "email@example.com" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-name.md b/docs/examples/1.1.x/server-swift/examples/users/update-name.md index 74a64112ec..7fa3b543ec 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-name.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-name.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updateName( - userId: "[USER_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updateName( + userId: "[USER_ID]", + name: "[NAME]" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-password.md b/docs/examples/1.1.x/server-swift/examples/users/update-password.md index a548dbafd1..5a3bde40b6 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-password.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-password.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updatePassword( - userId: "[USER_ID]", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updatePassword( + userId: "[USER_ID]", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-phone-verification.md b/docs/examples/1.1.x/server-swift/examples/users/update-phone-verification.md index 0ecb62a9dc..7d9228e820 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-phone-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-phone-verification.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updatePhoneVerification( - userId: "[USER_ID]", - phoneVerification: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updatePhoneVerification( + userId: "[USER_ID]", + phoneVerification: xfalse + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-phone.md b/docs/examples/1.1.x/server-swift/examples/users/update-phone.md index 222de7848e..0f23a815da 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-phone.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-phone.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updatePhone( - userId: "[USER_ID]", - number: "+12065550100" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updatePhone( + userId: "[USER_ID]", + number: "+12065550100" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-prefs.md b/docs/examples/1.1.x/server-swift/examples/users/update-prefs.md index 2c0d9431f0..78e8bc274e 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-prefs.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-prefs.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let preferences = try await users.updatePrefs( - userId: "[USER_ID]", - prefs: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let preferences = try await users.updatePrefs( + userId: "[USER_ID]", + prefs: [:] + ) + print(String(describing: preferences) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-status.md b/docs/examples/1.1.x/server-swift/examples/users/update-status.md index f28c8f2240..28dc7d7844 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-status.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-status.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updateStatus( - userId: "[USER_ID]", - status: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updateStatus( + userId: "[USER_ID]", + status: xfalse + ) + print(String(describing: user) +}