Release candidate for 1.5.x

This commit is contained in:
Jake Barnby
2024-02-25 00:29:57 +13:00
parent e9887c81d0
commit d30691f7a8
126 changed files with 632 additions and 267 deletions
-1
View File
@@ -16,7 +16,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 17
# Base64 decodes and pipes the GPG key content into the secret file
- name: Prepare environment
env:
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
+10 -7
View File
@@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:
```groovy
implementation("io.appwrite:sdk-for-android:5.0.0-rc.4")
implementation("io.appwrite:sdk-for-android:5.0.0-rc.5")
```
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-android</artifactId>
<version>5.0.0-rc.4</version>
<version>5.0.0-rc.5</version>
</dependency>
</dependencies>
```
@@ -109,8 +109,9 @@ When trying to connect to Appwrite from an emulator or a mobile device, localhos
val account = Account(client)
val response = account.create(
ID.unique(),
"email@example.com",
"password"
"email@example.com",
"password",
"Walter O'Brien"
)
```
@@ -129,8 +130,9 @@ val client = Client(context)
val account = Account(client)
val user = account.create(
ID.unique(),
"email@example.com",
"password"
"email@example.com",
"password",
"Walter O'Brien"
)
```
@@ -139,7 +141,7 @@ The Appwrite Android SDK raises an `AppwriteException` object with `message`, `c
```kotlin
try {
var user = account.create(ID.unique(), "email@example.com", "password")
var user = account.create(ID.unique(),"email@example.com","password","Walter O'Brien")
Log.d("Appwrite user", user.toMap())
} catch(e : AppwriteException) {
e.printStackTrace()
@@ -153,6 +155,7 @@ You can use the following resources to learn more and get help
- 💬 [Discord Community](https://appwrite.io/discord)
- 🚂 [Appwrite Android Playground](https://github.com/appwrite/playground-for-android)
## Contribution
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.create2FAChallenge(
account.createChallenge(
AuthenticationFactor.TOTP, // factor
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.createEmailToken(
"[USER_ID]", // userId
"<USER_ID>", // userId
"email@example.com", // email
false, // phrase (optional)
new CoroutineCallback<>((result, error) -> {
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.createMagicURLToken(
"[USER_ID]", // userId
"<USER_ID>", // userId
"email@example.com", // email
"https://example.com", // url (optional)
false, // phrase (optional)
@@ -13,7 +13,6 @@ account.createOAuth2Session(
OAuthProvider.AMAZON, // provider
"https://example.com", // success (optional)
"https://example.com", // failure (optional)
false, // token (optional)
listOf(), // scopes (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -0,0 +1,26 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
import io.appwrite.enums.OAuthProvider;
Client client = new Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createOAuth2Token(
OAuthProvider.AMAZON, // provider
"https://example.com", // success (optional)
"https://example.com", // failure (optional)
listOf(), // scopes (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.createPhoneToken(
"[USER_ID]", // userId
"<USER_ID>", // userId
"+12065550100", // phone
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -9,9 +9,9 @@ Client client = new Client(context)
Account account = new Account(client);
account.createPushTarget(
"[TARGET_ID]", // targetId
"[IDENTIFIER]", // identifier
"[PROVIDER_ID]", // providerId (optional)
"<TARGET_ID>", // targetId
"<IDENTIFIER>", // identifier
"<PROVIDER_ID>", // providerId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+2 -2
View File
@@ -9,8 +9,8 @@ Client client = new Client(context)
Account account = new Account(client);
account.createSession(
"[USER_ID]", // userId
"[SECRET]", // secret
"<USER_ID>", // userId
"<SECRET>", // secret
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+2 -2
View File
@@ -9,10 +9,10 @@ Client client = new Client(context)
Account account = new Account(client);
account.create(
"[USER_ID]", // userId
"<USER_ID>", // userId
"email@example.com", // email
"", // password
"[NAME]", // name (optional)
"<NAME>", // name (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -11,7 +11,7 @@ Account account = new Account(client);
account.deleteAuthenticator(
AuthenticatorType.TOTP, // type
"[OTP]", // otp
"<OTP>", // otp
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.deleteIdentity(
"[IDENTITY_ID]", // identityId
"<IDENTITY_ID>", // identityId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.deletePushTarget(
"[TARGET_ID]", // targetId
"<TARGET_ID>", // targetId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.deleteSession(
"[SESSION_ID]", // sessionId
"<SESSION_ID>", // sessionId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.getSession(
"[SESSION_ID]", // sessionId
"<SESSION_ID>", // sessionId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Account account = new Account(client);
account.updateChallenge(
"[CHALLENGE_ID]", // challengeId
"[OTP]", // otp
"<CHALLENGE_ID>", // challengeId
"<OTP>", // otp
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Account account = new Account(client);
account.updateMagicURLSession(
"[USER_ID]", // userId
"[SECRET]", // secret
"<USER_ID>", // userId
"<SECRET>", // secret
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.updateName(
"[NAME]", // name
"<NAME>", // name
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Account account = new Account(client);
account.updatePhoneVerification(
"[USER_ID]", // userId
"[SECRET]", // secret
"<USER_ID>", // userId
"<SECRET>", // secret
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Account account = new Account(client);
account.updatePushTarget(
"[TARGET_ID]", // targetId
"[IDENTIFIER]", // identifier
"<TARGET_ID>", // targetId
"<IDENTIFIER>", // identifier
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Account account = new Account(client);
account.updateRecovery(
"[USER_ID]", // userId
"[SECRET]", // secret
"<USER_ID>", // userId
"<SECRET>", // secret
"", // password
new CoroutineCallback<>((result, error) -> {
if (error != null) {
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.updateSession(
"[SESSION_ID]", // sessionId
"<SESSION_ID>", // sessionId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Account account = new Account(client);
account.updateVerification(
"[USER_ID]", // userId
"[SECRET]", // secret
"<USER_ID>", // userId
"<SECRET>", // secret
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -11,7 +11,7 @@ Account account = new Account(client);
account.verifyAuthenticator(
AuthenticatorType.TOTP, // type
"[OTP]", // otp
"<OTP>", // otp
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Avatars avatars = new Avatars(client);
avatars.getInitials(
"[NAME]", // name (optional)
"<NAME>", // name (optional)
0, // width (optional)
0, // height (optional)
"", // background (optional)
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Avatars avatars = new Avatars(client);
avatars.getQR(
"[TEXT]", // text
"<TEXT>", // text
1, // size (optional)
0, // margin (optional)
false, // download (optional)
@@ -9,9 +9,9 @@ Client client = new Client(context)
Databases databases = new Databases(client);
databases.createDocument(
"[DATABASE_ID]", // databaseId
"[COLLECTION_ID]", // collectionId
"[DOCUMENT_ID]", // documentId
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
mapOf( "a" to "b" ), // data
listOf("read("any")"), // permissions (optional)
new CoroutineCallback<>((result, error) -> {
@@ -9,9 +9,9 @@ Client client = new Client(context)
Databases databases = new Databases(client);
databases.deleteDocument(
"[DATABASE_ID]", // databaseId
"[COLLECTION_ID]", // collectionId
"[DOCUMENT_ID]", // documentId
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+3 -3
View File
@@ -9,9 +9,9 @@ Client client = new Client(context)
Databases databases = new Databases(client);
databases.getDocument(
"[DATABASE_ID]", // databaseId
"[COLLECTION_ID]", // collectionId
"[DOCUMENT_ID]", // documentId
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
listOf(), // queries (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -9,8 +9,8 @@ Client client = new Client(context)
Databases databases = new Databases(client);
databases.listDocuments(
"[DATABASE_ID]", // databaseId
"[COLLECTION_ID]", // collectionId
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // queries (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -9,9 +9,9 @@ Client client = new Client(context)
Databases databases = new Databases(client);
databases.updateDocument(
"[DATABASE_ID]", // databaseId
"[COLLECTION_ID]", // collectionId
"[DOCUMENT_ID]", // documentId
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
mapOf( "a" to "b" ), // data (optional)
listOf("read("any")"), // permissions (optional)
new CoroutineCallback<>((result, error) -> {
@@ -9,10 +9,10 @@ Client client = new Client(context)
Functions functions = new Functions(client);
functions.createExecution(
"[FUNCTION_ID]", // functionId
"[BODY]", // body (optional)
"<FUNCTION_ID>", // functionId
"<BODY>", // body (optional)
false, // async (optional)
"[PATH]", // path (optional)
"<PATH>", // path (optional)
ExecutionMethod.GET, // method (optional)
mapOf( "a" to "b" ), // headers (optional)
new CoroutineCallback<>((result, error) -> {
@@ -9,8 +9,8 @@ Client client = new Client(context)
Functions functions = new Functions(client);
functions.getExecution(
"[FUNCTION_ID]", // functionId
"[EXECUTION_ID]", // executionId
"<FUNCTION_ID>", // functionId
"<EXECUTION_ID>", // executionId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,9 +9,9 @@ Client client = new Client(context)
Functions functions = new Functions(client);
functions.listExecutions(
"[FUNCTION_ID]", // functionId
"<FUNCTION_ID>", // functionId
listOf(), // queries (optional)
"[SEARCH]", // search (optional)
"<SEARCH>", // search (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,9 +9,9 @@ Client client = new Client(context)
Messaging messaging = new Messaging(client);
messaging.createSubscriber(
"[TOPIC_ID]", // topicId
"[SUBSCRIBER_ID]", // subscriberId
"[TARGET_ID]", // targetId
"<TOPIC_ID>", // topicId
"<SUBSCRIBER_ID>", // subscriberId
"<TARGET_ID>", // targetId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Messaging messaging = new Messaging(client);
messaging.deleteSubscriber(
"[TOPIC_ID]", // topicId
"[SUBSCRIBER_ID]", // subscriberId
"<TOPIC_ID>", // topicId
"<SUBSCRIBER_ID>", // subscriberId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+2 -2
View File
@@ -10,8 +10,8 @@ Client client = new Client(context)
Storage storage = new Storage(client);
storage.createFile(
"[BUCKET_ID]", // bucketId
"[FILE_ID]", // fileId
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
InputFile.fromPath("file.png"), // file
listOf("read("any")"), // permissions (optional)
new CoroutineCallback<>((result, error) -> {
+2 -2
View File
@@ -9,8 +9,8 @@ Client client = new Client(context)
Storage storage = new Storage(client);
storage.deleteFile(
"[BUCKET_ID]", // bucketId
"[FILE_ID]", // fileId
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Storage storage = new Storage(client);
storage.getFileDownload(
"[BUCKET_ID]", // bucketId
"[FILE_ID]", // fileId
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Storage storage = new Storage(client);
storage.getFilePreview(
"[BUCKET_ID]", // bucketId
"[FILE_ID]", // fileId
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
0, // width (optional)
0, // height (optional)
ImageGravity.CENTER, // gravity (optional)
+2 -2
View File
@@ -9,8 +9,8 @@ Client client = new Client(context)
Storage storage = new Storage(client);
storage.getFileView(
"[BUCKET_ID]", // bucketId
"[FILE_ID]", // fileId
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+2 -2
View File
@@ -9,8 +9,8 @@ Client client = new Client(context)
Storage storage = new Storage(client);
storage.getFile(
"[BUCKET_ID]", // bucketId
"[FILE_ID]", // fileId
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+2 -2
View File
@@ -9,9 +9,9 @@ Client client = new Client(context)
Storage storage = new Storage(client);
storage.listFiles(
"[BUCKET_ID]", // bucketId
"<BUCKET_ID>", // bucketId
listOf(), // queries (optional)
"[SEARCH]", // search (optional)
"<SEARCH>", // search (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+3 -3
View File
@@ -9,9 +9,9 @@ Client client = new Client(context)
Storage storage = new Storage(client);
storage.updateFile(
"[BUCKET_ID]", // bucketId
"[FILE_ID]", // fileId
"[NAME]", // name (optional)
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
"<NAME>", // name (optional)
listOf("read("any")"), // permissions (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -9,13 +9,13 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.createMembership(
"[TEAM_ID]", // teamId
"<TEAM_ID>", // teamId
listOf(), // roles
"email@example.com", // email (optional)
"[USER_ID]", // userId (optional)
"<USER_ID>", // userId (optional)
"+12065550100", // phone (optional)
"https://example.com", // url (optional)
"[NAME]", // name (optional)
"<NAME>", // name (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+2 -2
View File
@@ -9,8 +9,8 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.create(
"[TEAM_ID]", // teamId
"[NAME]", // name
"<TEAM_ID>", // teamId
"<NAME>", // name
listOf(), // roles (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -9,8 +9,8 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.deleteMembership(
"[TEAM_ID]", // teamId
"[MEMBERSHIP_ID]", // membershipId
"<TEAM_ID>", // teamId
"<MEMBERSHIP_ID>", // membershipId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.delete(
"[TEAM_ID]", // teamId
"<TEAM_ID>", // teamId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+2 -2
View File
@@ -9,8 +9,8 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.getMembership(
"[TEAM_ID]", // teamId
"[MEMBERSHIP_ID]", // membershipId
"<TEAM_ID>", // teamId
"<MEMBERSHIP_ID>", // membershipId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.getPrefs(
"[TEAM_ID]", // teamId
"<TEAM_ID>", // teamId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.get(
"[TEAM_ID]", // teamId
"<TEAM_ID>", // teamId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+2 -2
View File
@@ -9,9 +9,9 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.listMemberships(
"[TEAM_ID]", // teamId
"<TEAM_ID>", // teamId
listOf(), // queries (optional)
"[SEARCH]", // search (optional)
"<SEARCH>", // search (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -10,7 +10,7 @@ Teams teams = new Teams(client);
teams.list(
listOf(), // queries (optional)
"[SEARCH]", // search (optional)
"<SEARCH>", // search (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,10 +9,10 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.updateMembershipStatus(
"[TEAM_ID]", // teamId
"[MEMBERSHIP_ID]", // membershipId
"[USER_ID]", // userId
"[SECRET]", // secret
"<TEAM_ID>", // teamId
"<MEMBERSHIP_ID>", // membershipId
"<USER_ID>", // userId
"<SECRET>", // secret
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -9,8 +9,8 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.updateMembership(
"[TEAM_ID]", // teamId
"[MEMBERSHIP_ID]", // membershipId
"<TEAM_ID>", // teamId
"<MEMBERSHIP_ID>", // membershipId
listOf(), // roles
new CoroutineCallback<>((result, error) -> {
if (error != null) {
+2 -2
View File
@@ -9,8 +9,8 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.updateName(
"[TEAM_ID]", // teamId
"[NAME]", // name
"<TEAM_ID>", // teamId
"<NAME>", // name
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
+1 -1
View File
@@ -9,7 +9,7 @@ Client client = new Client(context)
Teams teams = new Teams(client);
teams.updatePrefs(
"[TEAM_ID]", // teamId
"<TEAM_ID>", // teamId
mapOf( "a" to "b" ), // prefs
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val response = account.create2FAChallenge(
val response = account.createChallenge(
factor = AuthenticationFactor.TOTP,
)
@@ -9,7 +9,7 @@ val client = Client(context)
val account = Account(client)
val response = account.createEmailToken(
userId = "[USER_ID]",
userId = "<USER_ID>",
email = "email@example.com",
phrase = false, // (optional)
)
@@ -9,7 +9,7 @@ val client = Client(context)
val account = Account(client)
val response = account.createMagicURLToken(
userId = "[USER_ID]",
userId = "<USER_ID>",
email = "email@example.com",
url = "https://example.com", // (optional)
phrase = false, // (optional)
@@ -13,6 +13,5 @@ account.createOAuth2Session(
provider = OAuthProvider.AMAZON,
success = "https://example.com", // (optional)
failure = "https://example.com", // (optional)
token = false, // (optional)
scopes = listOf(), // (optional)
)
@@ -0,0 +1,17 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Account
import io.appwrite.enums.OAuthProvider
val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
val account = Account(client)
account.createOAuth2Token(
provider = OAuthProvider.AMAZON,
success = "https://example.com", // (optional)
failure = "https://example.com", // (optional)
scopes = listOf(), // (optional)
)
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val response = account.createPhoneToken(
userId = "[USER_ID]",
userId = "<USER_ID>",
phone = "+12065550100",
)
@@ -9,7 +9,7 @@ val client = Client(context)
val account = Account(client)
val response = account.createPushTarget(
targetId = "[TARGET_ID]",
identifier = "[IDENTIFIER]",
providerId = "[PROVIDER_ID]", // (optional)
targetId = "<TARGET_ID>",
identifier = "<IDENTIFIER>",
providerId = "<PROVIDER_ID>", // (optional)
)
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val response = account.createSession(
userId = "[USER_ID]",
secret = "[SECRET]",
userId = "<USER_ID>",
secret = "<SECRET>",
)
+2 -2
View File
@@ -9,8 +9,8 @@ val client = Client(context)
val account = Account(client)
val response = account.create(
userId = "[USER_ID]",
userId = "<USER_ID>",
email = "email@example.com",
password = "",
name = "[NAME]", // (optional)
name = "<NAME>", // (optional)
)
@@ -11,5 +11,5 @@ val account = Account(client)
val response = account.deleteAuthenticator(
type = AuthenticatorType.TOTP,
otp = "[OTP]",
otp = "<OTP>",
)
@@ -9,5 +9,5 @@ val client = Client(context)
val account = Account(client)
val response = account.deleteIdentity(
identityId = "[IDENTITY_ID]",
identityId = "<IDENTITY_ID>",
)
@@ -9,5 +9,5 @@ val client = Client(context)
val account = Account(client)
val response = account.deletePushTarget(
targetId = "[TARGET_ID]",
targetId = "<TARGET_ID>",
)
@@ -9,5 +9,5 @@ val client = Client(context)
val account = Account(client)
val response = account.deleteSession(
sessionId = "[SESSION_ID]",
sessionId = "<SESSION_ID>",
)
+1 -1
View File
@@ -9,5 +9,5 @@ val client = Client(context)
val account = Account(client)
val response = account.getSession(
sessionId = "[SESSION_ID]",
sessionId = "<SESSION_ID>",
)
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val response = account.updateChallenge(
challengeId = "[CHALLENGE_ID]",
otp = "[OTP]",
challengeId = "<CHALLENGE_ID>",
otp = "<OTP>",
)
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val response = account.updateMagicURLSession(
userId = "[USER_ID]",
secret = "[SECRET]",
userId = "<USER_ID>",
secret = "<SECRET>",
)
+1 -1
View File
@@ -9,5 +9,5 @@ val client = Client(context)
val account = Account(client)
val response = account.updateName(
name = "[NAME]",
name = "<NAME>",
)
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val response = account.updatePhoneVerification(
userId = "[USER_ID]",
secret = "[SECRET]",
userId = "<USER_ID>",
secret = "<SECRET>",
)
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val response = account.updatePushTarget(
targetId = "[TARGET_ID]",
identifier = "[IDENTIFIER]",
targetId = "<TARGET_ID>",
identifier = "<IDENTIFIER>",
)
@@ -9,7 +9,7 @@ val client = Client(context)
val account = Account(client)
val response = account.updateRecovery(
userId = "[USER_ID]",
secret = "[SECRET]",
userId = "<USER_ID>",
secret = "<SECRET>",
password = "",
)
@@ -9,5 +9,5 @@ val client = Client(context)
val account = Account(client)
val response = account.updateSession(
sessionId = "[SESSION_ID]",
sessionId = "<SESSION_ID>",
)
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val response = account.updateVerification(
userId = "[USER_ID]",
secret = "[SECRET]",
userId = "<USER_ID>",
secret = "<SECRET>",
)
@@ -11,5 +11,5 @@ val account = Account(client)
val response = account.verifyAuthenticator(
type = AuthenticatorType.TOTP,
otp = "[OTP]",
otp = "<OTP>",
)
+1 -1
View File
@@ -9,7 +9,7 @@ val client = Client(context)
val avatars = Avatars(client)
val result =avatars.getInitials(
name = "[NAME]", // (optional)
name = "<NAME>", // (optional)
width = 0, // (optional)
height = 0, // (optional)
background = "", // (optional)
+1 -1
View File
@@ -9,7 +9,7 @@ val client = Client(context)
val avatars = Avatars(client)
val result =avatars.getQR(
text = "[TEXT]",
text = "<TEXT>",
size = 1, // (optional)
margin = 0, // (optional)
download = false, // (optional)
@@ -9,9 +9,9 @@ val client = Client(context)
val databases = Databases(client)
val response = databases.createDocument(
databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
documentId = "[DOCUMENT_ID]",
databaseId = "<DATABASE_ID>",
collectionId = "<COLLECTION_ID>",
documentId = "<DOCUMENT_ID>",
data = mapOf( "a" to "b" ),
permissions = listOf("read("any")"), // (optional)
)
@@ -9,7 +9,7 @@ val client = Client(context)
val databases = Databases(client)
val response = databases.deleteDocument(
databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
documentId = "[DOCUMENT_ID]",
databaseId = "<DATABASE_ID>",
collectionId = "<COLLECTION_ID>",
documentId = "<DOCUMENT_ID>",
)
@@ -9,8 +9,8 @@ val client = Client(context)
val databases = Databases(client)
val response = databases.getDocument(
databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
documentId = "[DOCUMENT_ID]",
databaseId = "<DATABASE_ID>",
collectionId = "<COLLECTION_ID>",
documentId = "<DOCUMENT_ID>",
queries = listOf(), // (optional)
)
@@ -9,7 +9,7 @@ val client = Client(context)
val databases = Databases(client)
val response = databases.listDocuments(
databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
databaseId = "<DATABASE_ID>",
collectionId = "<COLLECTION_ID>",
queries = listOf(), // (optional)
)
@@ -9,9 +9,9 @@ val client = Client(context)
val databases = Databases(client)
val response = databases.updateDocument(
databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
documentId = "[DOCUMENT_ID]",
databaseId = "<DATABASE_ID>",
collectionId = "<COLLECTION_ID>",
documentId = "<DOCUMENT_ID>",
data = mapOf( "a" to "b" ), // (optional)
permissions = listOf("read("any")"), // (optional)
)
@@ -9,10 +9,10 @@ val client = Client(context)
val functions = Functions(client)
val response = functions.createExecution(
functionId = "[FUNCTION_ID]",
body = "[BODY]", // (optional)
functionId = "<FUNCTION_ID>",
body = "<BODY>", // (optional)
async = false, // (optional)
path = "[PATH]", // (optional)
path = "<PATH>", // (optional)
method = ExecutionMethod.GET, // (optional)
headers = mapOf( "a" to "b" ), // (optional)
)
@@ -9,6 +9,6 @@ val client = Client(context)
val functions = Functions(client)
val response = functions.getExecution(
functionId = "[FUNCTION_ID]",
executionId = "[EXECUTION_ID]",
functionId = "<FUNCTION_ID>",
executionId = "<EXECUTION_ID>",
)
@@ -9,7 +9,7 @@ val client = Client(context)
val functions = Functions(client)
val response = functions.listExecutions(
functionId = "[FUNCTION_ID]",
functionId = "<FUNCTION_ID>",
queries = listOf(), // (optional)
search = "[SEARCH]", // (optional)
search = "<SEARCH>", // (optional)
)
@@ -9,7 +9,7 @@ val client = Client(context)
val messaging = Messaging(client)
val response = messaging.createSubscriber(
topicId = "[TOPIC_ID]",
subscriberId = "[SUBSCRIBER_ID]",
targetId = "[TARGET_ID]",
topicId = "<TOPIC_ID>",
subscriberId = "<SUBSCRIBER_ID>",
targetId = "<TARGET_ID>",
)
@@ -9,6 +9,6 @@ val client = Client(context)
val messaging = Messaging(client)
val response = messaging.deleteSubscriber(
topicId = "[TOPIC_ID]",
subscriberId = "[SUBSCRIBER_ID]",
topicId = "<TOPIC_ID>",
subscriberId = "<SUBSCRIBER_ID>",
)
+2 -2
View File
@@ -10,8 +10,8 @@ val client = Client(context)
val storage = Storage(client)
val response = storage.createFile(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
bucketId = "<BUCKET_ID>",
fileId = "<FILE_ID>",
file = InputFile.fromPath("file.png"),
permissions = listOf("read("any")"), // (optional)
)
+2 -2
View File
@@ -9,6 +9,6 @@ val client = Client(context)
val storage = Storage(client)
val response = storage.deleteFile(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
bucketId = "<BUCKET_ID>",
fileId = "<FILE_ID>",
)
@@ -9,6 +9,6 @@ val client = Client(context)
val storage = Storage(client)
val result =storage.getFileDownload(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
bucketId = "<BUCKET_ID>",
fileId = "<FILE_ID>",
)
@@ -9,8 +9,8 @@ val client = Client(context)
val storage = Storage(client)
val result =storage.getFilePreview(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
bucketId = "<BUCKET_ID>",
fileId = "<FILE_ID>",
width = 0, // (optional)
height = 0, // (optional)
gravity = ImageGravity.CENTER, // (optional)
@@ -9,6 +9,6 @@ val client = Client(context)
val storage = Storage(client)
val result =storage.getFileView(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
bucketId = "<BUCKET_ID>",
fileId = "<FILE_ID>",
)
+2 -2
View File
@@ -9,6 +9,6 @@ val client = Client(context)
val storage = Storage(client)
val response = storage.getFile(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
bucketId = "<BUCKET_ID>",
fileId = "<FILE_ID>",
)
+2 -2
View File
@@ -9,7 +9,7 @@ val client = Client(context)
val storage = Storage(client)
val response = storage.listFiles(
bucketId = "[BUCKET_ID]",
bucketId = "<BUCKET_ID>",
queries = listOf(), // (optional)
search = "[SEARCH]", // (optional)
search = "<SEARCH>", // (optional)
)

Some files were not shown because too many files have changed in this diff Show More