From d929cf92d17a129a7d8dd9c47e5395995f7be769 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 13 Feb 2026 08:04:36 +0000 Subject: [PATCH 1/3] updated spec --- README.md | 2 +- .../java/account/create-billing-address.md | 29 + docs/examples/java/account/create-key.md | 27 + .../java/account/create-payment-method.md | 20 + .../java/account/delete-billing-address.md | 24 + docs/examples/java/account/delete-key.md | 24 + .../java/account/delete-payment-method.md | 24 + .../java/account/get-billing-address.md | 24 + docs/examples/java/account/get-key.md | 24 + .../java/account/get-payment-method.md | 24 + .../java/account/list-billing-addresses.md | 24 + docs/examples/java/account/list-keys.md | 24 + .../java/account/list-payment-methods.md | 24 + .../java/account/update-billing-address.md | 30 + docs/examples/java/account/update-key.md | 28 + .../update-payment-method-mandate-options.md | 24 + .../account/update-payment-method-provider.md | 27 + .../java/account/update-payment-method.md | 27 + .../create-downgrade-feedback.md | 28 + docs/examples/java/organizations/delete.md | 24 + .../estimation-delete-organization.md | 24 + .../java/organizations/get-billing-address.md | 25 + .../java/organizations/get-payment-method.md | 25 + .../kotlin/account/create-billing-address.md | 20 + .../account/create-email-password-session.md | 3 +- .../kotlin/account/create-email-token.md | 3 +- .../account/create-email-verification.md | 3 +- docs/examples/kotlin/account/create-jwt.md | 3 +- docs/examples/kotlin/account/create-key.md | 18 + .../kotlin/account/create-magic-url-token.md | 3 +- .../account/create-mfa-authenticator.md | 3 +- .../kotlin/account/create-mfa-challenge.md | 3 +- .../kotlin/account/create-o-auth-2-session.md | 3 +- .../kotlin/account/create-o-auth-2-token.md | 3 +- .../kotlin/account/create-payment-method.md | 13 + .../kotlin/account/create-phone-token.md | 3 +- .../kotlin/account/create-push-target.md | 3 +- .../kotlin/account/create-recovery.md | 3 +- .../examples/kotlin/account/create-session.md | 3 +- .../kotlin/account/create-verification.md | 3 +- docs/examples/kotlin/account/create.md | 3 +- .../kotlin/account/delete-billing-address.md | 15 + .../kotlin/account/delete-identity.md | 3 +- docs/examples/kotlin/account/delete-key.md | 15 + .../account/delete-mfa-authenticator.md | 3 +- .../kotlin/account/delete-payment-method.md | 15 + .../kotlin/account/delete-push-target.md | 3 +- .../examples/kotlin/account/delete-session.md | 3 +- .../kotlin/account/get-billing-address.md | 15 + docs/examples/kotlin/account/get-key.md | 15 + .../kotlin/account/get-payment-method.md | 15 + docs/examples/kotlin/account/get-session.md | 3 +- .../kotlin/account/list-billing-addresses.md | 15 + .../kotlin/account/list-identities.md | 3 +- docs/examples/kotlin/account/list-keys.md | 15 + docs/examples/kotlin/account/list-logs.md | 3 +- .../kotlin/account/list-payment-methods.md | 15 + .../kotlin/account/update-billing-address.md | 21 + .../account/update-email-verification.md | 3 +- docs/examples/kotlin/account/update-email.md | 3 +- docs/examples/kotlin/account/update-key.md | 19 + .../account/update-magic-url-session.md | 3 +- .../account/update-mfa-authenticator.md | 3 +- .../kotlin/account/update-mfa-challenge.md | 3 +- docs/examples/kotlin/account/update-mfa.md | 3 +- docs/examples/kotlin/account/update-name.md | 3 +- .../kotlin/account/update-password.md | 3 +- .../update-payment-method-mandate-options.md | 15 + .../account/update-payment-method-provider.md | 18 + .../kotlin/account/update-payment-method.md | 18 + .../kotlin/account/update-phone-session.md | 3 +- .../account/update-phone-verification.md | 3 +- docs/examples/kotlin/account/update-phone.md | 3 +- docs/examples/kotlin/account/update-prefs.md | 3 +- .../kotlin/account/update-push-target.md | 3 +- .../kotlin/account/update-recovery.md | 3 +- .../examples/kotlin/account/update-session.md | 3 +- .../kotlin/account/update-verification.md | 3 +- docs/examples/kotlin/avatars/get-browser.md | 3 +- .../kotlin/avatars/get-credit-card.md | 3 +- docs/examples/kotlin/avatars/get-favicon.md | 3 +- docs/examples/kotlin/avatars/get-flag.md | 3 +- docs/examples/kotlin/avatars/get-image.md | 3 +- docs/examples/kotlin/avatars/get-initials.md | 3 +- docs/examples/kotlin/avatars/get-qr.md | 3 +- .../examples/kotlin/avatars/get-screenshot.md | 3 +- .../kotlin/databases/create-document.md | 3 +- .../kotlin/databases/create-operations.md | 3 +- .../kotlin/databases/create-transaction.md | 3 +- .../databases/decrement-document-attribute.md | 3 +- .../kotlin/databases/delete-document.md | 3 +- .../kotlin/databases/delete-transaction.md | 3 +- .../examples/kotlin/databases/get-document.md | 3 +- .../kotlin/databases/get-transaction.md | 3 +- .../databases/increment-document-attribute.md | 3 +- .../kotlin/databases/list-documents.md | 3 +- .../kotlin/databases/list-transactions.md | 3 +- .../kotlin/databases/update-document.md | 3 +- .../kotlin/databases/update-transaction.md | 3 +- .../kotlin/databases/upsert-document.md | 3 +- .../kotlin/functions/create-execution.md | 3 +- .../kotlin/functions/get-execution.md | 3 +- .../kotlin/functions/list-executions.md | 3 +- docs/examples/kotlin/graphql/mutation.md | 3 +- docs/examples/kotlin/graphql/query.md | 3 +- .../kotlin/messaging/create-subscriber.md | 3 +- .../kotlin/messaging/delete-subscriber.md | 3 +- .../create-downgrade-feedback.md | 19 + docs/examples/kotlin/organizations/delete.md | 15 + .../estimation-delete-organization.md | 15 + .../organizations/get-billing-address.md | 16 + .../organizations/get-payment-method.md | 16 + docs/examples/kotlin/storage/create-file.md | 3 +- docs/examples/kotlin/storage/delete-file.md | 3 +- .../kotlin/storage/get-file-download.md | 3 +- .../kotlin/storage/get-file-preview.md | 3 +- docs/examples/kotlin/storage/get-file-view.md | 3 +- docs/examples/kotlin/storage/get-file.md | 3 +- docs/examples/kotlin/storage/list-files.md | 3 +- docs/examples/kotlin/storage/update-file.md | 3 +- .../kotlin/tablesdb/create-operations.md | 3 +- docs/examples/kotlin/tablesdb/create-row.md | 3 +- .../kotlin/tablesdb/create-transaction.md | 3 +- .../kotlin/tablesdb/decrement-row-column.md | 3 +- docs/examples/kotlin/tablesdb/delete-row.md | 3 +- .../kotlin/tablesdb/delete-transaction.md | 3 +- docs/examples/kotlin/tablesdb/get-row.md | 3 +- .../kotlin/tablesdb/get-transaction.md | 3 +- .../kotlin/tablesdb/increment-row-column.md | 3 +- docs/examples/kotlin/tablesdb/list-rows.md | 3 +- .../kotlin/tablesdb/list-transactions.md | 3 +- docs/examples/kotlin/tablesdb/update-row.md | 3 +- .../kotlin/tablesdb/update-transaction.md | 3 +- docs/examples/kotlin/tablesdb/upsert-row.md | 3 +- .../kotlin/teams/create-membership.md | 3 +- docs/examples/kotlin/teams/create.md | 3 +- .../kotlin/teams/delete-membership.md | 3 +- docs/examples/kotlin/teams/delete.md | 3 +- docs/examples/kotlin/teams/get-membership.md | 3 +- docs/examples/kotlin/teams/get-prefs.md | 3 +- docs/examples/kotlin/teams/get.md | 3 +- .../examples/kotlin/teams/list-memberships.md | 3 +- docs/examples/kotlin/teams/list.md | 3 +- .../kotlin/teams/update-membership-status.md | 3 +- .../kotlin/teams/update-membership.md | 3 +- docs/examples/kotlin/teams/update-name.md | 3 +- docs/examples/kotlin/teams/update-prefs.md | 3 +- library/src/main/java/io/appwrite/Channel.kt | 61 +- .../java/io/appwrite/enums/OAuthProvider.kt | 6 +- .../src/main/java/io/appwrite/enums/Scopes.kt | 14 + .../java/io/appwrite/models/BillingAddress.kt | 86 +++ .../io/appwrite/models/BillingAddressList.kt | 38 ++ .../io/appwrite/models/DowngradeFeedback.kt | 102 +++ .../models/EstimationDeleteOrganization.kt | 30 + .../main/java/io/appwrite/models/Invoice.kt | 198 ++++++ .../src/main/java/io/appwrite/models/Key.kt | 94 +++ .../main/java/io/appwrite/models/KeyList.kt | 38 ++ .../java/io/appwrite/models/PaymentMethod.kt | 182 ++++++ .../io/appwrite/models/PaymentMethodList.kt | 38 ++ .../java/io/appwrite/models/UsageResources.kt | 70 ++ .../main/java/io/appwrite/services/Account.kt | 599 +++++++++++++++++- .../io/appwrite/services/Organizations.kt | 189 ++++++ 162 files changed, 2816 insertions(+), 149 deletions(-) create mode 100644 docs/examples/java/account/create-billing-address.md create mode 100644 docs/examples/java/account/create-key.md create mode 100644 docs/examples/java/account/create-payment-method.md create mode 100644 docs/examples/java/account/delete-billing-address.md create mode 100644 docs/examples/java/account/delete-key.md create mode 100644 docs/examples/java/account/delete-payment-method.md create mode 100644 docs/examples/java/account/get-billing-address.md create mode 100644 docs/examples/java/account/get-key.md create mode 100644 docs/examples/java/account/get-payment-method.md create mode 100644 docs/examples/java/account/list-billing-addresses.md create mode 100644 docs/examples/java/account/list-keys.md create mode 100644 docs/examples/java/account/list-payment-methods.md create mode 100644 docs/examples/java/account/update-billing-address.md create mode 100644 docs/examples/java/account/update-key.md create mode 100644 docs/examples/java/account/update-payment-method-mandate-options.md create mode 100644 docs/examples/java/account/update-payment-method-provider.md create mode 100644 docs/examples/java/account/update-payment-method.md create mode 100644 docs/examples/java/organizations/create-downgrade-feedback.md create mode 100644 docs/examples/java/organizations/delete.md create mode 100644 docs/examples/java/organizations/estimation-delete-organization.md create mode 100644 docs/examples/java/organizations/get-billing-address.md create mode 100644 docs/examples/java/organizations/get-payment-method.md create mode 100644 docs/examples/kotlin/account/create-billing-address.md create mode 100644 docs/examples/kotlin/account/create-key.md create mode 100644 docs/examples/kotlin/account/create-payment-method.md create mode 100644 docs/examples/kotlin/account/delete-billing-address.md create mode 100644 docs/examples/kotlin/account/delete-key.md create mode 100644 docs/examples/kotlin/account/delete-payment-method.md create mode 100644 docs/examples/kotlin/account/get-billing-address.md create mode 100644 docs/examples/kotlin/account/get-key.md create mode 100644 docs/examples/kotlin/account/get-payment-method.md create mode 100644 docs/examples/kotlin/account/list-billing-addresses.md create mode 100644 docs/examples/kotlin/account/list-keys.md create mode 100644 docs/examples/kotlin/account/list-payment-methods.md create mode 100644 docs/examples/kotlin/account/update-billing-address.md create mode 100644 docs/examples/kotlin/account/update-key.md create mode 100644 docs/examples/kotlin/account/update-payment-method-mandate-options.md create mode 100644 docs/examples/kotlin/account/update-payment-method-provider.md create mode 100644 docs/examples/kotlin/account/update-payment-method.md create mode 100644 docs/examples/kotlin/organizations/create-downgrade-feedback.md create mode 100644 docs/examples/kotlin/organizations/delete.md create mode 100644 docs/examples/kotlin/organizations/estimation-delete-organization.md create mode 100644 docs/examples/kotlin/organizations/get-billing-address.md create mode 100644 docs/examples/kotlin/organizations/get-payment-method.md create mode 100644 library/src/main/java/io/appwrite/enums/Scopes.kt create mode 100644 library/src/main/java/io/appwrite/models/BillingAddress.kt create mode 100644 library/src/main/java/io/appwrite/models/BillingAddressList.kt create mode 100644 library/src/main/java/io/appwrite/models/DowngradeFeedback.kt create mode 100644 library/src/main/java/io/appwrite/models/EstimationDeleteOrganization.kt create mode 100644 library/src/main/java/io/appwrite/models/Invoice.kt create mode 100644 library/src/main/java/io/appwrite/models/Key.kt create mode 100644 library/src/main/java/io/appwrite/models/KeyList.kt create mode 100644 library/src/main/java/io/appwrite/models/PaymentMethod.kt create mode 100644 library/src/main/java/io/appwrite/models/PaymentMethodList.kt create mode 100644 library/src/main/java/io/appwrite/models/UsageResources.kt create mode 100644 library/src/main/java/io/appwrite/services/Organizations.kt diff --git a/README.md b/README.md index 7e98220f..b70648c8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).** +**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Android SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/docs/examples/java/account/create-billing-address.md b/docs/examples/java/account/create-billing-address.md new file mode 100644 index 00000000..8669d084 --- /dev/null +++ b/docs/examples/java/account/create-billing-address.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createBillingAddress( + "", // country + "", // city + "", // streetAddress + "", // addressLine2 (optional) + "", // state (optional) + "", // postalCode (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/create-key.md b/docs/examples/java/account/create-key.md new file mode 100644 index 00000000..a2c044c5 --- /dev/null +++ b/docs/examples/java/account/create-key.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.Scopes; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createKey( + "", // name + Scopes.ACCOUNT, // scopes + "", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/create-payment-method.md b/docs/examples/java/account/create-payment-method.md new file mode 100644 index 00000000..b9618d6a --- /dev/null +++ b/docs/examples/java/account/create-payment-method.md @@ -0,0 +1,20 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createPaymentMethod(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/docs/examples/java/account/delete-billing-address.md b/docs/examples/java/account/delete-billing-address.md new file mode 100644 index 00000000..898ec56d --- /dev/null +++ b/docs/examples/java/account/delete-billing-address.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.deleteBillingAddress( + "", // billingAddressId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/delete-key.md b/docs/examples/java/account/delete-key.md new file mode 100644 index 00000000..228392d4 --- /dev/null +++ b/docs/examples/java/account/delete-key.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.deleteKey( + "", // keyId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/delete-payment-method.md b/docs/examples/java/account/delete-payment-method.md new file mode 100644 index 00000000..69c9699e --- /dev/null +++ b/docs/examples/java/account/delete-payment-method.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.deletePaymentMethod( + "", // paymentMethodId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/get-billing-address.md b/docs/examples/java/account/get-billing-address.md new file mode 100644 index 00000000..32cea8f8 --- /dev/null +++ b/docs/examples/java/account/get-billing-address.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.getBillingAddress( + "", // billingAddressId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/get-key.md b/docs/examples/java/account/get-key.md new file mode 100644 index 00000000..76ca5a2d --- /dev/null +++ b/docs/examples/java/account/get-key.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.getKey( + "", // keyId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/get-payment-method.md b/docs/examples/java/account/get-payment-method.md new file mode 100644 index 00000000..0442a87f --- /dev/null +++ b/docs/examples/java/account/get-payment-method.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.getPaymentMethod( + "", // paymentMethodId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/list-billing-addresses.md b/docs/examples/java/account/list-billing-addresses.md new file mode 100644 index 00000000..ce7bdc81 --- /dev/null +++ b/docs/examples/java/account/list-billing-addresses.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.listBillingAddresses( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/list-keys.md b/docs/examples/java/account/list-keys.md new file mode 100644 index 00000000..3a9bd70b --- /dev/null +++ b/docs/examples/java/account/list-keys.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.listKeys( + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/list-payment-methods.md b/docs/examples/java/account/list-payment-methods.md new file mode 100644 index 00000000..e69955c9 --- /dev/null +++ b/docs/examples/java/account/list-payment-methods.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.listPaymentMethods( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/update-billing-address.md b/docs/examples/java/account/update-billing-address.md new file mode 100644 index 00000000..aeb12583 --- /dev/null +++ b/docs/examples/java/account/update-billing-address.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateBillingAddress( + "", // billingAddressId + "", // country + "", // city + "", // streetAddress + "", // addressLine2 (optional) + "", // state (optional) + "", // postalCode (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/update-key.md b/docs/examples/java/account/update-key.md new file mode 100644 index 00000000..6d1ae575 --- /dev/null +++ b/docs/examples/java/account/update-key.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.Scopes; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateKey( + "", // keyId + "", // name + Scopes.ACCOUNT, // scopes + "", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/update-payment-method-mandate-options.md b/docs/examples/java/account/update-payment-method-mandate-options.md new file mode 100644 index 00000000..23758fa9 --- /dev/null +++ b/docs/examples/java/account/update-payment-method-mandate-options.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePaymentMethodMandateOptions( + "", // paymentMethodId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/update-payment-method-provider.md b/docs/examples/java/account/update-payment-method-provider.md new file mode 100644 index 00000000..8a295f85 --- /dev/null +++ b/docs/examples/java/account/update-payment-method-provider.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePaymentMethodProvider( + "", // paymentMethodId + "", // providerMethodId + "", // name + "", // state (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/account/update-payment-method.md b/docs/examples/java/account/update-payment-method.md new file mode 100644 index 00000000..0e8ddab4 --- /dev/null +++ b/docs/examples/java/account/update-payment-method.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePaymentMethod( + "", // paymentMethodId + 1, // expiryMonth + 2026, // expiryYear + "", // state (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/organizations/create-downgrade-feedback.md b/docs/examples/java/organizations/create-downgrade-feedback.md new file mode 100644 index 00000000..20b5e757 --- /dev/null +++ b/docs/examples/java/organizations/create-downgrade-feedback.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organizations; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Organizations organizations = new Organizations(client); + +organizations.createDowngradeFeedback( + "", // organizationId + "", // reason + "", // message + "", // fromPlanId + "", // toPlanId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/organizations/delete.md b/docs/examples/java/organizations/delete.md new file mode 100644 index 00000000..1c032eba --- /dev/null +++ b/docs/examples/java/organizations/delete.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organizations; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Organizations organizations = new Organizations(client); + +organizations.delete( + "", // organizationId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/organizations/estimation-delete-organization.md b/docs/examples/java/organizations/estimation-delete-organization.md new file mode 100644 index 00000000..8477c9a8 --- /dev/null +++ b/docs/examples/java/organizations/estimation-delete-organization.md @@ -0,0 +1,24 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organizations; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Organizations organizations = new Organizations(client); + +organizations.estimationDeleteOrganization( + "", // organizationId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/organizations/get-billing-address.md b/docs/examples/java/organizations/get-billing-address.md new file mode 100644 index 00000000..0eaa729f --- /dev/null +++ b/docs/examples/java/organizations/get-billing-address.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organizations; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Organizations organizations = new Organizations(client); + +organizations.getBillingAddress( + "", // organizationId + "", // billingAddressId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/java/organizations/get-payment-method.md b/docs/examples/java/organizations/get-payment-method.md new file mode 100644 index 00000000..1be14ec3 --- /dev/null +++ b/docs/examples/java/organizations/get-payment-method.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organizations; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Organizations organizations = new Organizations(client); + +organizations.getPaymentMethod( + "", // organizationId + "", // paymentMethodId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/docs/examples/kotlin/account/create-billing-address.md b/docs/examples/kotlin/account/create-billing-address.md new file mode 100644 index 00000000..a12e9278 --- /dev/null +++ b/docs/examples/kotlin/account/create-billing-address.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.createBillingAddress( + country = "", + city = "", + streetAddress = "", + addressLine2 = "", // (optional) + state = "", // (optional) + postalCode = "", // (optional) +) +``` diff --git a/docs/examples/kotlin/account/create-email-password-session.md b/docs/examples/kotlin/account/create-email-password-session.md index b3f63d8a..6100e483 100644 --- a/docs/examples/kotlin/account/create-email-password-session.md +++ b/docs/examples/kotlin/account/create-email-password-session.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.createEmailPasswordSession( email = "email@example.com", password = "password", -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-email-token.md b/docs/examples/kotlin/account/create-email-token.md index f78bb74e..01dda3d6 100644 --- a/docs/examples/kotlin/account/create-email-token.md +++ b/docs/examples/kotlin/account/create-email-token.md @@ -13,4 +13,5 @@ val result = account.createEmailToken( userId = "", email = "email@example.com", phrase = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-email-verification.md b/docs/examples/kotlin/account/create-email-verification.md index 3912e3b6..2a0d00e9 100644 --- a/docs/examples/kotlin/account/create-email-verification.md +++ b/docs/examples/kotlin/account/create-email-verification.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.createEmailVerification( url = "https://example.com", -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-jwt.md b/docs/examples/kotlin/account/create-jwt.md index d90c10e5..79d7b099 100644 --- a/docs/examples/kotlin/account/create-jwt.md +++ b/docs/examples/kotlin/account/create-jwt.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.createJWT( duration = 0, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-key.md b/docs/examples/kotlin/account/create-key.md new file mode 100644 index 00000000..306c79d7 --- /dev/null +++ b/docs/examples/kotlin/account/create-key.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.Scopes + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.createKey( + name = "", + scopes = scopes.ACCOUNT, + expire = "", // (optional) +) +``` diff --git a/docs/examples/kotlin/account/create-magic-url-token.md b/docs/examples/kotlin/account/create-magic-url-token.md index 0965f214..62904044 100644 --- a/docs/examples/kotlin/account/create-magic-url-token.md +++ b/docs/examples/kotlin/account/create-magic-url-token.md @@ -14,4 +14,5 @@ val result = account.createMagicURLToken( email = "email@example.com", url = "https://example.com", // (optional) phrase = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-mfa-authenticator.md b/docs/examples/kotlin/account/create-mfa-authenticator.md index c8f8d9a4..132bf749 100644 --- a/docs/examples/kotlin/account/create-mfa-authenticator.md +++ b/docs/examples/kotlin/account/create-mfa-authenticator.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.createMFAAuthenticator( type = AuthenticatorType.TOTP, -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-mfa-challenge.md b/docs/examples/kotlin/account/create-mfa-challenge.md index c40512dd..92206fab 100644 --- a/docs/examples/kotlin/account/create-mfa-challenge.md +++ b/docs/examples/kotlin/account/create-mfa-challenge.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.createMFAChallenge( factor = AuthenticationFactor.EMAIL, -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-o-auth-2-session.md b/docs/examples/kotlin/account/create-o-auth-2-session.md index 18cb2361..cde941c7 100644 --- a/docs/examples/kotlin/account/create-o-auth-2-session.md +++ b/docs/examples/kotlin/account/create-o-auth-2-session.md @@ -15,4 +15,5 @@ account.createOAuth2Session( success = "https://example.com", // (optional) failure = "https://example.com", // (optional) scopes = listOf(), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-o-auth-2-token.md b/docs/examples/kotlin/account/create-o-auth-2-token.md index 52c0eea0..5e905649 100644 --- a/docs/examples/kotlin/account/create-o-auth-2-token.md +++ b/docs/examples/kotlin/account/create-o-auth-2-token.md @@ -15,4 +15,5 @@ account.createOAuth2Token( success = "https://example.com", // (optional) failure = "https://example.com", // (optional) scopes = listOf(), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-payment-method.md b/docs/examples/kotlin/account/create-payment-method.md new file mode 100644 index 00000000..87266087 --- /dev/null +++ b/docs/examples/kotlin/account/create-payment-method.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.createPaymentMethod() +``` diff --git a/docs/examples/kotlin/account/create-phone-token.md b/docs/examples/kotlin/account/create-phone-token.md index 8ee75ceb..3a61bac7 100644 --- a/docs/examples/kotlin/account/create-phone-token.md +++ b/docs/examples/kotlin/account/create-phone-token.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.createPhoneToken( userId = "", phone = "+12065550100", -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-push-target.md b/docs/examples/kotlin/account/create-push-target.md index b4641017..22d64cb9 100644 --- a/docs/examples/kotlin/account/create-push-target.md +++ b/docs/examples/kotlin/account/create-push-target.md @@ -13,4 +13,5 @@ val result = account.createPushTarget( targetId = "", identifier = "", providerId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-recovery.md b/docs/examples/kotlin/account/create-recovery.md index e8448a61..1a89cccc 100644 --- a/docs/examples/kotlin/account/create-recovery.md +++ b/docs/examples/kotlin/account/create-recovery.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.createRecovery( email = "email@example.com", url = "https://example.com", -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-session.md b/docs/examples/kotlin/account/create-session.md index e5273ce9..b86495cf 100644 --- a/docs/examples/kotlin/account/create-session.md +++ b/docs/examples/kotlin/account/create-session.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.createSession( userId = "", secret = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/create-verification.md b/docs/examples/kotlin/account/create-verification.md index 4f39b39a..d8ad1bc5 100644 --- a/docs/examples/kotlin/account/create-verification.md +++ b/docs/examples/kotlin/account/create-verification.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.createVerification( url = "https://example.com", -)``` +) +``` diff --git a/docs/examples/kotlin/account/create.md b/docs/examples/kotlin/account/create.md index fccaf308..9f80913a 100644 --- a/docs/examples/kotlin/account/create.md +++ b/docs/examples/kotlin/account/create.md @@ -14,4 +14,5 @@ val result = account.create( email = "email@example.com", password = "", name = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/delete-billing-address.md b/docs/examples/kotlin/account/delete-billing-address.md new file mode 100644 index 00000000..7c2fde1a --- /dev/null +++ b/docs/examples/kotlin/account/delete-billing-address.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.deleteBillingAddress( + billingAddressId = "", +) +``` diff --git a/docs/examples/kotlin/account/delete-identity.md b/docs/examples/kotlin/account/delete-identity.md index fc3aba69..7efc1d7c 100644 --- a/docs/examples/kotlin/account/delete-identity.md +++ b/docs/examples/kotlin/account/delete-identity.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.deleteIdentity( identityId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/delete-key.md b/docs/examples/kotlin/account/delete-key.md new file mode 100644 index 00000000..5434050b --- /dev/null +++ b/docs/examples/kotlin/account/delete-key.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.deleteKey( + keyId = "", +) +``` diff --git a/docs/examples/kotlin/account/delete-mfa-authenticator.md b/docs/examples/kotlin/account/delete-mfa-authenticator.md index 0f453183..77a68a07 100644 --- a/docs/examples/kotlin/account/delete-mfa-authenticator.md +++ b/docs/examples/kotlin/account/delete-mfa-authenticator.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.deleteMFAAuthenticator( type = AuthenticatorType.TOTP, -)``` +) +``` diff --git a/docs/examples/kotlin/account/delete-payment-method.md b/docs/examples/kotlin/account/delete-payment-method.md new file mode 100644 index 00000000..3422a628 --- /dev/null +++ b/docs/examples/kotlin/account/delete-payment-method.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.deletePaymentMethod( + paymentMethodId = "", +) +``` diff --git a/docs/examples/kotlin/account/delete-push-target.md b/docs/examples/kotlin/account/delete-push-target.md index 49e33bb3..6fce7b7c 100644 --- a/docs/examples/kotlin/account/delete-push-target.md +++ b/docs/examples/kotlin/account/delete-push-target.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.deletePushTarget( targetId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/delete-session.md b/docs/examples/kotlin/account/delete-session.md index 91013ce9..de938117 100644 --- a/docs/examples/kotlin/account/delete-session.md +++ b/docs/examples/kotlin/account/delete-session.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.deleteSession( sessionId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/get-billing-address.md b/docs/examples/kotlin/account/get-billing-address.md new file mode 100644 index 00000000..4ca4e50e --- /dev/null +++ b/docs/examples/kotlin/account/get-billing-address.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.getBillingAddress( + billingAddressId = "", +) +``` diff --git a/docs/examples/kotlin/account/get-key.md b/docs/examples/kotlin/account/get-key.md new file mode 100644 index 00000000..e0e70955 --- /dev/null +++ b/docs/examples/kotlin/account/get-key.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.getKey( + keyId = "", +) +``` diff --git a/docs/examples/kotlin/account/get-payment-method.md b/docs/examples/kotlin/account/get-payment-method.md new file mode 100644 index 00000000..36aaf266 --- /dev/null +++ b/docs/examples/kotlin/account/get-payment-method.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.getPaymentMethod( + paymentMethodId = "", +) +``` diff --git a/docs/examples/kotlin/account/get-session.md b/docs/examples/kotlin/account/get-session.md index fbf7f104..29bac94c 100644 --- a/docs/examples/kotlin/account/get-session.md +++ b/docs/examples/kotlin/account/get-session.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.getSession( sessionId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/list-billing-addresses.md b/docs/examples/kotlin/account/list-billing-addresses.md new file mode 100644 index 00000000..034f7ac6 --- /dev/null +++ b/docs/examples/kotlin/account/list-billing-addresses.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.listBillingAddresses( + queries = listOf(), // (optional) +) +``` diff --git a/docs/examples/kotlin/account/list-identities.md b/docs/examples/kotlin/account/list-identities.md index 0ca7466d..9037c0e6 100644 --- a/docs/examples/kotlin/account/list-identities.md +++ b/docs/examples/kotlin/account/list-identities.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.listIdentities( queries = listOf(), // (optional) total = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/list-keys.md b/docs/examples/kotlin/account/list-keys.md new file mode 100644 index 00000000..0ec099ce --- /dev/null +++ b/docs/examples/kotlin/account/list-keys.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.listKeys( + total = false, // (optional) +) +``` diff --git a/docs/examples/kotlin/account/list-logs.md b/docs/examples/kotlin/account/list-logs.md index ce425646..0bccbf25 100644 --- a/docs/examples/kotlin/account/list-logs.md +++ b/docs/examples/kotlin/account/list-logs.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.listLogs( queries = listOf(), // (optional) total = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/list-payment-methods.md b/docs/examples/kotlin/account/list-payment-methods.md new file mode 100644 index 00000000..f8bd4d8a --- /dev/null +++ b/docs/examples/kotlin/account/list-payment-methods.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.listPaymentMethods( + queries = listOf(), // (optional) +) +``` diff --git a/docs/examples/kotlin/account/update-billing-address.md b/docs/examples/kotlin/account/update-billing-address.md new file mode 100644 index 00000000..e9a24f3e --- /dev/null +++ b/docs/examples/kotlin/account/update-billing-address.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.updateBillingAddress( + billingAddressId = "", + country = "", + city = "", + streetAddress = "", + addressLine2 = "", // (optional) + state = "", // (optional) + postalCode = "", // (optional) +) +``` diff --git a/docs/examples/kotlin/account/update-email-verification.md b/docs/examples/kotlin/account/update-email-verification.md index a2555642..cfc5d671 100644 --- a/docs/examples/kotlin/account/update-email-verification.md +++ b/docs/examples/kotlin/account/update-email-verification.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updateEmailVerification( userId = "", secret = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-email.md b/docs/examples/kotlin/account/update-email.md index ff80d07a..dc4bcbf3 100644 --- a/docs/examples/kotlin/account/update-email.md +++ b/docs/examples/kotlin/account/update-email.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updateEmail( email = "email@example.com", password = "password", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-key.md b/docs/examples/kotlin/account/update-key.md new file mode 100644 index 00000000..1587018b --- /dev/null +++ b/docs/examples/kotlin/account/update-key.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.Scopes + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.updateKey( + keyId = "", + name = "", + scopes = scopes.ACCOUNT, + expire = "", // (optional) +) +``` diff --git a/docs/examples/kotlin/account/update-magic-url-session.md b/docs/examples/kotlin/account/update-magic-url-session.md index c00fbd12..d943ac6a 100644 --- a/docs/examples/kotlin/account/update-magic-url-session.md +++ b/docs/examples/kotlin/account/update-magic-url-session.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updateMagicURLSession( userId = "", secret = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-mfa-authenticator.md b/docs/examples/kotlin/account/update-mfa-authenticator.md index 26958a49..9befabe9 100644 --- a/docs/examples/kotlin/account/update-mfa-authenticator.md +++ b/docs/examples/kotlin/account/update-mfa-authenticator.md @@ -13,4 +13,5 @@ val account = Account(client) val result = account.updateMFAAuthenticator( type = AuthenticatorType.TOTP, otp = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-mfa-challenge.md b/docs/examples/kotlin/account/update-mfa-challenge.md index d48e0c22..6f2e99c0 100644 --- a/docs/examples/kotlin/account/update-mfa-challenge.md +++ b/docs/examples/kotlin/account/update-mfa-challenge.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updateMFAChallenge( challengeId = "", otp = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-mfa.md b/docs/examples/kotlin/account/update-mfa.md index 246bfe18..6acd1e70 100644 --- a/docs/examples/kotlin/account/update-mfa.md +++ b/docs/examples/kotlin/account/update-mfa.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.updateMFA( mfa = false, -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-name.md b/docs/examples/kotlin/account/update-name.md index 1ada95aa..ed40f240 100644 --- a/docs/examples/kotlin/account/update-name.md +++ b/docs/examples/kotlin/account/update-name.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.updateName( name = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-password.md b/docs/examples/kotlin/account/update-password.md index 473cd1bf..ce9ae904 100644 --- a/docs/examples/kotlin/account/update-password.md +++ b/docs/examples/kotlin/account/update-password.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updatePassword( password = "", oldPassword = "password", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-payment-method-mandate-options.md b/docs/examples/kotlin/account/update-payment-method-mandate-options.md new file mode 100644 index 00000000..e6f4147e --- /dev/null +++ b/docs/examples/kotlin/account/update-payment-method-mandate-options.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.updatePaymentMethodMandateOptions( + paymentMethodId = "", +) +``` diff --git a/docs/examples/kotlin/account/update-payment-method-provider.md b/docs/examples/kotlin/account/update-payment-method-provider.md new file mode 100644 index 00000000..65ca8b30 --- /dev/null +++ b/docs/examples/kotlin/account/update-payment-method-provider.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.updatePaymentMethodProvider( + paymentMethodId = "", + providerMethodId = "", + name = "", + state = "", // (optional) +) +``` diff --git a/docs/examples/kotlin/account/update-payment-method.md b/docs/examples/kotlin/account/update-payment-method.md new file mode 100644 index 00000000..aa6f89ee --- /dev/null +++ b/docs/examples/kotlin/account/update-payment-method.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.updatePaymentMethod( + paymentMethodId = "", + expiryMonth = 1, + expiryYear = 2026, + state = "", // (optional) +) +``` diff --git a/docs/examples/kotlin/account/update-phone-session.md b/docs/examples/kotlin/account/update-phone-session.md index 0788763a..ea5f25b5 100644 --- a/docs/examples/kotlin/account/update-phone-session.md +++ b/docs/examples/kotlin/account/update-phone-session.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updatePhoneSession( userId = "", secret = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-phone-verification.md b/docs/examples/kotlin/account/update-phone-verification.md index 36abe384..c68d213a 100644 --- a/docs/examples/kotlin/account/update-phone-verification.md +++ b/docs/examples/kotlin/account/update-phone-verification.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updatePhoneVerification( userId = "", secret = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-phone.md b/docs/examples/kotlin/account/update-phone.md index 078851d3..b7e669b0 100644 --- a/docs/examples/kotlin/account/update-phone.md +++ b/docs/examples/kotlin/account/update-phone.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updatePhone( phone = "+12065550100", password = "password", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-prefs.md b/docs/examples/kotlin/account/update-prefs.md index 5c3b6911..4444fb96 100644 --- a/docs/examples/kotlin/account/update-prefs.md +++ b/docs/examples/kotlin/account/update-prefs.md @@ -15,4 +15,5 @@ val result = account.updatePrefs( "timezone" to "UTC", "darkTheme" to true ), -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-push-target.md b/docs/examples/kotlin/account/update-push-target.md index 3e4abbdb..0e16e2fe 100644 --- a/docs/examples/kotlin/account/update-push-target.md +++ b/docs/examples/kotlin/account/update-push-target.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updatePushTarget( targetId = "", identifier = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-recovery.md b/docs/examples/kotlin/account/update-recovery.md index 5dcb265f..8e16074e 100644 --- a/docs/examples/kotlin/account/update-recovery.md +++ b/docs/examples/kotlin/account/update-recovery.md @@ -13,4 +13,5 @@ val result = account.updateRecovery( userId = "", secret = "", password = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-session.md b/docs/examples/kotlin/account/update-session.md index 343c673a..b29ece55 100644 --- a/docs/examples/kotlin/account/update-session.md +++ b/docs/examples/kotlin/account/update-session.md @@ -11,4 +11,5 @@ val account = Account(client) val result = account.updateSession( sessionId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/account/update-verification.md b/docs/examples/kotlin/account/update-verification.md index 34a118c6..1c4af79e 100644 --- a/docs/examples/kotlin/account/update-verification.md +++ b/docs/examples/kotlin/account/update-verification.md @@ -12,4 +12,5 @@ val account = Account(client) val result = account.updateVerification( userId = "", secret = "", -)``` +) +``` diff --git a/docs/examples/kotlin/avatars/get-browser.md b/docs/examples/kotlin/avatars/get-browser.md index 3ac128eb..7c32ad2d 100644 --- a/docs/examples/kotlin/avatars/get-browser.md +++ b/docs/examples/kotlin/avatars/get-browser.md @@ -15,4 +15,5 @@ val result = avatars.getBrowser( width = 0, // (optional) height = 0, // (optional) quality = -1, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/avatars/get-credit-card.md b/docs/examples/kotlin/avatars/get-credit-card.md index b61670bf..54244acc 100644 --- a/docs/examples/kotlin/avatars/get-credit-card.md +++ b/docs/examples/kotlin/avatars/get-credit-card.md @@ -15,4 +15,5 @@ val result = avatars.getCreditCard( width = 0, // (optional) height = 0, // (optional) quality = -1, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/avatars/get-favicon.md b/docs/examples/kotlin/avatars/get-favicon.md index 71a798c7..d55a0b42 100644 --- a/docs/examples/kotlin/avatars/get-favicon.md +++ b/docs/examples/kotlin/avatars/get-favicon.md @@ -11,4 +11,5 @@ val avatars = Avatars(client) val result = avatars.getFavicon( url = "https://example.com", -)``` +) +``` diff --git a/docs/examples/kotlin/avatars/get-flag.md b/docs/examples/kotlin/avatars/get-flag.md index 097143c4..c03ccb3f 100644 --- a/docs/examples/kotlin/avatars/get-flag.md +++ b/docs/examples/kotlin/avatars/get-flag.md @@ -15,4 +15,5 @@ val result = avatars.getFlag( width = 0, // (optional) height = 0, // (optional) quality = -1, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/avatars/get-image.md b/docs/examples/kotlin/avatars/get-image.md index f2d01c19..4e22185d 100644 --- a/docs/examples/kotlin/avatars/get-image.md +++ b/docs/examples/kotlin/avatars/get-image.md @@ -13,4 +13,5 @@ val result = avatars.getImage( url = "https://example.com", width = 0, // (optional) height = 0, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/avatars/get-initials.md b/docs/examples/kotlin/avatars/get-initials.md index d689eace..1cb76a18 100644 --- a/docs/examples/kotlin/avatars/get-initials.md +++ b/docs/examples/kotlin/avatars/get-initials.md @@ -14,4 +14,5 @@ val result = avatars.getInitials( width = 0, // (optional) height = 0, // (optional) background = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/avatars/get-qr.md b/docs/examples/kotlin/avatars/get-qr.md index 4dca2bba..e962ef30 100644 --- a/docs/examples/kotlin/avatars/get-qr.md +++ b/docs/examples/kotlin/avatars/get-qr.md @@ -14,4 +14,5 @@ val result = avatars.getQR( size = 1, // (optional) margin = 0, // (optional) download = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/avatars/get-screenshot.md b/docs/examples/kotlin/avatars/get-screenshot.md index 1cc4ef25..94551fdb 100644 --- a/docs/examples/kotlin/avatars/get-screenshot.md +++ b/docs/examples/kotlin/avatars/get-screenshot.md @@ -37,4 +37,5 @@ val result = avatars.getScreenshot( height = 600, // (optional) quality = 85, // (optional) output = ImageFormat.JPG, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/create-document.md b/docs/examples/kotlin/databases/create-document.md index 5f4aa352..7105df5c 100644 --- a/docs/examples/kotlin/databases/create-document.md +++ b/docs/examples/kotlin/databases/create-document.md @@ -24,4 +24,5 @@ val result = databases.createDocument( ), permissions = listOf(Permission.read(Role.any())), // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/create-operations.md b/docs/examples/kotlin/databases/create-operations.md index a988c08c..3bd7ae5d 100644 --- a/docs/examples/kotlin/databases/create-operations.md +++ b/docs/examples/kotlin/databases/create-operations.md @@ -20,4 +20,5 @@ val result = databases.createOperations( "name" to "Walter O'Brien" ) )), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/create-transaction.md b/docs/examples/kotlin/databases/create-transaction.md index dd61947f..59a3c12f 100644 --- a/docs/examples/kotlin/databases/create-transaction.md +++ b/docs/examples/kotlin/databases/create-transaction.md @@ -11,4 +11,5 @@ val databases = Databases(client) val result = databases.createTransaction( ttl = 60, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/decrement-document-attribute.md b/docs/examples/kotlin/databases/decrement-document-attribute.md index 8b9cb078..9ca780fd 100644 --- a/docs/examples/kotlin/databases/decrement-document-attribute.md +++ b/docs/examples/kotlin/databases/decrement-document-attribute.md @@ -17,4 +17,5 @@ val result = databases.decrementDocumentAttribute( value = 0, // (optional) min = 0, // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/delete-document.md b/docs/examples/kotlin/databases/delete-document.md index 99e40c19..c31bdb9f 100644 --- a/docs/examples/kotlin/databases/delete-document.md +++ b/docs/examples/kotlin/databases/delete-document.md @@ -14,4 +14,5 @@ val result = databases.deleteDocument( collectionId = "", documentId = "", transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/delete-transaction.md b/docs/examples/kotlin/databases/delete-transaction.md index 302c3644..101bd8cd 100644 --- a/docs/examples/kotlin/databases/delete-transaction.md +++ b/docs/examples/kotlin/databases/delete-transaction.md @@ -11,4 +11,5 @@ val databases = Databases(client) val result = databases.deleteTransaction( transactionId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/databases/get-document.md b/docs/examples/kotlin/databases/get-document.md index 9bae4190..5c54be0c 100644 --- a/docs/examples/kotlin/databases/get-document.md +++ b/docs/examples/kotlin/databases/get-document.md @@ -15,4 +15,5 @@ val result = databases.getDocument( documentId = "", queries = listOf(), // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/get-transaction.md b/docs/examples/kotlin/databases/get-transaction.md index 25249ecd..2f08ad61 100644 --- a/docs/examples/kotlin/databases/get-transaction.md +++ b/docs/examples/kotlin/databases/get-transaction.md @@ -11,4 +11,5 @@ val databases = Databases(client) val result = databases.getTransaction( transactionId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/databases/increment-document-attribute.md b/docs/examples/kotlin/databases/increment-document-attribute.md index 78c311e6..20afc996 100644 --- a/docs/examples/kotlin/databases/increment-document-attribute.md +++ b/docs/examples/kotlin/databases/increment-document-attribute.md @@ -17,4 +17,5 @@ val result = databases.incrementDocumentAttribute( value = 0, // (optional) max = 0, // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/list-documents.md b/docs/examples/kotlin/databases/list-documents.md index dc086332..485ce792 100644 --- a/docs/examples/kotlin/databases/list-documents.md +++ b/docs/examples/kotlin/databases/list-documents.md @@ -15,4 +15,5 @@ val result = databases.listDocuments( queries = listOf(), // (optional) transactionId = "", // (optional) total = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/list-transactions.md b/docs/examples/kotlin/databases/list-transactions.md index 43e0aba5..3cabd79f 100644 --- a/docs/examples/kotlin/databases/list-transactions.md +++ b/docs/examples/kotlin/databases/list-transactions.md @@ -11,4 +11,5 @@ val databases = Databases(client) val result = databases.listTransactions( queries = listOf(), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/update-document.md b/docs/examples/kotlin/databases/update-document.md index 585ae4c0..5c8a5e31 100644 --- a/docs/examples/kotlin/databases/update-document.md +++ b/docs/examples/kotlin/databases/update-document.md @@ -24,4 +24,5 @@ val result = databases.updateDocument( ), // (optional) permissions = listOf(Permission.read(Role.any())), // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/update-transaction.md b/docs/examples/kotlin/databases/update-transaction.md index c2e38aea..88360b27 100644 --- a/docs/examples/kotlin/databases/update-transaction.md +++ b/docs/examples/kotlin/databases/update-transaction.md @@ -13,4 +13,5 @@ val result = databases.updateTransaction( transactionId = "", commit = false, // (optional) rollback = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/databases/upsert-document.md b/docs/examples/kotlin/databases/upsert-document.md index d591f22a..edecb863 100644 --- a/docs/examples/kotlin/databases/upsert-document.md +++ b/docs/examples/kotlin/databases/upsert-document.md @@ -24,4 +24,5 @@ val result = databases.upsertDocument( ), // (optional) permissions = listOf(Permission.read(Role.any())), // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/functions/create-execution.md b/docs/examples/kotlin/functions/create-execution.md index 5037cab5..13654e65 100644 --- a/docs/examples/kotlin/functions/create-execution.md +++ b/docs/examples/kotlin/functions/create-execution.md @@ -18,4 +18,5 @@ val result = functions.createExecution( method = ExecutionMethod.GET, // (optional) headers = mapOf( "a" to "b" ), // (optional) scheduledAt = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/functions/get-execution.md b/docs/examples/kotlin/functions/get-execution.md index e39fb7e8..c092909e 100644 --- a/docs/examples/kotlin/functions/get-execution.md +++ b/docs/examples/kotlin/functions/get-execution.md @@ -12,4 +12,5 @@ val functions = Functions(client) val result = functions.getExecution( functionId = "", executionId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/functions/list-executions.md b/docs/examples/kotlin/functions/list-executions.md index 9d2b0591..5fb16f85 100644 --- a/docs/examples/kotlin/functions/list-executions.md +++ b/docs/examples/kotlin/functions/list-executions.md @@ -13,4 +13,5 @@ val result = functions.listExecutions( functionId = "", queries = listOf(), // (optional) total = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/graphql/mutation.md b/docs/examples/kotlin/graphql/mutation.md index c95aaca2..0cdb78e6 100644 --- a/docs/examples/kotlin/graphql/mutation.md +++ b/docs/examples/kotlin/graphql/mutation.md @@ -11,4 +11,5 @@ val graphql = Graphql(client) val result = graphql.mutation( query = mapOf( "a" to "b" ), -)``` +) +``` diff --git a/docs/examples/kotlin/graphql/query.md b/docs/examples/kotlin/graphql/query.md index 24e2f587..3359822a 100644 --- a/docs/examples/kotlin/graphql/query.md +++ b/docs/examples/kotlin/graphql/query.md @@ -11,4 +11,5 @@ val graphql = Graphql(client) val result = graphql.query( query = mapOf( "a" to "b" ), -)``` +) +``` diff --git a/docs/examples/kotlin/messaging/create-subscriber.md b/docs/examples/kotlin/messaging/create-subscriber.md index 97dc3f62..09c28349 100644 --- a/docs/examples/kotlin/messaging/create-subscriber.md +++ b/docs/examples/kotlin/messaging/create-subscriber.md @@ -13,4 +13,5 @@ val result = messaging.createSubscriber( topicId = "", subscriberId = "", targetId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/messaging/delete-subscriber.md b/docs/examples/kotlin/messaging/delete-subscriber.md index ffa27b8a..7247e129 100644 --- a/docs/examples/kotlin/messaging/delete-subscriber.md +++ b/docs/examples/kotlin/messaging/delete-subscriber.md @@ -12,4 +12,5 @@ val messaging = Messaging(client) val result = messaging.deleteSubscriber( topicId = "", subscriberId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/organizations/create-downgrade-feedback.md b/docs/examples/kotlin/organizations/create-downgrade-feedback.md new file mode 100644 index 00000000..26aee56d --- /dev/null +++ b/docs/examples/kotlin/organizations/create-downgrade-feedback.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organizations + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val organizations = Organizations(client) + +val result = organizations.createDowngradeFeedback( + organizationId = "", + reason = "", + message = "", + fromPlanId = "", + toPlanId = "", +) +``` diff --git a/docs/examples/kotlin/organizations/delete.md b/docs/examples/kotlin/organizations/delete.md new file mode 100644 index 00000000..6a338e91 --- /dev/null +++ b/docs/examples/kotlin/organizations/delete.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organizations + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val organizations = Organizations(client) + +val result = organizations.delete( + organizationId = "", +) +``` diff --git a/docs/examples/kotlin/organizations/estimation-delete-organization.md b/docs/examples/kotlin/organizations/estimation-delete-organization.md new file mode 100644 index 00000000..ad9b69b9 --- /dev/null +++ b/docs/examples/kotlin/organizations/estimation-delete-organization.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organizations + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val organizations = Organizations(client) + +val result = organizations.estimationDeleteOrganization( + organizationId = "", +) +``` diff --git a/docs/examples/kotlin/organizations/get-billing-address.md b/docs/examples/kotlin/organizations/get-billing-address.md new file mode 100644 index 00000000..6420bb84 --- /dev/null +++ b/docs/examples/kotlin/organizations/get-billing-address.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organizations + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val organizations = Organizations(client) + +val result = organizations.getBillingAddress( + organizationId = "", + billingAddressId = "", +) +``` diff --git a/docs/examples/kotlin/organizations/get-payment-method.md b/docs/examples/kotlin/organizations/get-payment-method.md new file mode 100644 index 00000000..3f52ef9f --- /dev/null +++ b/docs/examples/kotlin/organizations/get-payment-method.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organizations + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val organizations = Organizations(client) + +val result = organizations.getPaymentMethod( + organizationId = "", + paymentMethodId = "", +) +``` diff --git a/docs/examples/kotlin/storage/create-file.md b/docs/examples/kotlin/storage/create-file.md index ece44db5..df33a5a2 100644 --- a/docs/examples/kotlin/storage/create-file.md +++ b/docs/examples/kotlin/storage/create-file.md @@ -17,4 +17,5 @@ val result = storage.createFile( fileId = "", file = InputFile.fromPath("file.png"), permissions = listOf(Permission.read(Role.any())), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/storage/delete-file.md b/docs/examples/kotlin/storage/delete-file.md index 6f498896..831ea2b2 100644 --- a/docs/examples/kotlin/storage/delete-file.md +++ b/docs/examples/kotlin/storage/delete-file.md @@ -12,4 +12,5 @@ val storage = Storage(client) val result = storage.deleteFile( bucketId = "", fileId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/storage/get-file-download.md b/docs/examples/kotlin/storage/get-file-download.md index 3895ab07..d60b5fa4 100644 --- a/docs/examples/kotlin/storage/get-file-download.md +++ b/docs/examples/kotlin/storage/get-file-download.md @@ -13,4 +13,5 @@ val result = storage.getFileDownload( bucketId = "", fileId = "", token = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/storage/get-file-preview.md b/docs/examples/kotlin/storage/get-file-preview.md index 6abf988b..2bb8cffd 100644 --- a/docs/examples/kotlin/storage/get-file-preview.md +++ b/docs/examples/kotlin/storage/get-file-preview.md @@ -26,4 +26,5 @@ val result = storage.getFilePreview( background = "", // (optional) output = ImageFormat.JPG, // (optional) token = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/storage/get-file-view.md b/docs/examples/kotlin/storage/get-file-view.md index d7adaf15..6e6e77f4 100644 --- a/docs/examples/kotlin/storage/get-file-view.md +++ b/docs/examples/kotlin/storage/get-file-view.md @@ -13,4 +13,5 @@ val result = storage.getFileView( bucketId = "", fileId = "", token = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/storage/get-file.md b/docs/examples/kotlin/storage/get-file.md index b5ab55a8..ac456abf 100644 --- a/docs/examples/kotlin/storage/get-file.md +++ b/docs/examples/kotlin/storage/get-file.md @@ -12,4 +12,5 @@ val storage = Storage(client) val result = storage.getFile( bucketId = "", fileId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/storage/list-files.md b/docs/examples/kotlin/storage/list-files.md index ee04acb0..7ad2ebee 100644 --- a/docs/examples/kotlin/storage/list-files.md +++ b/docs/examples/kotlin/storage/list-files.md @@ -14,4 +14,5 @@ val result = storage.listFiles( queries = listOf(), // (optional) search = "", // (optional) total = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/storage/update-file.md b/docs/examples/kotlin/storage/update-file.md index 23147c03..532c815b 100644 --- a/docs/examples/kotlin/storage/update-file.md +++ b/docs/examples/kotlin/storage/update-file.md @@ -16,4 +16,5 @@ val result = storage.updateFile( fileId = "", name = "", // (optional) permissions = listOf(Permission.read(Role.any())), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/create-operations.md b/docs/examples/kotlin/tablesdb/create-operations.md index da84d33a..93c32c54 100644 --- a/docs/examples/kotlin/tablesdb/create-operations.md +++ b/docs/examples/kotlin/tablesdb/create-operations.md @@ -20,4 +20,5 @@ val result = tablesDB.createOperations( "name" to "Walter O'Brien" ) )), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/create-row.md b/docs/examples/kotlin/tablesdb/create-row.md index c1ecee4a..e6e75051 100644 --- a/docs/examples/kotlin/tablesdb/create-row.md +++ b/docs/examples/kotlin/tablesdb/create-row.md @@ -24,4 +24,5 @@ val result = tablesDB.createRow( ), permissions = listOf(Permission.read(Role.any())), // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/create-transaction.md b/docs/examples/kotlin/tablesdb/create-transaction.md index 4b5148eb..dcf640c3 100644 --- a/docs/examples/kotlin/tablesdb/create-transaction.md +++ b/docs/examples/kotlin/tablesdb/create-transaction.md @@ -11,4 +11,5 @@ val tablesDB = TablesDB(client) val result = tablesDB.createTransaction( ttl = 60, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/decrement-row-column.md b/docs/examples/kotlin/tablesdb/decrement-row-column.md index e9c95ebd..848eea97 100644 --- a/docs/examples/kotlin/tablesdb/decrement-row-column.md +++ b/docs/examples/kotlin/tablesdb/decrement-row-column.md @@ -17,4 +17,5 @@ val result = tablesDB.decrementRowColumn( value = 0, // (optional) min = 0, // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/delete-row.md b/docs/examples/kotlin/tablesdb/delete-row.md index 60796eb5..976a7f88 100644 --- a/docs/examples/kotlin/tablesdb/delete-row.md +++ b/docs/examples/kotlin/tablesdb/delete-row.md @@ -14,4 +14,5 @@ val result = tablesDB.deleteRow( tableId = "", rowId = "", transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/delete-transaction.md b/docs/examples/kotlin/tablesdb/delete-transaction.md index 8186037e..d3237744 100644 --- a/docs/examples/kotlin/tablesdb/delete-transaction.md +++ b/docs/examples/kotlin/tablesdb/delete-transaction.md @@ -11,4 +11,5 @@ val tablesDB = TablesDB(client) val result = tablesDB.deleteTransaction( transactionId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/get-row.md b/docs/examples/kotlin/tablesdb/get-row.md index 52d50523..e40856a3 100644 --- a/docs/examples/kotlin/tablesdb/get-row.md +++ b/docs/examples/kotlin/tablesdb/get-row.md @@ -15,4 +15,5 @@ val result = tablesDB.getRow( rowId = "", queries = listOf(), // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/get-transaction.md b/docs/examples/kotlin/tablesdb/get-transaction.md index 94a4deb5..fd0e5ee6 100644 --- a/docs/examples/kotlin/tablesdb/get-transaction.md +++ b/docs/examples/kotlin/tablesdb/get-transaction.md @@ -11,4 +11,5 @@ val tablesDB = TablesDB(client) val result = tablesDB.getTransaction( transactionId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/increment-row-column.md b/docs/examples/kotlin/tablesdb/increment-row-column.md index 7820d260..85c03791 100644 --- a/docs/examples/kotlin/tablesdb/increment-row-column.md +++ b/docs/examples/kotlin/tablesdb/increment-row-column.md @@ -17,4 +17,5 @@ val result = tablesDB.incrementRowColumn( value = 0, // (optional) max = 0, // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/list-rows.md b/docs/examples/kotlin/tablesdb/list-rows.md index b6a54684..9957a86f 100644 --- a/docs/examples/kotlin/tablesdb/list-rows.md +++ b/docs/examples/kotlin/tablesdb/list-rows.md @@ -15,4 +15,5 @@ val result = tablesDB.listRows( queries = listOf(), // (optional) transactionId = "", // (optional) total = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/list-transactions.md b/docs/examples/kotlin/tablesdb/list-transactions.md index 44c824e7..03c9d5b4 100644 --- a/docs/examples/kotlin/tablesdb/list-transactions.md +++ b/docs/examples/kotlin/tablesdb/list-transactions.md @@ -11,4 +11,5 @@ val tablesDB = TablesDB(client) val result = tablesDB.listTransactions( queries = listOf(), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/update-row.md b/docs/examples/kotlin/tablesdb/update-row.md index 01a8d8c1..fcba331b 100644 --- a/docs/examples/kotlin/tablesdb/update-row.md +++ b/docs/examples/kotlin/tablesdb/update-row.md @@ -24,4 +24,5 @@ val result = tablesDB.updateRow( ), // (optional) permissions = listOf(Permission.read(Role.any())), // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/update-transaction.md b/docs/examples/kotlin/tablesdb/update-transaction.md index 98c0b816..4843e5b7 100644 --- a/docs/examples/kotlin/tablesdb/update-transaction.md +++ b/docs/examples/kotlin/tablesdb/update-transaction.md @@ -13,4 +13,5 @@ val result = tablesDB.updateTransaction( transactionId = "", commit = false, // (optional) rollback = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/tablesdb/upsert-row.md b/docs/examples/kotlin/tablesdb/upsert-row.md index aa3862d4..d0b52793 100644 --- a/docs/examples/kotlin/tablesdb/upsert-row.md +++ b/docs/examples/kotlin/tablesdb/upsert-row.md @@ -24,4 +24,5 @@ val result = tablesDB.upsertRow( ), // (optional) permissions = listOf(Permission.read(Role.any())), // (optional) transactionId = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/teams/create-membership.md b/docs/examples/kotlin/teams/create-membership.md index 5adfe4ea..e5289e64 100644 --- a/docs/examples/kotlin/teams/create-membership.md +++ b/docs/examples/kotlin/teams/create-membership.md @@ -17,4 +17,5 @@ val result = teams.createMembership( phone = "+12065550100", // (optional) url = "https://example.com", // (optional) name = "", // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/teams/create.md b/docs/examples/kotlin/teams/create.md index 3249279c..7b4bfcbc 100644 --- a/docs/examples/kotlin/teams/create.md +++ b/docs/examples/kotlin/teams/create.md @@ -13,4 +13,5 @@ val result = teams.create( teamId = "", name = "", roles = listOf(), // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/teams/delete-membership.md b/docs/examples/kotlin/teams/delete-membership.md index 731e954f..4c1cebea 100644 --- a/docs/examples/kotlin/teams/delete-membership.md +++ b/docs/examples/kotlin/teams/delete-membership.md @@ -12,4 +12,5 @@ val teams = Teams(client) val result = teams.deleteMembership( teamId = "", membershipId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/teams/delete.md b/docs/examples/kotlin/teams/delete.md index 614ebf11..03f319f8 100644 --- a/docs/examples/kotlin/teams/delete.md +++ b/docs/examples/kotlin/teams/delete.md @@ -11,4 +11,5 @@ val teams = Teams(client) val result = teams.delete( teamId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/teams/get-membership.md b/docs/examples/kotlin/teams/get-membership.md index bee60e9e..cc85d6fb 100644 --- a/docs/examples/kotlin/teams/get-membership.md +++ b/docs/examples/kotlin/teams/get-membership.md @@ -12,4 +12,5 @@ val teams = Teams(client) val result = teams.getMembership( teamId = "", membershipId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/teams/get-prefs.md b/docs/examples/kotlin/teams/get-prefs.md index 4f01527b..3fa7fb3f 100644 --- a/docs/examples/kotlin/teams/get-prefs.md +++ b/docs/examples/kotlin/teams/get-prefs.md @@ -11,4 +11,5 @@ val teams = Teams(client) val result = teams.getPrefs( teamId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/teams/get.md b/docs/examples/kotlin/teams/get.md index 7248a02a..a01167ca 100644 --- a/docs/examples/kotlin/teams/get.md +++ b/docs/examples/kotlin/teams/get.md @@ -11,4 +11,5 @@ val teams = Teams(client) val result = teams.get( teamId = "", -)``` +) +``` diff --git a/docs/examples/kotlin/teams/list-memberships.md b/docs/examples/kotlin/teams/list-memberships.md index 928f0dd7..43819424 100644 --- a/docs/examples/kotlin/teams/list-memberships.md +++ b/docs/examples/kotlin/teams/list-memberships.md @@ -14,4 +14,5 @@ val result = teams.listMemberships( queries = listOf(), // (optional) search = "", // (optional) total = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/teams/list.md b/docs/examples/kotlin/teams/list.md index 66c98cdc..d38ba474 100644 --- a/docs/examples/kotlin/teams/list.md +++ b/docs/examples/kotlin/teams/list.md @@ -13,4 +13,5 @@ val result = teams.list( queries = listOf(), // (optional) search = "", // (optional) total = false, // (optional) -)``` +) +``` diff --git a/docs/examples/kotlin/teams/update-membership-status.md b/docs/examples/kotlin/teams/update-membership-status.md index 53a3b264..cc4fb2fb 100644 --- a/docs/examples/kotlin/teams/update-membership-status.md +++ b/docs/examples/kotlin/teams/update-membership-status.md @@ -14,4 +14,5 @@ val result = teams.updateMembershipStatus( membershipId = "", userId = "", secret = "", -)``` +) +``` diff --git a/docs/examples/kotlin/teams/update-membership.md b/docs/examples/kotlin/teams/update-membership.md index 1c8b236a..6e721d4e 100644 --- a/docs/examples/kotlin/teams/update-membership.md +++ b/docs/examples/kotlin/teams/update-membership.md @@ -13,4 +13,5 @@ val result = teams.updateMembership( teamId = "", membershipId = "", roles = listOf(), -)``` +) +``` diff --git a/docs/examples/kotlin/teams/update-name.md b/docs/examples/kotlin/teams/update-name.md index 760a3b49..0248d246 100644 --- a/docs/examples/kotlin/teams/update-name.md +++ b/docs/examples/kotlin/teams/update-name.md @@ -12,4 +12,5 @@ val teams = Teams(client) val result = teams.updateName( teamId = "", name = "", -)``` +) +``` diff --git a/docs/examples/kotlin/teams/update-prefs.md b/docs/examples/kotlin/teams/update-prefs.md index 854cb2b6..fd6e44eb 100644 --- a/docs/examples/kotlin/teams/update-prefs.md +++ b/docs/examples/kotlin/teams/update-prefs.md @@ -12,4 +12,5 @@ val teams = Teams(client) val result = teams.updatePrefs( teamId = "", prefs = mapOf( "a" to "b" ), -)``` +) +``` diff --git a/library/src/main/java/io/appwrite/Channel.kt b/library/src/main/java/io/appwrite/Channel.kt index f358c721..bfe4073e 100644 --- a/library/src/main/java/io/appwrite/Channel.kt +++ b/library/src/main/java/io/appwrite/Channel.kt @@ -37,8 +37,12 @@ class Channel private constructor( * Internal helper to transition to next state with segment and ID * Public for extension function access */ - fun next(segment: String, id: String = "*"): Channel { - return Channel(segments + listOf(segment, normalize(id))) + fun next(segment: String, id: String? = null): Channel { + return if (id == null) { + Channel(segments + segment) + } else { + Channel(segments + listOf(segment, normalize(id))) + } } /** @@ -64,6 +68,9 @@ class Channel private constructor( fun bucket(id: String = "*"): Channel<_Bucket> = Channel(listOf("buckets", normalize(id))) + fun execution(id: String = "*"): Channel<_Execution> = + Channel(listOf("executions", normalize(id))) + fun function(id: String = "*"): Channel<_Func> = Channel(listOf("functions", normalize(id))) @@ -73,10 +80,7 @@ class Channel private constructor( fun membership(id: String = "*"): Channel<_Membership> = Channel(listOf("memberships", normalize(id))) - fun account(userId: String = ""): String { - val id = normalize(userId) - return if (id == "*") "account" else "account.$id" - } + fun account(): String = "account" // Global events fun documents(): String = "documents" @@ -93,13 +97,13 @@ class Channel private constructor( /** * Only available on Channel<_Database> */ -fun Channel<_Database>.collection(id: String = "*"): Channel<_Collection> = - this.next("collections", id) +fun Channel<_Database>.collection(id: String? = null): Channel<_Collection> = + this.next("collections", id ?: "*") /** * Only available on Channel<_Collection> */ -fun Channel<_Collection>.document(id: String = "*"): Channel<_Document> = +fun Channel<_Collection>.document(id: String? = null): Channel<_Document> = this.next("documents", id) // --- TABLESDB ROUTE --- @@ -107,13 +111,13 @@ fun Channel<_Collection>.document(id: String = "*"): Channel<_Document> = /** * Only available on Channel<_TablesDB> */ -fun Channel<_TablesDB>.table(id: String = "*"): Channel<_Table> = - this.next("tables", id) +fun Channel<_TablesDB>.table(id: String? = null): Channel<_Table> = + this.next("tables", id ?: "*") /** * Only available on Channel<_Table> */ -fun Channel<_Table>.row(id: String = "*"): Channel<_Row> = +fun Channel<_Table>.row(id: String? = null): Channel<_Row> = this.next("rows", id) // --- BUCKET ROUTE --- @@ -121,19 +125,11 @@ fun Channel<_Table>.row(id: String = "*"): Channel<_Row> = /** * Only available on Channel<_Bucket> */ -fun Channel<_Bucket>.file(id: String = "*"): Channel<_File> = +fun Channel<_Bucket>.file(id: String? = null): Channel<_File> = this.next("files", id) -// --- FUNCTION ROUTE --- - -/** - * Only available on Channel<_Func> - */ -fun Channel<_Func>.execution(id: String = "*"): Channel<_Execution> = - this.next("executions", id) - // --- TERMINAL ACTIONS --- -// Restricted to Actionable types (_Document, _Row, _File, _Execution, _Team, _Membership) +// Restricted to Actionable types (_Document, _Row, _File, _Team, _Membership) /** * Only available on Channel<_Document> @@ -198,27 +194,6 @@ fun Channel<_File>.update(): Channel<_Resolved> = fun Channel<_File>.delete(): Channel<_Resolved> = this.resolve("delete") -/** - * Only available on Channel<_Execution> - */ -@JvmName("createExecution") -fun Channel<_Execution>.create(): Channel<_Resolved> = - this.resolve("create") - -/** - * Only available on Channel<_Execution> - */ -@JvmName("updateExecution") -fun Channel<_Execution>.update(): Channel<_Resolved> = - this.resolve("update") - -/** - * Only available on Channel<_Execution> - */ -@JvmName("deleteExecution") -fun Channel<_Execution>.delete(): Channel<_Resolved> = - this.resolve("delete") - /** * Only available on Channel<_Team> */ diff --git a/library/src/main/java/io/appwrite/enums/OAuthProvider.kt b/library/src/main/java/io/appwrite/enums/OAuthProvider.kt index 955df300..443a05c4 100644 --- a/library/src/main/java/io/appwrite/enums/OAuthProvider.kt +++ b/library/src/main/java/io/appwrite/enums/OAuthProvider.kt @@ -80,7 +80,11 @@ enum class OAuthProvider(val value: String) { @SerializedName("zoho") ZOHO("zoho"), @SerializedName("zoom") - ZOOM("zoom"); + ZOOM("zoom"), + @SerializedName("githubImagine") + GITHUBIMAGINE("githubImagine"), + @SerializedName("googleImagine") + GOOGLEIMAGINE("googleImagine"); override fun toString() = value } \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/enums/Scopes.kt b/library/src/main/java/io/appwrite/enums/Scopes.kt new file mode 100644 index 00000000..f28370ee --- /dev/null +++ b/library/src/main/java/io/appwrite/enums/Scopes.kt @@ -0,0 +1,14 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class Scopes(val value: String) { + @SerializedName("account") + ACCOUNT("account"), + @SerializedName("teams.read") + TEAMS_READ("teams.read"), + @SerializedName("teams.write") + TEAMS_WRITE("teams.write"); + + override fun toString() = value +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/BillingAddress.kt b/library/src/main/java/io/appwrite/models/BillingAddress.kt new file mode 100644 index 00000000..c39adc74 --- /dev/null +++ b/library/src/main/java/io/appwrite/models/BillingAddress.kt @@ -0,0 +1,86 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * BillingAddress + */ +data class BillingAddress( + /** + * Region ID + */ + @SerializedName("\$id") + val id: String, + + /** + * User ID + */ + @SerializedName("userId") + val userId: String, + + /** + * Street address + */ + @SerializedName("streetAddress") + val streetAddress: String, + + /** + * Address line 2 + */ + @SerializedName("addressLine2") + val addressLine2: String, + + /** + * Address country + */ + @SerializedName("country") + val country: String, + + /** + * city + */ + @SerializedName("city") + val city: String, + + /** + * state + */ + @SerializedName("state") + val state: String, + + /** + * postal code + */ + @SerializedName("postalCode") + val postalCode: String, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "userId" to userId as Any, + "streetAddress" to streetAddress as Any, + "addressLine2" to addressLine2 as Any, + "country" to country as Any, + "city" to city as Any, + "state" to state as Any, + "postalCode" to postalCode as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = BillingAddress( + id = map["\$id"] as String, + userId = map["userId"] as String, + streetAddress = map["streetAddress"] as String, + addressLine2 = map["addressLine2"] as String, + country = map["country"] as String, + city = map["city"] as String, + state = map["state"] as String, + postalCode = map["postalCode"] as String, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/BillingAddressList.kt b/library/src/main/java/io/appwrite/models/BillingAddressList.kt new file mode 100644 index 00000000..a4205b71 --- /dev/null +++ b/library/src/main/java/io/appwrite/models/BillingAddressList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Billing address list + */ +data class BillingAddressList( + /** + * Total number of billingAddresses that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of billingAddresses. + */ + @SerializedName("billingAddresses") + val billingAddresses: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "billingAddresses" to billingAddresses.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = BillingAddressList( + total = (map["total"] as Number).toLong(), + billingAddresses = (map["billingAddresses"] as List>).map { BillingAddress.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/DowngradeFeedback.kt b/library/src/main/java/io/appwrite/models/DowngradeFeedback.kt new file mode 100644 index 00000000..b201372d --- /dev/null +++ b/library/src/main/java/io/appwrite/models/DowngradeFeedback.kt @@ -0,0 +1,102 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Downgrade Feedback + */ +data class DowngradeFeedback( + /** + * Feedback ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Feedback creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Feedback update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Feedback reason + */ + @SerializedName("title") + val title: String, + + /** + * Feedback message + */ + @SerializedName("message") + val message: String, + + /** + * Plan ID downgrading from + */ + @SerializedName("fromPlanId") + val fromPlanId: String, + + /** + * Plan ID downgrading to + */ + @SerializedName("toPlanId") + val toPlanId: String, + + /** + * Organization ID + */ + @SerializedName("teamId") + val teamId: String, + + /** + * User ID who submitted feedback + */ + @SerializedName("userId") + val userId: String, + + /** + * Console version + */ + @SerializedName("version") + val version: String, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "title" to title as Any, + "message" to message as Any, + "fromPlanId" to fromPlanId as Any, + "toPlanId" to toPlanId as Any, + "teamId" to teamId as Any, + "userId" to userId as Any, + "version" to version as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = DowngradeFeedback( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + title = map["title"] as String, + message = map["message"] as String, + fromPlanId = map["fromPlanId"] as String, + toPlanId = map["toPlanId"] as String, + teamId = map["teamId"] as String, + userId = map["userId"] as String, + version = map["version"] as String, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/EstimationDeleteOrganization.kt b/library/src/main/java/io/appwrite/models/EstimationDeleteOrganization.kt new file mode 100644 index 00000000..12838783 --- /dev/null +++ b/library/src/main/java/io/appwrite/models/EstimationDeleteOrganization.kt @@ -0,0 +1,30 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * EstimationDeleteOrganization + */ +data class EstimationDeleteOrganization( + /** + * List of unpaid invoices + */ + @SerializedName("unpaidInvoices") + val unpaidInvoices: List, + +) { + fun toMap(): Map = mapOf( + "unpaidInvoices" to unpaidInvoices.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = EstimationDeleteOrganization( + unpaidInvoices = (map["unpaidInvoices"] as List>).map { Invoice.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/Invoice.kt b/library/src/main/java/io/appwrite/models/Invoice.kt new file mode 100644 index 00000000..927a6c5c --- /dev/null +++ b/library/src/main/java/io/appwrite/models/Invoice.kt @@ -0,0 +1,198 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Invoice + */ +data class Invoice( + /** + * Invoice ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Invoice creation time in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Invoice update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Invoice permissions. [Learn more about permissions](/docs/permissions). + */ + @SerializedName("\$permissions") + val permissions: List, + + /** + * Project ID + */ + @SerializedName("teamId") + val teamId: String, + + /** + * Aggregation ID + */ + @SerializedName("aggregationId") + val aggregationId: String, + + /** + * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. + */ + @SerializedName("plan") + val plan: String, + + /** + * Usage breakdown per resource + */ + @SerializedName("usage") + val usage: List, + + /** + * Invoice Amount + */ + @SerializedName("amount") + val amount: Double, + + /** + * Tax percentage + */ + @SerializedName("tax") + val tax: Double, + + /** + * Tax amount + */ + @SerializedName("taxAmount") + val taxAmount: Double, + + /** + * VAT percentage + */ + @SerializedName("vat") + val vat: Double, + + /** + * VAT amount + */ + @SerializedName("vatAmount") + val vatAmount: Double, + + /** + * Gross amount after vat, tax, and discounts applied. + */ + @SerializedName("grossAmount") + val grossAmount: Double, + + /** + * Credits used. + */ + @SerializedName("creditsUsed") + val creditsUsed: Double, + + /** + * Currency the invoice is in + */ + @SerializedName("currency") + val currency: String, + + /** + * Client secret for processing failed payments in front-end + */ + @SerializedName("clientSecret") + val clientSecret: String, + + /** + * Invoice status + */ + @SerializedName("status") + val status: String, + + /** + * Last payment error associated with the invoice + */ + @SerializedName("lastError") + val lastError: String, + + /** + * Invoice due date. + */ + @SerializedName("dueAt") + val dueAt: String, + + /** + * Beginning date of the invoice + */ + @SerializedName("from") + val from: String, + + /** + * End date of the invoice + */ + @SerializedName("to") + val to: String, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "\$permissions" to permissions as Any, + "teamId" to teamId as Any, + "aggregationId" to aggregationId as Any, + "plan" to plan as Any, + "usage" to usage.map { it.toMap() } as Any, + "amount" to amount as Any, + "tax" to tax as Any, + "taxAmount" to taxAmount as Any, + "vat" to vat as Any, + "vatAmount" to vatAmount as Any, + "grossAmount" to grossAmount as Any, + "creditsUsed" to creditsUsed as Any, + "currency" to currency as Any, + "clientSecret" to clientSecret as Any, + "status" to status as Any, + "lastError" to lastError as Any, + "dueAt" to dueAt as Any, + "from" to from as Any, + "to" to to as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = Invoice( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + permissions = map["\$permissions"] as List, + teamId = map["teamId"] as String, + aggregationId = map["aggregationId"] as String, + plan = map["plan"] as String, + usage = (map["usage"] as List>).map { UsageResources.from(map = it) }, + amount = (map["amount"] as Number).toDouble(), + tax = (map["tax"] as Number).toDouble(), + taxAmount = (map["taxAmount"] as Number).toDouble(), + vat = (map["vat"] as Number).toDouble(), + vatAmount = (map["vatAmount"] as Number).toDouble(), + grossAmount = (map["grossAmount"] as Number).toDouble(), + creditsUsed = (map["creditsUsed"] as Number).toDouble(), + currency = map["currency"] as String, + clientSecret = map["clientSecret"] as String, + status = map["status"] as String, + lastError = map["lastError"] as String, + dueAt = map["dueAt"] as String, + from = map["from"] as String, + to = map["to"] as String, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/Key.kt b/library/src/main/java/io/appwrite/models/Key.kt new file mode 100644 index 00000000..83d9dd1c --- /dev/null +++ b/library/src/main/java/io/appwrite/models/Key.kt @@ -0,0 +1,94 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Key + */ +data class Key( + /** + * Key ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Key creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Key update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Key name. + */ + @SerializedName("name") + val name: String, + + /** + * Key expiration date in ISO 8601 format. + */ + @SerializedName("expire") + val expire: String, + + /** + * Allowed permission scopes. + */ + @SerializedName("scopes") + val scopes: List, + + /** + * Secret key. + */ + @SerializedName("secret") + val secret: String, + + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + @SerializedName("accessedAt") + val accessedAt: String, + + /** + * List of SDK user agents that used this key. + */ + @SerializedName("sdks") + val sdks: List, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "name" to name as Any, + "expire" to expire as Any, + "scopes" to scopes as Any, + "secret" to secret as Any, + "accessedAt" to accessedAt as Any, + "sdks" to sdks as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = Key( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + name = map["name"] as String, + expire = map["expire"] as String, + scopes = map["scopes"] as List, + secret = map["secret"] as String, + accessedAt = map["accessedAt"] as String, + sdks = map["sdks"] as List, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/KeyList.kt b/library/src/main/java/io/appwrite/models/KeyList.kt new file mode 100644 index 00000000..cc3875f7 --- /dev/null +++ b/library/src/main/java/io/appwrite/models/KeyList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * API Keys List + */ +data class KeyList( + /** + * Total number of keys that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of keys. + */ + @SerializedName("keys") + val keys: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "keys" to keys.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = KeyList( + total = (map["total"] as Number).toLong(), + keys = (map["keys"] as List>).map { Key.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/PaymentMethod.kt b/library/src/main/java/io/appwrite/models/PaymentMethod.kt new file mode 100644 index 00000000..0193d475 --- /dev/null +++ b/library/src/main/java/io/appwrite/models/PaymentMethod.kt @@ -0,0 +1,182 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * paymentMethod + */ +data class PaymentMethod( + /** + * Payment Method ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Payment method creation time in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Payment method update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Payment method permissions. [Learn more about permissions](/docs/permissions). + */ + @SerializedName("\$permissions") + val permissions: List, + + /** + * Payment method ID from the payment provider + */ + @SerializedName("providerMethodId") + val providerMethodId: String, + + /** + * Client secret hash for payment setup + */ + @SerializedName("clientSecret") + val clientSecret: String, + + /** + * User ID from the payment provider. + */ + @SerializedName("providerUserId") + val providerUserId: String, + + /** + * ID of the Team. + */ + @SerializedName("userId") + val userId: String, + + /** + * Expiry month of the payment method. + */ + @SerializedName("expiryMonth") + val expiryMonth: Long, + + /** + * Expiry year of the payment method. + */ + @SerializedName("expiryYear") + val expiryYear: Long, + + /** + * Last 4 digit of the payment method + */ + @SerializedName("last4") + val last4: String, + + /** + * Payment method brand + */ + @SerializedName("brand") + val brand: String, + + /** + * Name of the owner + */ + @SerializedName("name") + val name: String, + + /** + * Mandate ID of the payment method + */ + @SerializedName("mandateId") + val mandateId: String, + + /** + * Country of the payment method + */ + @SerializedName("country") + val country: String, + + /** + * State of the payment method + */ + @SerializedName("state") + val state: String, + + /** + * Last payment error associated with the payment method. + */ + @SerializedName("lastError") + val lastError: String, + + /** + * True when it's the default payment method. + */ + @SerializedName("default") + val default: Boolean, + + /** + * True when payment method has expired. + */ + @SerializedName("expired") + val expired: Boolean, + + /** + * True when payment method has failed to process multiple times. + */ + @SerializedName("failed") + val failed: Boolean, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "\$permissions" to permissions as Any, + "providerMethodId" to providerMethodId as Any, + "clientSecret" to clientSecret as Any, + "providerUserId" to providerUserId as Any, + "userId" to userId as Any, + "expiryMonth" to expiryMonth as Any, + "expiryYear" to expiryYear as Any, + "last4" to last4 as Any, + "brand" to brand as Any, + "name" to name as Any, + "mandateId" to mandateId as Any, + "country" to country as Any, + "state" to state as Any, + "lastError" to lastError as Any, + "default" to default as Any, + "expired" to expired as Any, + "failed" to failed as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = PaymentMethod( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + permissions = map["\$permissions"] as List, + providerMethodId = map["providerMethodId"] as String, + clientSecret = map["clientSecret"] as String, + providerUserId = map["providerUserId"] as String, + userId = map["userId"] as String, + expiryMonth = (map["expiryMonth"] as Number).toLong(), + expiryYear = (map["expiryYear"] as Number).toLong(), + last4 = map["last4"] as String, + brand = map["brand"] as String, + name = map["name"] as String, + mandateId = map["mandateId"] as String, + country = map["country"] as String, + state = map["state"] as String, + lastError = map["lastError"] as String, + default = map["default"] as Boolean, + expired = map["expired"] as Boolean, + failed = map["failed"] as Boolean, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/PaymentMethodList.kt b/library/src/main/java/io/appwrite/models/PaymentMethodList.kt new file mode 100644 index 00000000..d7a4c18a --- /dev/null +++ b/library/src/main/java/io/appwrite/models/PaymentMethodList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Payment methods list + */ +data class PaymentMethodList( + /** + * Total number of paymentMethods that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of paymentMethods. + */ + @SerializedName("paymentMethods") + val paymentMethods: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "paymentMethods" to paymentMethods.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = PaymentMethodList( + total = (map["total"] as Number).toLong(), + paymentMethods = (map["paymentMethods"] as List>).map { PaymentMethod.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/UsageResources.kt b/library/src/main/java/io/appwrite/models/UsageResources.kt new file mode 100644 index 00000000..d502bf08 --- /dev/null +++ b/library/src/main/java/io/appwrite/models/UsageResources.kt @@ -0,0 +1,70 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * UsageResource + */ +data class UsageResources( + /** + * Invoice name + */ + @SerializedName("name") + val name: String, + + /** + * Invoice value + */ + @SerializedName("value") + val value: Long, + + /** + * Invoice amount + */ + @SerializedName("amount") + val amount: Double, + + /** + * Invoice rate + */ + @SerializedName("rate") + val rate: Double, + + /** + * Invoice description + */ + @SerializedName("desc") + val desc: String, + + /** + * Resource ID + */ + @SerializedName("resourceId") + val resourceId: String, + +) { + fun toMap(): Map = mapOf( + "name" to name as Any, + "value" to value as Any, + "amount" to amount as Any, + "rate" to rate as Any, + "desc" to desc as Any, + "resourceId" to resourceId as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = UsageResources( + name = map["name"] as String, + value = (map["value"] as Number).toLong(), + amount = (map["amount"] as Number).toDouble(), + rate = (map["rate"] as Number).toDouble(), + desc = map["desc"] as String, + resourceId = map["resourceId"] as String, + ) + } +} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/services/Account.kt b/library/src/main/java/io/appwrite/services/Account.kt index 85914232..9a1d13b2 100644 --- a/library/src/main/java/io/appwrite/services/Account.kt +++ b/library/src/main/java/io/appwrite/services/Account.kt @@ -123,6 +123,195 @@ class Account(client: Client) : Service(client) { nestedType = classOf(), ) + /** + * List all billing addresses for a user. + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed + * @return [io.appwrite.models.BillingAddressList] + */ + @JvmOverloads + suspend fun listBillingAddresses( + queries: List? = null, + ): io.appwrite.models.BillingAddressList { + val apiPath = "/account/billing-addresses" + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.BillingAddressList = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.BillingAddressList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.BillingAddressList::class.java, + converter, + ) + } + + + /** + * Add a new billing address to a user's account. + * + * @param country Country + * @param city City + * @param streetAddress Street address + * @param addressLine2 Address line 2 + * @param state State or province + * @param postalCode Postal code + * @return [io.appwrite.models.BillingAddress] + */ + @JvmOverloads + suspend fun createBillingAddress( + country: String, + city: String, + streetAddress: String, + addressLine2: String? = null, + state: String? = null, + postalCode: String? = null, + ): io.appwrite.models.BillingAddress { + val apiPath = "/account/billing-addresses" + + val apiParams = mutableMapOf( + "country" to country, + "city" to city, + "streetAddress" to streetAddress, + "addressLine2" to addressLine2, + "state" to state, + "postalCode" to postalCode, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.BillingAddress = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.BillingAddress.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.BillingAddress::class.java, + converter, + ) + } + + + /** + * Get a specific billing address for a user using it's ID. + * + * @param billingAddressId Unique ID of billing address + * @return [io.appwrite.models.BillingAddress] + */ + suspend fun getBillingAddress( + billingAddressId: String, + ): io.appwrite.models.BillingAddress { + val apiPath = "/account/billing-addresses/{billingAddressId}" + .replace("{billingAddressId}", billingAddressId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.BillingAddress = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.BillingAddress.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.BillingAddress::class.java, + converter, + ) + } + + + /** + * Update a specific billing address using it's ID. + * + * @param billingAddressId Unique ID of billing address + * @param country Country + * @param city City + * @param streetAddress Street address + * @param addressLine2 Address line 2 + * @param state State or province + * @param postalCode Postal code + * @return [io.appwrite.models.BillingAddress] + */ + @JvmOverloads + suspend fun updateBillingAddress( + billingAddressId: String, + country: String, + city: String, + streetAddress: String, + addressLine2: String? = null, + state: String? = null, + postalCode: String? = null, + ): io.appwrite.models.BillingAddress { + val apiPath = "/account/billing-addresses/{billingAddressId}" + .replace("{billingAddressId}", billingAddressId) + + val apiParams = mutableMapOf( + "country" to country, + "city" to city, + "streetAddress" to streetAddress, + "addressLine2" to addressLine2, + "state" to state, + "postalCode" to postalCode, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.BillingAddress = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.BillingAddress.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.BillingAddress::class.java, + converter, + ) + } + + + /** + * Delete a specific billing address using it's ID. + * + * @param billingAddressId Billing address unique ID + * @return [Any] + */ + suspend fun deleteBillingAddress( + billingAddressId: String, + ): Any { + val apiPath = "/account/billing-addresses/{billingAddressId}" + .replace("{billingAddressId}", billingAddressId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. @@ -274,6 +463,177 @@ class Account(client: Client) : Service(client) { } + /** + * Get a list of all API keys from the current account. + * + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.KeyList] + */ + @JvmOverloads + suspend fun listKeys( + total: Boolean? = null, + ): io.appwrite.models.KeyList { + val apiPath = "/account/keys" + + val apiParams = mutableMapOf( + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.KeyList = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.KeyList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.KeyList::class.java, + converter, + ) + } + + + /** + * Create a new account API key. + * + * @param name Key name. Max length: 128 chars. + * @param scopes Key scopes list. Maximum of 100 scopes are allowed. + * @param expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @return [io.appwrite.models.Key] + */ + @JvmOverloads + suspend fun createKey( + name: String, + scopes: List, + expire: String? = null, + ): io.appwrite.models.Key { + val apiPath = "/account/keys" + + val apiParams = mutableMapOf( + "name" to name, + "scopes" to scopes, + "expire" to expire, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Key = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.Key.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Key::class.java, + converter, + ) + } + + + /** + * Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes. + * + * @param keyId Key unique ID. + * @return [io.appwrite.models.Key] + */ + suspend fun getKey( + keyId: String, + ): io.appwrite.models.Key { + val apiPath = "/account/keys/{keyId}" + .replace("{keyId}", keyId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Key = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.Key.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Key::class.java, + converter, + ) + } + + + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param keyId Key unique ID. + * @param name Key name. Max length: 128 chars. + * @param scopes Key scopes list. Maximum of 100 scopes are allowed. + * @param expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @return [io.appwrite.models.Key] + */ + @JvmOverloads + suspend fun updateKey( + keyId: String, + name: String, + scopes: List, + expire: String? = null, + ): io.appwrite.models.Key { + val apiPath = "/account/keys/{keyId}" + .replace("{keyId}", keyId) + + val apiParams = mutableMapOf( + "name" to name, + "scopes" to scopes, + "expire" to expire, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Key = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.Key.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Key::class.java, + converter, + ) + } + + + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param keyId Key unique ID. + * @return [Any] + */ + suspend fun deleteKey( + keyId: String, + ): Any { + val apiPath = "/account/keys/{keyId}" + .replace("{keyId}", keyId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. * @@ -1079,6 +1439,241 @@ class Account(client: Client) : Service(client) { nestedType = classOf(), ) + /** + * List payment methods for this account. + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed + * @return [io.appwrite.models.PaymentMethodList] + */ + @JvmOverloads + suspend fun listPaymentMethods( + queries: List? = null, + ): io.appwrite.models.PaymentMethodList { + val apiPath = "/account/payment-methods" + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.PaymentMethodList = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.PaymentMethodList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.PaymentMethodList::class.java, + converter, + ) + } + + + /** + * Create a new payment method for the current user account. + * + * @return [io.appwrite.models.PaymentMethod] + */ + suspend fun createPaymentMethod( + ): io.appwrite.models.PaymentMethod { + val apiPath = "/account/payment-methods" + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.PaymentMethod = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.PaymentMethod.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.PaymentMethod::class.java, + converter, + ) + } + + + /** + * Get a specific payment method for the user. + * + * @param paymentMethodId Unique ID of payment method + * @return [io.appwrite.models.PaymentMethod] + */ + suspend fun getPaymentMethod( + paymentMethodId: String, + ): io.appwrite.models.PaymentMethod { + val apiPath = "/account/payment-methods/{paymentMethodId}" + .replace("{paymentMethodId}", paymentMethodId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.PaymentMethod = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.PaymentMethod.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.PaymentMethod::class.java, + converter, + ) + } + + + /** + * Update a new payment method for the current user account. + * + * @param paymentMethodId Unique ID of payment method + * @param expiryMonth Payment expiry month + * @param expiryYear Expiry year + * @param state State of the payment method country + * @return [io.appwrite.models.PaymentMethod] + */ + @JvmOverloads + suspend fun updatePaymentMethod( + paymentMethodId: String, + expiryMonth: Long, + expiryYear: Long, + state: String? = null, + ): io.appwrite.models.PaymentMethod { + val apiPath = "/account/payment-methods/{paymentMethodId}" + .replace("{paymentMethodId}", paymentMethodId) + + val apiParams = mutableMapOf( + "expiryMonth" to expiryMonth, + "expiryYear" to expiryYear, + "state" to state, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.PaymentMethod = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.PaymentMethod.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.PaymentMethod::class.java, + converter, + ) + } + + + /** + * Delete a specific payment method from a user's account. + * + * @param paymentMethodId Unique ID of payment method + * @return [Any] + */ + suspend fun deletePaymentMethod( + paymentMethodId: String, + ): Any { + val apiPath = "/account/payment-methods/{paymentMethodId}" + .replace("{paymentMethodId}", paymentMethodId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + + /** + * Update payment method provider. + * + * @param paymentMethodId Unique ID of payment method + * @param providerMethodId Payment method ID from the payment provider + * @param name Name in the payment method + * @param state State of the payment method country + * @return [io.appwrite.models.PaymentMethod] + */ + @JvmOverloads + suspend fun updatePaymentMethodProvider( + paymentMethodId: String, + providerMethodId: String, + name: String, + state: String? = null, + ): io.appwrite.models.PaymentMethod { + val apiPath = "/account/payment-methods/{paymentMethodId}/provider" + .replace("{paymentMethodId}", paymentMethodId) + + val apiParams = mutableMapOf( + "providerMethodId" to providerMethodId, + "name" to name, + "state" to state, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.PaymentMethod = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.PaymentMethod.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.PaymentMethod::class.java, + converter, + ) + } + + + /** + * Update payment method mandate options. + * + * @param paymentMethodId Unique ID of payment method + * @return [io.appwrite.models.PaymentMethod] + */ + suspend fun updatePaymentMethodMandateOptions( + paymentMethodId: String, + ): io.appwrite.models.PaymentMethod { + val apiPath = "/account/payment-methods/{paymentMethodId}/setup" + .replace("{paymentMethodId}", paymentMethodId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.PaymentMethod = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.PaymentMethod.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.PaymentMethod::class.java, + converter, + ) + } + + /** * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. * @@ -1456,7 +2051,7 @@ class Account(client: Client) : Service(client) { * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * * - * @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. * @param success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -1924,7 +2519,7 @@ class Account(client: Client) : Service(client) { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. * @param success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. diff --git a/library/src/main/java/io/appwrite/services/Organizations.kt b/library/src/main/java/io/appwrite/services/Organizations.kt new file mode 100644 index 00000000..5edae0a8 --- /dev/null +++ b/library/src/main/java/io/appwrite/services/Organizations.kt @@ -0,0 +1,189 @@ +package io.appwrite.services + +import android.net.Uri +import io.appwrite.Client +import io.appwrite.Service +import io.appwrite.models.* +import io.appwrite.exceptions.AppwriteException +import io.appwrite.extensions.classOf +import okhttp3.Cookie +import java.io.File + +/** + * + */ +class Organizations(client: Client) : Service(client) { + + /** + * Delete an organization. + * + * @param organizationId Team ID. + * @return [Any] + */ + suspend fun delete( + organizationId: String, + ): Any { + val apiPath = "/organizations/{organizationId}" + .replace("{organizationId}", organizationId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + + /** + * Get a billing address using it's ID. + * + * @param organizationId Organization ID + * @param billingAddressId Unique ID of billing address + * @return [io.appwrite.models.BillingAddress] + */ + suspend fun getBillingAddress( + organizationId: String, + billingAddressId: String, + ): io.appwrite.models.BillingAddress { + val apiPath = "/organizations/{organizationId}/billing-addresses/{billingAddressId}" + .replace("{organizationId}", organizationId) + .replace("{billingAddressId}", billingAddressId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.BillingAddress = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.BillingAddress.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.BillingAddress::class.java, + converter, + ) + } + + + /** + * Get estimation for deleting an organization. + * + * @param organizationId Team ID. + * @return [io.appwrite.models.EstimationDeleteOrganization] + */ + suspend fun estimationDeleteOrganization( + organizationId: String, + ): io.appwrite.models.EstimationDeleteOrganization { + val apiPath = "/organizations/{organizationId}/estimations/delete-organization" + .replace("{organizationId}", organizationId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.EstimationDeleteOrganization = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.EstimationDeleteOrganization.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.EstimationDeleteOrganization::class.java, + converter, + ) + } + + + /** + * Submit feedback about downgrading from a paid plan to a lower tier. This helps the team understand user experience and improve the platform. + * + * + * @param organizationId Organization Unique ID + * @param reason Feedback reason + * @param message Feedback message + * @param fromPlanId Plan downgrading from + * @param toPlanId Plan downgrading to + * @return [io.appwrite.models.DowngradeFeedback] + */ + suspend fun createDowngradeFeedback( + organizationId: String, + reason: String, + message: String, + fromPlanId: String, + toPlanId: String, + ): io.appwrite.models.DowngradeFeedback { + val apiPath = "/organizations/{organizationId}/feedbacks/downgrade" + .replace("{organizationId}", organizationId) + + val apiParams = mutableMapOf( + "reason" to reason, + "message" to message, + "fromPlanId" to fromPlanId, + "toPlanId" to toPlanId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DowngradeFeedback = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.DowngradeFeedback.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.DowngradeFeedback::class.java, + converter, + ) + } + + + /** + * Get an organization's payment method using it's payment method ID. + * + * @param organizationId Organization ID + * @param paymentMethodId Unique ID of payment method + * @return [io.appwrite.models.PaymentMethod] + */ + suspend fun getPaymentMethod( + organizationId: String, + paymentMethodId: String, + ): io.appwrite.models.PaymentMethod { + val apiPath = "/organizations/{organizationId}/payment-methods/{paymentMethodId}" + .replace("{organizationId}", organizationId) + .replace("{paymentMethodId}", paymentMethodId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.PaymentMethod = { + @Suppress("UNCHECKED_CAST") + io.appwrite.models.PaymentMethod.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.PaymentMethod::class.java, + converter, + ) + } + + +} \ No newline at end of file From b498785d68e20f586b6b1fa9861083dbd8b58713 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 13 Feb 2026 08:38:38 +0000 Subject: [PATCH 2/3] updated specs --- .../java/account/create-billing-address.md | 29 --- .../java/account/delete-billing-address.md | 24 --- .../java/account/get-billing-address.md | 24 --- .../java/account/list-billing-addresses.md | 24 --- .../java/account/update-billing-address.md | 30 --- .../create-downgrade-feedback.md | 28 --- docs/examples/java/organizations/delete.md | 24 --- .../estimation-delete-organization.md | 24 --- .../java/organizations/get-billing-address.md | 25 --- .../java/organizations/get-payment-method.md | 25 --- .../kotlin/account/create-billing-address.md | 20 -- .../kotlin/account/delete-billing-address.md | 15 -- .../kotlin/account/get-billing-address.md | 15 -- .../kotlin/account/list-billing-addresses.md | 15 -- .../kotlin/account/update-billing-address.md | 21 -- .../create-downgrade-feedback.md | 19 -- docs/examples/kotlin/organizations/delete.md | 15 -- .../estimation-delete-organization.md | 15 -- .../organizations/get-billing-address.md | 16 -- .../organizations/get-payment-method.md | 16 -- .../java/io/appwrite/models/BillingAddress.kt | 86 -------- .../io/appwrite/models/BillingAddressList.kt | 38 ---- .../io/appwrite/models/DowngradeFeedback.kt | 102 --------- .../models/EstimationDeleteOrganization.kt | 30 --- .../main/java/io/appwrite/models/Invoice.kt | 198 ------------------ .../java/io/appwrite/models/UsageResources.kt | 70 ------- .../main/java/io/appwrite/services/Account.kt | 189 ----------------- .../io/appwrite/services/Organizations.kt | 189 ----------------- 28 files changed, 1326 deletions(-) delete mode 100644 docs/examples/java/account/create-billing-address.md delete mode 100644 docs/examples/java/account/delete-billing-address.md delete mode 100644 docs/examples/java/account/get-billing-address.md delete mode 100644 docs/examples/java/account/list-billing-addresses.md delete mode 100644 docs/examples/java/account/update-billing-address.md delete mode 100644 docs/examples/java/organizations/create-downgrade-feedback.md delete mode 100644 docs/examples/java/organizations/delete.md delete mode 100644 docs/examples/java/organizations/estimation-delete-organization.md delete mode 100644 docs/examples/java/organizations/get-billing-address.md delete mode 100644 docs/examples/java/organizations/get-payment-method.md delete mode 100644 docs/examples/kotlin/account/create-billing-address.md delete mode 100644 docs/examples/kotlin/account/delete-billing-address.md delete mode 100644 docs/examples/kotlin/account/get-billing-address.md delete mode 100644 docs/examples/kotlin/account/list-billing-addresses.md delete mode 100644 docs/examples/kotlin/account/update-billing-address.md delete mode 100644 docs/examples/kotlin/organizations/create-downgrade-feedback.md delete mode 100644 docs/examples/kotlin/organizations/delete.md delete mode 100644 docs/examples/kotlin/organizations/estimation-delete-organization.md delete mode 100644 docs/examples/kotlin/organizations/get-billing-address.md delete mode 100644 docs/examples/kotlin/organizations/get-payment-method.md delete mode 100644 library/src/main/java/io/appwrite/models/BillingAddress.kt delete mode 100644 library/src/main/java/io/appwrite/models/BillingAddressList.kt delete mode 100644 library/src/main/java/io/appwrite/models/DowngradeFeedback.kt delete mode 100644 library/src/main/java/io/appwrite/models/EstimationDeleteOrganization.kt delete mode 100644 library/src/main/java/io/appwrite/models/Invoice.kt delete mode 100644 library/src/main/java/io/appwrite/models/UsageResources.kt delete mode 100644 library/src/main/java/io/appwrite/services/Organizations.kt diff --git a/docs/examples/java/account/create-billing-address.md b/docs/examples/java/account/create-billing-address.md deleted file mode 100644 index 8669d084..00000000 --- a/docs/examples/java/account/create-billing-address.md +++ /dev/null @@ -1,29 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.createBillingAddress( - "", // country - "", // city - "", // streetAddress - "", // addressLine2 (optional) - "", // state (optional) - "", // postalCode (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/delete-billing-address.md b/docs/examples/java/account/delete-billing-address.md deleted file mode 100644 index 898ec56d..00000000 --- a/docs/examples/java/account/delete-billing-address.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.deleteBillingAddress( - "", // billingAddressId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/get-billing-address.md b/docs/examples/java/account/get-billing-address.md deleted file mode 100644 index 32cea8f8..00000000 --- a/docs/examples/java/account/get-billing-address.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.getBillingAddress( - "", // billingAddressId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/list-billing-addresses.md b/docs/examples/java/account/list-billing-addresses.md deleted file mode 100644 index ce7bdc81..00000000 --- a/docs/examples/java/account/list-billing-addresses.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.listBillingAddresses( - List.of(), // queries (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/update-billing-address.md b/docs/examples/java/account/update-billing-address.md deleted file mode 100644 index aeb12583..00000000 --- a/docs/examples/java/account/update-billing-address.md +++ /dev/null @@ -1,30 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.updateBillingAddress( - "", // billingAddressId - "", // country - "", // city - "", // streetAddress - "", // addressLine2 (optional) - "", // state (optional) - "", // postalCode (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/organizations/create-downgrade-feedback.md b/docs/examples/java/organizations/create-downgrade-feedback.md deleted file mode 100644 index 20b5e757..00000000 --- a/docs/examples/java/organizations/create-downgrade-feedback.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Organizations; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Organizations organizations = new Organizations(client); - -organizations.createDowngradeFeedback( - "", // organizationId - "", // reason - "", // message - "", // fromPlanId - "", // toPlanId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/organizations/delete.md b/docs/examples/java/organizations/delete.md deleted file mode 100644 index 1c032eba..00000000 --- a/docs/examples/java/organizations/delete.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Organizations; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Organizations organizations = new Organizations(client); - -organizations.delete( - "", // organizationId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/organizations/estimation-delete-organization.md b/docs/examples/java/organizations/estimation-delete-organization.md deleted file mode 100644 index 8477c9a8..00000000 --- a/docs/examples/java/organizations/estimation-delete-organization.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Organizations; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Organizations organizations = new Organizations(client); - -organizations.estimationDeleteOrganization( - "", // organizationId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/organizations/get-billing-address.md b/docs/examples/java/organizations/get-billing-address.md deleted file mode 100644 index 0eaa729f..00000000 --- a/docs/examples/java/organizations/get-billing-address.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Organizations; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Organizations organizations = new Organizations(client); - -organizations.getBillingAddress( - "", // organizationId - "", // billingAddressId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/organizations/get-payment-method.md b/docs/examples/java/organizations/get-payment-method.md deleted file mode 100644 index 1be14ec3..00000000 --- a/docs/examples/java/organizations/get-payment-method.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Organizations; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Organizations organizations = new Organizations(client); - -organizations.getPaymentMethod( - "", // organizationId - "", // paymentMethodId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/kotlin/account/create-billing-address.md b/docs/examples/kotlin/account/create-billing-address.md deleted file mode 100644 index a12e9278..00000000 --- a/docs/examples/kotlin/account/create-billing-address.md +++ /dev/null @@ -1,20 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.createBillingAddress( - country = "", - city = "", - streetAddress = "", - addressLine2 = "", // (optional) - state = "", // (optional) - postalCode = "", // (optional) -) -``` diff --git a/docs/examples/kotlin/account/delete-billing-address.md b/docs/examples/kotlin/account/delete-billing-address.md deleted file mode 100644 index 7c2fde1a..00000000 --- a/docs/examples/kotlin/account/delete-billing-address.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.deleteBillingAddress( - billingAddressId = "", -) -``` diff --git a/docs/examples/kotlin/account/get-billing-address.md b/docs/examples/kotlin/account/get-billing-address.md deleted file mode 100644 index 4ca4e50e..00000000 --- a/docs/examples/kotlin/account/get-billing-address.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.getBillingAddress( - billingAddressId = "", -) -``` diff --git a/docs/examples/kotlin/account/list-billing-addresses.md b/docs/examples/kotlin/account/list-billing-addresses.md deleted file mode 100644 index 034f7ac6..00000000 --- a/docs/examples/kotlin/account/list-billing-addresses.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.listBillingAddresses( - queries = listOf(), // (optional) -) -``` diff --git a/docs/examples/kotlin/account/update-billing-address.md b/docs/examples/kotlin/account/update-billing-address.md deleted file mode 100644 index e9a24f3e..00000000 --- a/docs/examples/kotlin/account/update-billing-address.md +++ /dev/null @@ -1,21 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.updateBillingAddress( - billingAddressId = "", - country = "", - city = "", - streetAddress = "", - addressLine2 = "", // (optional) - state = "", // (optional) - postalCode = "", // (optional) -) -``` diff --git a/docs/examples/kotlin/organizations/create-downgrade-feedback.md b/docs/examples/kotlin/organizations/create-downgrade-feedback.md deleted file mode 100644 index 26aee56d..00000000 --- a/docs/examples/kotlin/organizations/create-downgrade-feedback.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Organizations - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val organizations = Organizations(client) - -val result = organizations.createDowngradeFeedback( - organizationId = "", - reason = "", - message = "", - fromPlanId = "", - toPlanId = "", -) -``` diff --git a/docs/examples/kotlin/organizations/delete.md b/docs/examples/kotlin/organizations/delete.md deleted file mode 100644 index 6a338e91..00000000 --- a/docs/examples/kotlin/organizations/delete.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Organizations - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val organizations = Organizations(client) - -val result = organizations.delete( - organizationId = "", -) -``` diff --git a/docs/examples/kotlin/organizations/estimation-delete-organization.md b/docs/examples/kotlin/organizations/estimation-delete-organization.md deleted file mode 100644 index ad9b69b9..00000000 --- a/docs/examples/kotlin/organizations/estimation-delete-organization.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Organizations - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val organizations = Organizations(client) - -val result = organizations.estimationDeleteOrganization( - organizationId = "", -) -``` diff --git a/docs/examples/kotlin/organizations/get-billing-address.md b/docs/examples/kotlin/organizations/get-billing-address.md deleted file mode 100644 index 6420bb84..00000000 --- a/docs/examples/kotlin/organizations/get-billing-address.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Organizations - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val organizations = Organizations(client) - -val result = organizations.getBillingAddress( - organizationId = "", - billingAddressId = "", -) -``` diff --git a/docs/examples/kotlin/organizations/get-payment-method.md b/docs/examples/kotlin/organizations/get-payment-method.md deleted file mode 100644 index 3f52ef9f..00000000 --- a/docs/examples/kotlin/organizations/get-payment-method.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Organizations - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val organizations = Organizations(client) - -val result = organizations.getPaymentMethod( - organizationId = "", - paymentMethodId = "", -) -``` diff --git a/library/src/main/java/io/appwrite/models/BillingAddress.kt b/library/src/main/java/io/appwrite/models/BillingAddress.kt deleted file mode 100644 index c39adc74..00000000 --- a/library/src/main/java/io/appwrite/models/BillingAddress.kt +++ /dev/null @@ -1,86 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * BillingAddress - */ -data class BillingAddress( - /** - * Region ID - */ - @SerializedName("\$id") - val id: String, - - /** - * User ID - */ - @SerializedName("userId") - val userId: String, - - /** - * Street address - */ - @SerializedName("streetAddress") - val streetAddress: String, - - /** - * Address line 2 - */ - @SerializedName("addressLine2") - val addressLine2: String, - - /** - * Address country - */ - @SerializedName("country") - val country: String, - - /** - * city - */ - @SerializedName("city") - val city: String, - - /** - * state - */ - @SerializedName("state") - val state: String, - - /** - * postal code - */ - @SerializedName("postalCode") - val postalCode: String, - -) { - fun toMap(): Map = mapOf( - "\$id" to id as Any, - "userId" to userId as Any, - "streetAddress" to streetAddress as Any, - "addressLine2" to addressLine2 as Any, - "country" to country as Any, - "city" to city as Any, - "state" to state as Any, - "postalCode" to postalCode as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = BillingAddress( - id = map["\$id"] as String, - userId = map["userId"] as String, - streetAddress = map["streetAddress"] as String, - addressLine2 = map["addressLine2"] as String, - country = map["country"] as String, - city = map["city"] as String, - state = map["state"] as String, - postalCode = map["postalCode"] as String, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/BillingAddressList.kt b/library/src/main/java/io/appwrite/models/BillingAddressList.kt deleted file mode 100644 index a4205b71..00000000 --- a/library/src/main/java/io/appwrite/models/BillingAddressList.kt +++ /dev/null @@ -1,38 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * Billing address list - */ -data class BillingAddressList( - /** - * Total number of billingAddresses that matched your query. - */ - @SerializedName("total") - val total: Long, - - /** - * List of billingAddresses. - */ - @SerializedName("billingAddresses") - val billingAddresses: List, - -) { - fun toMap(): Map = mapOf( - "total" to total as Any, - "billingAddresses" to billingAddresses.map { it.toMap() } as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = BillingAddressList( - total = (map["total"] as Number).toLong(), - billingAddresses = (map["billingAddresses"] as List>).map { BillingAddress.from(map = it) }, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/DowngradeFeedback.kt b/library/src/main/java/io/appwrite/models/DowngradeFeedback.kt deleted file mode 100644 index b201372d..00000000 --- a/library/src/main/java/io/appwrite/models/DowngradeFeedback.kt +++ /dev/null @@ -1,102 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * Downgrade Feedback - */ -data class DowngradeFeedback( - /** - * Feedback ID. - */ - @SerializedName("\$id") - val id: String, - - /** - * Feedback creation date in ISO 8601 format. - */ - @SerializedName("\$createdAt") - val createdAt: String, - - /** - * Feedback update date in ISO 8601 format. - */ - @SerializedName("\$updatedAt") - val updatedAt: String, - - /** - * Feedback reason - */ - @SerializedName("title") - val title: String, - - /** - * Feedback message - */ - @SerializedName("message") - val message: String, - - /** - * Plan ID downgrading from - */ - @SerializedName("fromPlanId") - val fromPlanId: String, - - /** - * Plan ID downgrading to - */ - @SerializedName("toPlanId") - val toPlanId: String, - - /** - * Organization ID - */ - @SerializedName("teamId") - val teamId: String, - - /** - * User ID who submitted feedback - */ - @SerializedName("userId") - val userId: String, - - /** - * Console version - */ - @SerializedName("version") - val version: String, - -) { - fun toMap(): Map = mapOf( - "\$id" to id as Any, - "\$createdAt" to createdAt as Any, - "\$updatedAt" to updatedAt as Any, - "title" to title as Any, - "message" to message as Any, - "fromPlanId" to fromPlanId as Any, - "toPlanId" to toPlanId as Any, - "teamId" to teamId as Any, - "userId" to userId as Any, - "version" to version as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = DowngradeFeedback( - id = map["\$id"] as String, - createdAt = map["\$createdAt"] as String, - updatedAt = map["\$updatedAt"] as String, - title = map["title"] as String, - message = map["message"] as String, - fromPlanId = map["fromPlanId"] as String, - toPlanId = map["toPlanId"] as String, - teamId = map["teamId"] as String, - userId = map["userId"] as String, - version = map["version"] as String, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/EstimationDeleteOrganization.kt b/library/src/main/java/io/appwrite/models/EstimationDeleteOrganization.kt deleted file mode 100644 index 12838783..00000000 --- a/library/src/main/java/io/appwrite/models/EstimationDeleteOrganization.kt +++ /dev/null @@ -1,30 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * EstimationDeleteOrganization - */ -data class EstimationDeleteOrganization( - /** - * List of unpaid invoices - */ - @SerializedName("unpaidInvoices") - val unpaidInvoices: List, - -) { - fun toMap(): Map = mapOf( - "unpaidInvoices" to unpaidInvoices.map { it.toMap() } as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = EstimationDeleteOrganization( - unpaidInvoices = (map["unpaidInvoices"] as List>).map { Invoice.from(map = it) }, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/Invoice.kt b/library/src/main/java/io/appwrite/models/Invoice.kt deleted file mode 100644 index 927a6c5c..00000000 --- a/library/src/main/java/io/appwrite/models/Invoice.kt +++ /dev/null @@ -1,198 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * Invoice - */ -data class Invoice( - /** - * Invoice ID. - */ - @SerializedName("\$id") - val id: String, - - /** - * Invoice creation time in ISO 8601 format. - */ - @SerializedName("\$createdAt") - val createdAt: String, - - /** - * Invoice update date in ISO 8601 format. - */ - @SerializedName("\$updatedAt") - val updatedAt: String, - - /** - * Invoice permissions. [Learn more about permissions](/docs/permissions). - */ - @SerializedName("\$permissions") - val permissions: List, - - /** - * Project ID - */ - @SerializedName("teamId") - val teamId: String, - - /** - * Aggregation ID - */ - @SerializedName("aggregationId") - val aggregationId: String, - - /** - * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. - */ - @SerializedName("plan") - val plan: String, - - /** - * Usage breakdown per resource - */ - @SerializedName("usage") - val usage: List, - - /** - * Invoice Amount - */ - @SerializedName("amount") - val amount: Double, - - /** - * Tax percentage - */ - @SerializedName("tax") - val tax: Double, - - /** - * Tax amount - */ - @SerializedName("taxAmount") - val taxAmount: Double, - - /** - * VAT percentage - */ - @SerializedName("vat") - val vat: Double, - - /** - * VAT amount - */ - @SerializedName("vatAmount") - val vatAmount: Double, - - /** - * Gross amount after vat, tax, and discounts applied. - */ - @SerializedName("grossAmount") - val grossAmount: Double, - - /** - * Credits used. - */ - @SerializedName("creditsUsed") - val creditsUsed: Double, - - /** - * Currency the invoice is in - */ - @SerializedName("currency") - val currency: String, - - /** - * Client secret for processing failed payments in front-end - */ - @SerializedName("clientSecret") - val clientSecret: String, - - /** - * Invoice status - */ - @SerializedName("status") - val status: String, - - /** - * Last payment error associated with the invoice - */ - @SerializedName("lastError") - val lastError: String, - - /** - * Invoice due date. - */ - @SerializedName("dueAt") - val dueAt: String, - - /** - * Beginning date of the invoice - */ - @SerializedName("from") - val from: String, - - /** - * End date of the invoice - */ - @SerializedName("to") - val to: String, - -) { - fun toMap(): Map = mapOf( - "\$id" to id as Any, - "\$createdAt" to createdAt as Any, - "\$updatedAt" to updatedAt as Any, - "\$permissions" to permissions as Any, - "teamId" to teamId as Any, - "aggregationId" to aggregationId as Any, - "plan" to plan as Any, - "usage" to usage.map { it.toMap() } as Any, - "amount" to amount as Any, - "tax" to tax as Any, - "taxAmount" to taxAmount as Any, - "vat" to vat as Any, - "vatAmount" to vatAmount as Any, - "grossAmount" to grossAmount as Any, - "creditsUsed" to creditsUsed as Any, - "currency" to currency as Any, - "clientSecret" to clientSecret as Any, - "status" to status as Any, - "lastError" to lastError as Any, - "dueAt" to dueAt as Any, - "from" to from as Any, - "to" to to as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = Invoice( - id = map["\$id"] as String, - createdAt = map["\$createdAt"] as String, - updatedAt = map["\$updatedAt"] as String, - permissions = map["\$permissions"] as List, - teamId = map["teamId"] as String, - aggregationId = map["aggregationId"] as String, - plan = map["plan"] as String, - usage = (map["usage"] as List>).map { UsageResources.from(map = it) }, - amount = (map["amount"] as Number).toDouble(), - tax = (map["tax"] as Number).toDouble(), - taxAmount = (map["taxAmount"] as Number).toDouble(), - vat = (map["vat"] as Number).toDouble(), - vatAmount = (map["vatAmount"] as Number).toDouble(), - grossAmount = (map["grossAmount"] as Number).toDouble(), - creditsUsed = (map["creditsUsed"] as Number).toDouble(), - currency = map["currency"] as String, - clientSecret = map["clientSecret"] as String, - status = map["status"] as String, - lastError = map["lastError"] as String, - dueAt = map["dueAt"] as String, - from = map["from"] as String, - to = map["to"] as String, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/UsageResources.kt b/library/src/main/java/io/appwrite/models/UsageResources.kt deleted file mode 100644 index d502bf08..00000000 --- a/library/src/main/java/io/appwrite/models/UsageResources.kt +++ /dev/null @@ -1,70 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * UsageResource - */ -data class UsageResources( - /** - * Invoice name - */ - @SerializedName("name") - val name: String, - - /** - * Invoice value - */ - @SerializedName("value") - val value: Long, - - /** - * Invoice amount - */ - @SerializedName("amount") - val amount: Double, - - /** - * Invoice rate - */ - @SerializedName("rate") - val rate: Double, - - /** - * Invoice description - */ - @SerializedName("desc") - val desc: String, - - /** - * Resource ID - */ - @SerializedName("resourceId") - val resourceId: String, - -) { - fun toMap(): Map = mapOf( - "name" to name as Any, - "value" to value as Any, - "amount" to amount as Any, - "rate" to rate as Any, - "desc" to desc as Any, - "resourceId" to resourceId as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = UsageResources( - name = map["name"] as String, - value = (map["value"] as Number).toLong(), - amount = (map["amount"] as Number).toDouble(), - rate = (map["rate"] as Number).toDouble(), - desc = map["desc"] as String, - resourceId = map["resourceId"] as String, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/services/Account.kt b/library/src/main/java/io/appwrite/services/Account.kt index 9a1d13b2..abd6914b 100644 --- a/library/src/main/java/io/appwrite/services/Account.kt +++ b/library/src/main/java/io/appwrite/services/Account.kt @@ -123,195 +123,6 @@ class Account(client: Client) : Service(client) { nestedType = classOf(), ) - /** - * List all billing addresses for a user. - * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed - * @return [io.appwrite.models.BillingAddressList] - */ - @JvmOverloads - suspend fun listBillingAddresses( - queries: List? = null, - ): io.appwrite.models.BillingAddressList { - val apiPath = "/account/billing-addresses" - - val apiParams = mutableMapOf( - "queries" to queries, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.BillingAddressList = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.BillingAddressList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.BillingAddressList::class.java, - converter, - ) - } - - - /** - * Add a new billing address to a user's account. - * - * @param country Country - * @param city City - * @param streetAddress Street address - * @param addressLine2 Address line 2 - * @param state State or province - * @param postalCode Postal code - * @return [io.appwrite.models.BillingAddress] - */ - @JvmOverloads - suspend fun createBillingAddress( - country: String, - city: String, - streetAddress: String, - addressLine2: String? = null, - state: String? = null, - postalCode: String? = null, - ): io.appwrite.models.BillingAddress { - val apiPath = "/account/billing-addresses" - - val apiParams = mutableMapOf( - "country" to country, - "city" to city, - "streetAddress" to streetAddress, - "addressLine2" to addressLine2, - "state" to state, - "postalCode" to postalCode, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.BillingAddress = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.BillingAddress.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.BillingAddress::class.java, - converter, - ) - } - - - /** - * Get a specific billing address for a user using it's ID. - * - * @param billingAddressId Unique ID of billing address - * @return [io.appwrite.models.BillingAddress] - */ - suspend fun getBillingAddress( - billingAddressId: String, - ): io.appwrite.models.BillingAddress { - val apiPath = "/account/billing-addresses/{billingAddressId}" - .replace("{billingAddressId}", billingAddressId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.BillingAddress = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.BillingAddress.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.BillingAddress::class.java, - converter, - ) - } - - - /** - * Update a specific billing address using it's ID. - * - * @param billingAddressId Unique ID of billing address - * @param country Country - * @param city City - * @param streetAddress Street address - * @param addressLine2 Address line 2 - * @param state State or province - * @param postalCode Postal code - * @return [io.appwrite.models.BillingAddress] - */ - @JvmOverloads - suspend fun updateBillingAddress( - billingAddressId: String, - country: String, - city: String, - streetAddress: String, - addressLine2: String? = null, - state: String? = null, - postalCode: String? = null, - ): io.appwrite.models.BillingAddress { - val apiPath = "/account/billing-addresses/{billingAddressId}" - .replace("{billingAddressId}", billingAddressId) - - val apiParams = mutableMapOf( - "country" to country, - "city" to city, - "streetAddress" to streetAddress, - "addressLine2" to addressLine2, - "state" to state, - "postalCode" to postalCode, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.BillingAddress = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.BillingAddress.from(map = it as Map) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.BillingAddress::class.java, - converter, - ) - } - - - /** - * Delete a specific billing address using it's ID. - * - * @param billingAddressId Billing address unique ID - * @return [Any] - */ - suspend fun deleteBillingAddress( - billingAddressId: String, - ): Any { - val apiPath = "/account/billing-addresses/{billingAddressId}" - .replace("{billingAddressId}", billingAddressId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. diff --git a/library/src/main/java/io/appwrite/services/Organizations.kt b/library/src/main/java/io/appwrite/services/Organizations.kt deleted file mode 100644 index 5edae0a8..00000000 --- a/library/src/main/java/io/appwrite/services/Organizations.kt +++ /dev/null @@ -1,189 +0,0 @@ -package io.appwrite.services - -import android.net.Uri -import io.appwrite.Client -import io.appwrite.Service -import io.appwrite.models.* -import io.appwrite.exceptions.AppwriteException -import io.appwrite.extensions.classOf -import okhttp3.Cookie -import java.io.File - -/** - * - */ -class Organizations(client: Client) : Service(client) { - - /** - * Delete an organization. - * - * @param organizationId Team ID. - * @return [Any] - */ - suspend fun delete( - organizationId: String, - ): Any { - val apiPath = "/organizations/{organizationId}" - .replace("{organizationId}", organizationId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - - /** - * Get a billing address using it's ID. - * - * @param organizationId Organization ID - * @param billingAddressId Unique ID of billing address - * @return [io.appwrite.models.BillingAddress] - */ - suspend fun getBillingAddress( - organizationId: String, - billingAddressId: String, - ): io.appwrite.models.BillingAddress { - val apiPath = "/organizations/{organizationId}/billing-addresses/{billingAddressId}" - .replace("{organizationId}", organizationId) - .replace("{billingAddressId}", billingAddressId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.BillingAddress = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.BillingAddress.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.BillingAddress::class.java, - converter, - ) - } - - - /** - * Get estimation for deleting an organization. - * - * @param organizationId Team ID. - * @return [io.appwrite.models.EstimationDeleteOrganization] - */ - suspend fun estimationDeleteOrganization( - organizationId: String, - ): io.appwrite.models.EstimationDeleteOrganization { - val apiPath = "/organizations/{organizationId}/estimations/delete-organization" - .replace("{organizationId}", organizationId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.EstimationDeleteOrganization = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.EstimationDeleteOrganization.from(map = it as Map) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.EstimationDeleteOrganization::class.java, - converter, - ) - } - - - /** - * Submit feedback about downgrading from a paid plan to a lower tier. This helps the team understand user experience and improve the platform. - * - * - * @param organizationId Organization Unique ID - * @param reason Feedback reason - * @param message Feedback message - * @param fromPlanId Plan downgrading from - * @param toPlanId Plan downgrading to - * @return [io.appwrite.models.DowngradeFeedback] - */ - suspend fun createDowngradeFeedback( - organizationId: String, - reason: String, - message: String, - fromPlanId: String, - toPlanId: String, - ): io.appwrite.models.DowngradeFeedback { - val apiPath = "/organizations/{organizationId}/feedbacks/downgrade" - .replace("{organizationId}", organizationId) - - val apiParams = mutableMapOf( - "reason" to reason, - "message" to message, - "fromPlanId" to fromPlanId, - "toPlanId" to toPlanId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DowngradeFeedback = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.DowngradeFeedback.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.DowngradeFeedback::class.java, - converter, - ) - } - - - /** - * Get an organization's payment method using it's payment method ID. - * - * @param organizationId Organization ID - * @param paymentMethodId Unique ID of payment method - * @return [io.appwrite.models.PaymentMethod] - */ - suspend fun getPaymentMethod( - organizationId: String, - paymentMethodId: String, - ): io.appwrite.models.PaymentMethod { - val apiPath = "/organizations/{organizationId}/payment-methods/{paymentMethodId}" - .replace("{organizationId}", organizationId) - .replace("{paymentMethodId}", paymentMethodId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.PaymentMethod = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.PaymentMethod.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.PaymentMethod::class.java, - converter, - ) - } - - -} \ No newline at end of file From f76f1eb08c7a91d84cb156b569d19a9b5d4a882e Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 13 Feb 2026 10:19:57 +0000 Subject: [PATCH 3/3] updated specs --- docs/examples/java/account/create-key.md | 27 -- .../java/account/create-payment-method.md | 20 - docs/examples/java/account/delete-key.md | 24 -- .../java/account/delete-payment-method.md | 24 -- docs/examples/java/account/get-key.md | 24 -- .../java/account/get-payment-method.md | 24 -- docs/examples/java/account/list-keys.md | 24 -- .../java/account/list-payment-methods.md | 24 -- docs/examples/java/account/update-key.md | 28 -- .../update-payment-method-mandate-options.md | 24 -- .../account/update-payment-method-provider.md | 27 -- .../java/account/update-payment-method.md | 27 -- docs/examples/kotlin/account/create-key.md | 18 - .../kotlin/account/create-payment-method.md | 13 - docs/examples/kotlin/account/delete-key.md | 15 - .../kotlin/account/delete-payment-method.md | 15 - docs/examples/kotlin/account/get-key.md | 15 - .../kotlin/account/get-payment-method.md | 15 - docs/examples/kotlin/account/list-keys.md | 15 - .../kotlin/account/list-payment-methods.md | 15 - docs/examples/kotlin/account/update-key.md | 19 - .../update-payment-method-mandate-options.md | 15 - .../account/update-payment-method-provider.md | 18 - .../kotlin/account/update-payment-method.md | 18 - .../src/main/java/io/appwrite/enums/Scopes.kt | 14 - .../src/main/java/io/appwrite/models/Key.kt | 94 ---- .../main/java/io/appwrite/models/KeyList.kt | 38 -- .../java/io/appwrite/models/PaymentMethod.kt | 182 -------- .../io/appwrite/models/PaymentMethodList.kt | 38 -- .../main/java/io/appwrite/services/Account.kt | 406 ------------------ 30 files changed, 1260 deletions(-) delete mode 100644 docs/examples/java/account/create-key.md delete mode 100644 docs/examples/java/account/create-payment-method.md delete mode 100644 docs/examples/java/account/delete-key.md delete mode 100644 docs/examples/java/account/delete-payment-method.md delete mode 100644 docs/examples/java/account/get-key.md delete mode 100644 docs/examples/java/account/get-payment-method.md delete mode 100644 docs/examples/java/account/list-keys.md delete mode 100644 docs/examples/java/account/list-payment-methods.md delete mode 100644 docs/examples/java/account/update-key.md delete mode 100644 docs/examples/java/account/update-payment-method-mandate-options.md delete mode 100644 docs/examples/java/account/update-payment-method-provider.md delete mode 100644 docs/examples/java/account/update-payment-method.md delete mode 100644 docs/examples/kotlin/account/create-key.md delete mode 100644 docs/examples/kotlin/account/create-payment-method.md delete mode 100644 docs/examples/kotlin/account/delete-key.md delete mode 100644 docs/examples/kotlin/account/delete-payment-method.md delete mode 100644 docs/examples/kotlin/account/get-key.md delete mode 100644 docs/examples/kotlin/account/get-payment-method.md delete mode 100644 docs/examples/kotlin/account/list-keys.md delete mode 100644 docs/examples/kotlin/account/list-payment-methods.md delete mode 100644 docs/examples/kotlin/account/update-key.md delete mode 100644 docs/examples/kotlin/account/update-payment-method-mandate-options.md delete mode 100644 docs/examples/kotlin/account/update-payment-method-provider.md delete mode 100644 docs/examples/kotlin/account/update-payment-method.md delete mode 100644 library/src/main/java/io/appwrite/enums/Scopes.kt delete mode 100644 library/src/main/java/io/appwrite/models/Key.kt delete mode 100644 library/src/main/java/io/appwrite/models/KeyList.kt delete mode 100644 library/src/main/java/io/appwrite/models/PaymentMethod.kt delete mode 100644 library/src/main/java/io/appwrite/models/PaymentMethodList.kt diff --git a/docs/examples/java/account/create-key.md b/docs/examples/java/account/create-key.md deleted file mode 100644 index a2c044c5..00000000 --- a/docs/examples/java/account/create-key.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; -import io.appwrite.enums.Scopes; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.createKey( - "", // name - Scopes.ACCOUNT, // scopes - "", // expire (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/create-payment-method.md b/docs/examples/java/account/create-payment-method.md deleted file mode 100644 index b9618d6a..00000000 --- a/docs/examples/java/account/create-payment-method.md +++ /dev/null @@ -1,20 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.createPaymentMethod(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); -})); -``` diff --git a/docs/examples/java/account/delete-key.md b/docs/examples/java/account/delete-key.md deleted file mode 100644 index 228392d4..00000000 --- a/docs/examples/java/account/delete-key.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.deleteKey( - "", // keyId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/delete-payment-method.md b/docs/examples/java/account/delete-payment-method.md deleted file mode 100644 index 69c9699e..00000000 --- a/docs/examples/java/account/delete-payment-method.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.deletePaymentMethod( - "", // paymentMethodId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/get-key.md b/docs/examples/java/account/get-key.md deleted file mode 100644 index 76ca5a2d..00000000 --- a/docs/examples/java/account/get-key.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.getKey( - "", // keyId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/get-payment-method.md b/docs/examples/java/account/get-payment-method.md deleted file mode 100644 index 0442a87f..00000000 --- a/docs/examples/java/account/get-payment-method.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.getPaymentMethod( - "", // paymentMethodId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/list-keys.md b/docs/examples/java/account/list-keys.md deleted file mode 100644 index 3a9bd70b..00000000 --- a/docs/examples/java/account/list-keys.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.listKeys( - false, // total (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/list-payment-methods.md b/docs/examples/java/account/list-payment-methods.md deleted file mode 100644 index e69955c9..00000000 --- a/docs/examples/java/account/list-payment-methods.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.listPaymentMethods( - List.of(), // queries (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/update-key.md b/docs/examples/java/account/update-key.md deleted file mode 100644 index 6d1ae575..00000000 --- a/docs/examples/java/account/update-key.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; -import io.appwrite.enums.Scopes; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.updateKey( - "", // keyId - "", // name - Scopes.ACCOUNT, // scopes - "", // expire (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/update-payment-method-mandate-options.md b/docs/examples/java/account/update-payment-method-mandate-options.md deleted file mode 100644 index 23758fa9..00000000 --- a/docs/examples/java/account/update-payment-method-mandate-options.md +++ /dev/null @@ -1,24 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.updatePaymentMethodMandateOptions( - "", // paymentMethodId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/update-payment-method-provider.md b/docs/examples/java/account/update-payment-method-provider.md deleted file mode 100644 index 8a295f85..00000000 --- a/docs/examples/java/account/update-payment-method-provider.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.updatePaymentMethodProvider( - "", // paymentMethodId - "", // providerMethodId - "", // name - "", // state (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/java/account/update-payment-method.md b/docs/examples/java/account/update-payment-method.md deleted file mode 100644 index 0e8ddab4..00000000 --- a/docs/examples/java/account/update-payment-method.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; - -Client client = new Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject(""); // Your project ID - -Account account = new Account(client); - -account.updatePaymentMethod( - "", // paymentMethodId - 1, // expiryMonth - 2026, // expiryYear - "", // state (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - Log.d("Appwrite", result.toString()); - }) -); - -``` diff --git a/docs/examples/kotlin/account/create-key.md b/docs/examples/kotlin/account/create-key.md deleted file mode 100644 index 306c79d7..00000000 --- a/docs/examples/kotlin/account/create-key.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account -import io.appwrite.enums.Scopes - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.createKey( - name = "", - scopes = scopes.ACCOUNT, - expire = "", // (optional) -) -``` diff --git a/docs/examples/kotlin/account/create-payment-method.md b/docs/examples/kotlin/account/create-payment-method.md deleted file mode 100644 index 87266087..00000000 --- a/docs/examples/kotlin/account/create-payment-method.md +++ /dev/null @@ -1,13 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.createPaymentMethod() -``` diff --git a/docs/examples/kotlin/account/delete-key.md b/docs/examples/kotlin/account/delete-key.md deleted file mode 100644 index 5434050b..00000000 --- a/docs/examples/kotlin/account/delete-key.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.deleteKey( - keyId = "", -) -``` diff --git a/docs/examples/kotlin/account/delete-payment-method.md b/docs/examples/kotlin/account/delete-payment-method.md deleted file mode 100644 index 3422a628..00000000 --- a/docs/examples/kotlin/account/delete-payment-method.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.deletePaymentMethod( - paymentMethodId = "", -) -``` diff --git a/docs/examples/kotlin/account/get-key.md b/docs/examples/kotlin/account/get-key.md deleted file mode 100644 index e0e70955..00000000 --- a/docs/examples/kotlin/account/get-key.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.getKey( - keyId = "", -) -``` diff --git a/docs/examples/kotlin/account/get-payment-method.md b/docs/examples/kotlin/account/get-payment-method.md deleted file mode 100644 index 36aaf266..00000000 --- a/docs/examples/kotlin/account/get-payment-method.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.getPaymentMethod( - paymentMethodId = "", -) -``` diff --git a/docs/examples/kotlin/account/list-keys.md b/docs/examples/kotlin/account/list-keys.md deleted file mode 100644 index 0ec099ce..00000000 --- a/docs/examples/kotlin/account/list-keys.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.listKeys( - total = false, // (optional) -) -``` diff --git a/docs/examples/kotlin/account/list-payment-methods.md b/docs/examples/kotlin/account/list-payment-methods.md deleted file mode 100644 index f8bd4d8a..00000000 --- a/docs/examples/kotlin/account/list-payment-methods.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.listPaymentMethods( - queries = listOf(), // (optional) -) -``` diff --git a/docs/examples/kotlin/account/update-key.md b/docs/examples/kotlin/account/update-key.md deleted file mode 100644 index 1587018b..00000000 --- a/docs/examples/kotlin/account/update-key.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account -import io.appwrite.enums.Scopes - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.updateKey( - keyId = "", - name = "", - scopes = scopes.ACCOUNT, - expire = "", // (optional) -) -``` diff --git a/docs/examples/kotlin/account/update-payment-method-mandate-options.md b/docs/examples/kotlin/account/update-payment-method-mandate-options.md deleted file mode 100644 index e6f4147e..00000000 --- a/docs/examples/kotlin/account/update-payment-method-mandate-options.md +++ /dev/null @@ -1,15 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.updatePaymentMethodMandateOptions( - paymentMethodId = "", -) -``` diff --git a/docs/examples/kotlin/account/update-payment-method-provider.md b/docs/examples/kotlin/account/update-payment-method-provider.md deleted file mode 100644 index 65ca8b30..00000000 --- a/docs/examples/kotlin/account/update-payment-method-provider.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.updatePaymentMethodProvider( - paymentMethodId = "", - providerMethodId = "", - name = "", - state = "", // (optional) -) -``` diff --git a/docs/examples/kotlin/account/update-payment-method.md b/docs/examples/kotlin/account/update-payment-method.md deleted file mode 100644 index aa6f89ee..00000000 --- a/docs/examples/kotlin/account/update-payment-method.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Account - -val client = Client(context) - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - -val account = Account(client) - -val result = account.updatePaymentMethod( - paymentMethodId = "", - expiryMonth = 1, - expiryYear = 2026, - state = "", // (optional) -) -``` diff --git a/library/src/main/java/io/appwrite/enums/Scopes.kt b/library/src/main/java/io/appwrite/enums/Scopes.kt deleted file mode 100644 index f28370ee..00000000 --- a/library/src/main/java/io/appwrite/enums/Scopes.kt +++ /dev/null @@ -1,14 +0,0 @@ -package io.appwrite.enums - -import com.google.gson.annotations.SerializedName - -enum class Scopes(val value: String) { - @SerializedName("account") - ACCOUNT("account"), - @SerializedName("teams.read") - TEAMS_READ("teams.read"), - @SerializedName("teams.write") - TEAMS_WRITE("teams.write"); - - override fun toString() = value -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/Key.kt b/library/src/main/java/io/appwrite/models/Key.kt deleted file mode 100644 index 83d9dd1c..00000000 --- a/library/src/main/java/io/appwrite/models/Key.kt +++ /dev/null @@ -1,94 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * Key - */ -data class Key( - /** - * Key ID. - */ - @SerializedName("\$id") - val id: String, - - /** - * Key creation date in ISO 8601 format. - */ - @SerializedName("\$createdAt") - val createdAt: String, - - /** - * Key update date in ISO 8601 format. - */ - @SerializedName("\$updatedAt") - val updatedAt: String, - - /** - * Key name. - */ - @SerializedName("name") - val name: String, - - /** - * Key expiration date in ISO 8601 format. - */ - @SerializedName("expire") - val expire: String, - - /** - * Allowed permission scopes. - */ - @SerializedName("scopes") - val scopes: List, - - /** - * Secret key. - */ - @SerializedName("secret") - val secret: String, - - /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. - */ - @SerializedName("accessedAt") - val accessedAt: String, - - /** - * List of SDK user agents that used this key. - */ - @SerializedName("sdks") - val sdks: List, - -) { - fun toMap(): Map = mapOf( - "\$id" to id as Any, - "\$createdAt" to createdAt as Any, - "\$updatedAt" to updatedAt as Any, - "name" to name as Any, - "expire" to expire as Any, - "scopes" to scopes as Any, - "secret" to secret as Any, - "accessedAt" to accessedAt as Any, - "sdks" to sdks as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = Key( - id = map["\$id"] as String, - createdAt = map["\$createdAt"] as String, - updatedAt = map["\$updatedAt"] as String, - name = map["name"] as String, - expire = map["expire"] as String, - scopes = map["scopes"] as List, - secret = map["secret"] as String, - accessedAt = map["accessedAt"] as String, - sdks = map["sdks"] as List, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/KeyList.kt b/library/src/main/java/io/appwrite/models/KeyList.kt deleted file mode 100644 index cc3875f7..00000000 --- a/library/src/main/java/io/appwrite/models/KeyList.kt +++ /dev/null @@ -1,38 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * API Keys List - */ -data class KeyList( - /** - * Total number of keys that matched your query. - */ - @SerializedName("total") - val total: Long, - - /** - * List of keys. - */ - @SerializedName("keys") - val keys: List, - -) { - fun toMap(): Map = mapOf( - "total" to total as Any, - "keys" to keys.map { it.toMap() } as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = KeyList( - total = (map["total"] as Number).toLong(), - keys = (map["keys"] as List>).map { Key.from(map = it) }, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/PaymentMethod.kt b/library/src/main/java/io/appwrite/models/PaymentMethod.kt deleted file mode 100644 index 0193d475..00000000 --- a/library/src/main/java/io/appwrite/models/PaymentMethod.kt +++ /dev/null @@ -1,182 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * paymentMethod - */ -data class PaymentMethod( - /** - * Payment Method ID. - */ - @SerializedName("\$id") - val id: String, - - /** - * Payment method creation time in ISO 8601 format. - */ - @SerializedName("\$createdAt") - val createdAt: String, - - /** - * Payment method update date in ISO 8601 format. - */ - @SerializedName("\$updatedAt") - val updatedAt: String, - - /** - * Payment method permissions. [Learn more about permissions](/docs/permissions). - */ - @SerializedName("\$permissions") - val permissions: List, - - /** - * Payment method ID from the payment provider - */ - @SerializedName("providerMethodId") - val providerMethodId: String, - - /** - * Client secret hash for payment setup - */ - @SerializedName("clientSecret") - val clientSecret: String, - - /** - * User ID from the payment provider. - */ - @SerializedName("providerUserId") - val providerUserId: String, - - /** - * ID of the Team. - */ - @SerializedName("userId") - val userId: String, - - /** - * Expiry month of the payment method. - */ - @SerializedName("expiryMonth") - val expiryMonth: Long, - - /** - * Expiry year of the payment method. - */ - @SerializedName("expiryYear") - val expiryYear: Long, - - /** - * Last 4 digit of the payment method - */ - @SerializedName("last4") - val last4: String, - - /** - * Payment method brand - */ - @SerializedName("brand") - val brand: String, - - /** - * Name of the owner - */ - @SerializedName("name") - val name: String, - - /** - * Mandate ID of the payment method - */ - @SerializedName("mandateId") - val mandateId: String, - - /** - * Country of the payment method - */ - @SerializedName("country") - val country: String, - - /** - * State of the payment method - */ - @SerializedName("state") - val state: String, - - /** - * Last payment error associated with the payment method. - */ - @SerializedName("lastError") - val lastError: String, - - /** - * True when it's the default payment method. - */ - @SerializedName("default") - val default: Boolean, - - /** - * True when payment method has expired. - */ - @SerializedName("expired") - val expired: Boolean, - - /** - * True when payment method has failed to process multiple times. - */ - @SerializedName("failed") - val failed: Boolean, - -) { - fun toMap(): Map = mapOf( - "\$id" to id as Any, - "\$createdAt" to createdAt as Any, - "\$updatedAt" to updatedAt as Any, - "\$permissions" to permissions as Any, - "providerMethodId" to providerMethodId as Any, - "clientSecret" to clientSecret as Any, - "providerUserId" to providerUserId as Any, - "userId" to userId as Any, - "expiryMonth" to expiryMonth as Any, - "expiryYear" to expiryYear as Any, - "last4" to last4 as Any, - "brand" to brand as Any, - "name" to name as Any, - "mandateId" to mandateId as Any, - "country" to country as Any, - "state" to state as Any, - "lastError" to lastError as Any, - "default" to default as Any, - "expired" to expired as Any, - "failed" to failed as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = PaymentMethod( - id = map["\$id"] as String, - createdAt = map["\$createdAt"] as String, - updatedAt = map["\$updatedAt"] as String, - permissions = map["\$permissions"] as List, - providerMethodId = map["providerMethodId"] as String, - clientSecret = map["clientSecret"] as String, - providerUserId = map["providerUserId"] as String, - userId = map["userId"] as String, - expiryMonth = (map["expiryMonth"] as Number).toLong(), - expiryYear = (map["expiryYear"] as Number).toLong(), - last4 = map["last4"] as String, - brand = map["brand"] as String, - name = map["name"] as String, - mandateId = map["mandateId"] as String, - country = map["country"] as String, - state = map["state"] as String, - lastError = map["lastError"] as String, - default = map["default"] as Boolean, - expired = map["expired"] as Boolean, - failed = map["failed"] as Boolean, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/models/PaymentMethodList.kt b/library/src/main/java/io/appwrite/models/PaymentMethodList.kt deleted file mode 100644 index d7a4c18a..00000000 --- a/library/src/main/java/io/appwrite/models/PaymentMethodList.kt +++ /dev/null @@ -1,38 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * Payment methods list - */ -data class PaymentMethodList( - /** - * Total number of paymentMethods that matched your query. - */ - @SerializedName("total") - val total: Long, - - /** - * List of paymentMethods. - */ - @SerializedName("paymentMethods") - val paymentMethods: List, - -) { - fun toMap(): Map = mapOf( - "total" to total as Any, - "paymentMethods" to paymentMethods.map { it.toMap() } as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = PaymentMethodList( - total = (map["total"] as Number).toLong(), - paymentMethods = (map["paymentMethods"] as List>).map { PaymentMethod.from(map = it) }, - ) - } -} \ No newline at end of file diff --git a/library/src/main/java/io/appwrite/services/Account.kt b/library/src/main/java/io/appwrite/services/Account.kt index abd6914b..6d22a45b 100644 --- a/library/src/main/java/io/appwrite/services/Account.kt +++ b/library/src/main/java/io/appwrite/services/Account.kt @@ -274,177 +274,6 @@ class Account(client: Client) : Service(client) { } - /** - * Get a list of all API keys from the current account. - * - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @return [io.appwrite.models.KeyList] - */ - @JvmOverloads - suspend fun listKeys( - total: Boolean? = null, - ): io.appwrite.models.KeyList { - val apiPath = "/account/keys" - - val apiParams = mutableMapOf( - "total" to total, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.KeyList = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.KeyList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.KeyList::class.java, - converter, - ) - } - - - /** - * Create a new account API key. - * - * @param name Key name. Max length: 128 chars. - * @param scopes Key scopes list. Maximum of 100 scopes are allowed. - * @param expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. - * @return [io.appwrite.models.Key] - */ - @JvmOverloads - suspend fun createKey( - name: String, - scopes: List, - expire: String? = null, - ): io.appwrite.models.Key { - val apiPath = "/account/keys" - - val apiParams = mutableMapOf( - "name" to name, - "scopes" to scopes, - "expire" to expire, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Key = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.Key.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Key::class.java, - converter, - ) - } - - - /** - * Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes. - * - * @param keyId Key unique ID. - * @return [io.appwrite.models.Key] - */ - suspend fun getKey( - keyId: String, - ): io.appwrite.models.Key { - val apiPath = "/account/keys/{keyId}" - .replace("{keyId}", keyId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Key = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.Key.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Key::class.java, - converter, - ) - } - - - /** - * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. - * - * @param keyId Key unique ID. - * @param name Key name. Max length: 128 chars. - * @param scopes Key scopes list. Maximum of 100 scopes are allowed. - * @param expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. - * @return [io.appwrite.models.Key] - */ - @JvmOverloads - suspend fun updateKey( - keyId: String, - name: String, - scopes: List, - expire: String? = null, - ): io.appwrite.models.Key { - val apiPath = "/account/keys/{keyId}" - .replace("{keyId}", keyId) - - val apiParams = mutableMapOf( - "name" to name, - "scopes" to scopes, - "expire" to expire, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Key = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.Key.from(map = it as Map) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Key::class.java, - converter, - ) - } - - - /** - * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. - * - * @param keyId Key unique ID. - * @return [Any] - */ - suspend fun deleteKey( - keyId: String, - ): Any { - val apiPath = "/account/keys/{keyId}" - .replace("{keyId}", keyId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. * @@ -1250,241 +1079,6 @@ class Account(client: Client) : Service(client) { nestedType = classOf(), ) - /** - * List payment methods for this account. - * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed - * @return [io.appwrite.models.PaymentMethodList] - */ - @JvmOverloads - suspend fun listPaymentMethods( - queries: List? = null, - ): io.appwrite.models.PaymentMethodList { - val apiPath = "/account/payment-methods" - - val apiParams = mutableMapOf( - "queries" to queries, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.PaymentMethodList = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.PaymentMethodList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.PaymentMethodList::class.java, - converter, - ) - } - - - /** - * Create a new payment method for the current user account. - * - * @return [io.appwrite.models.PaymentMethod] - */ - suspend fun createPaymentMethod( - ): io.appwrite.models.PaymentMethod { - val apiPath = "/account/payment-methods" - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.PaymentMethod = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.PaymentMethod.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.PaymentMethod::class.java, - converter, - ) - } - - - /** - * Get a specific payment method for the user. - * - * @param paymentMethodId Unique ID of payment method - * @return [io.appwrite.models.PaymentMethod] - */ - suspend fun getPaymentMethod( - paymentMethodId: String, - ): io.appwrite.models.PaymentMethod { - val apiPath = "/account/payment-methods/{paymentMethodId}" - .replace("{paymentMethodId}", paymentMethodId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.PaymentMethod = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.PaymentMethod.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.PaymentMethod::class.java, - converter, - ) - } - - - /** - * Update a new payment method for the current user account. - * - * @param paymentMethodId Unique ID of payment method - * @param expiryMonth Payment expiry month - * @param expiryYear Expiry year - * @param state State of the payment method country - * @return [io.appwrite.models.PaymentMethod] - */ - @JvmOverloads - suspend fun updatePaymentMethod( - paymentMethodId: String, - expiryMonth: Long, - expiryYear: Long, - state: String? = null, - ): io.appwrite.models.PaymentMethod { - val apiPath = "/account/payment-methods/{paymentMethodId}" - .replace("{paymentMethodId}", paymentMethodId) - - val apiParams = mutableMapOf( - "expiryMonth" to expiryMonth, - "expiryYear" to expiryYear, - "state" to state, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.PaymentMethod = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.PaymentMethod.from(map = it as Map) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.PaymentMethod::class.java, - converter, - ) - } - - - /** - * Delete a specific payment method from a user's account. - * - * @param paymentMethodId Unique ID of payment method - * @return [Any] - */ - suspend fun deletePaymentMethod( - paymentMethodId: String, - ): Any { - val apiPath = "/account/payment-methods/{paymentMethodId}" - .replace("{paymentMethodId}", paymentMethodId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - - /** - * Update payment method provider. - * - * @param paymentMethodId Unique ID of payment method - * @param providerMethodId Payment method ID from the payment provider - * @param name Name in the payment method - * @param state State of the payment method country - * @return [io.appwrite.models.PaymentMethod] - */ - @JvmOverloads - suspend fun updatePaymentMethodProvider( - paymentMethodId: String, - providerMethodId: String, - name: String, - state: String? = null, - ): io.appwrite.models.PaymentMethod { - val apiPath = "/account/payment-methods/{paymentMethodId}/provider" - .replace("{paymentMethodId}", paymentMethodId) - - val apiParams = mutableMapOf( - "providerMethodId" to providerMethodId, - "name" to name, - "state" to state, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.PaymentMethod = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.PaymentMethod.from(map = it as Map) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.PaymentMethod::class.java, - converter, - ) - } - - - /** - * Update payment method mandate options. - * - * @param paymentMethodId Unique ID of payment method - * @return [io.appwrite.models.PaymentMethod] - */ - suspend fun updatePaymentMethodMandateOptions( - paymentMethodId: String, - ): io.appwrite.models.PaymentMethod { - val apiPath = "/account/payment-methods/{paymentMethodId}/setup" - .replace("{paymentMethodId}", paymentMethodId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.PaymentMethod = { - @Suppress("UNCHECKED_CAST") - io.appwrite.models.PaymentMethod.from(map = it as Map) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.PaymentMethod::class.java, - converter, - ) - } - - /** * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. *