Skip to content

Commit 02342a6

Browse files
authored
Merge pull request #42 from appwrite/feat-1.9.x-specs
feat: API specs update for version 1.9.x
2 parents 4c1bdd3 + 7bc9eb0 commit 02342a6

7,279 files changed

Lines changed: 457090 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
6+
Client client = new Client(context)
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createAnonymousSession(new CoroutineCallback<>((result, error) -> {
13+
if (error != null) {
14+
error.printStackTrace();
15+
return;
16+
}
17+
18+
Log.d("Appwrite", result.toString());
19+
}));
20+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
6+
Client client = new Client(context)
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createEmailPasswordSession(
13+
"email@example.com", // email
14+
"password", // password
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
Log.d("Appwrite", result.toString());
22+
})
23+
);
24+
25+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
6+
Client client = new Client(context)
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createEmailToken(
13+
"<USER_ID>", // userId
14+
"email@example.com", // email
15+
false, // phrase (optional)
16+
new CoroutineCallback<>((result, error) -> {
17+
if (error != null) {
18+
error.printStackTrace();
19+
return;
20+
}
21+
22+
Log.d("Appwrite", result.toString());
23+
})
24+
);
25+
26+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
6+
Client client = new Client(context)
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createEmailVerification(
13+
"https://example.com", // url
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
Log.d("Appwrite", result.toString());
21+
})
22+
);
23+
24+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
6+
Client client = new Client(context)
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createJWT(
13+
0, // duration (optional)
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
Log.d("Appwrite", result.toString());
21+
})
22+
);
23+
24+
```
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
6+
Client client = new Client(context)
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createMagicURLToken(
13+
"<USER_ID>", // userId
14+
"email@example.com", // email
15+
"https://example.com", // url (optional)
16+
false, // phrase (optional)
17+
new CoroutineCallback<>((result, error) -> {
18+
if (error != null) {
19+
error.printStackTrace();
20+
return;
21+
}
22+
23+
Log.d("Appwrite", result.toString());
24+
})
25+
);
26+
27+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
import io.appwrite.enums.AuthenticatorType;
6+
7+
Client client = new Client(context)
8+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
9+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
10+
11+
Account account = new Account(client);
12+
13+
account.createMFAAuthenticator(
14+
AuthenticatorType.TOTP, // type
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
Log.d("Appwrite", result.toString());
22+
})
23+
);
24+
25+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
import io.appwrite.enums.AuthenticationFactor;
6+
7+
Client client = new Client(context)
8+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
9+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
10+
11+
Account account = new Account(client);
12+
13+
account.createMFAChallenge(
14+
AuthenticationFactor.EMAIL, // factor
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
Log.d("Appwrite", result.toString());
22+
})
23+
);
24+
25+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
6+
Client client = new Client(context)
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createMFARecoveryCodes(new CoroutineCallback<>((result, error) -> {
13+
if (error != null) {
14+
error.printStackTrace();
15+
return;
16+
}
17+
18+
Log.d("Appwrite", result.toString());
19+
}));
20+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
```java
2+
import io.appwrite.Client;
3+
import io.appwrite.coroutines.CoroutineCallback;
4+
import io.appwrite.services.Account;
5+
import io.appwrite.enums.OAuthProvider;
6+
7+
Client client = new Client(context)
8+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
9+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
10+
11+
Account account = new Account(client);
12+
13+
account.createOAuth2Session(
14+
OAuthProvider.AMAZON, // provider
15+
"https://example.com", // success (optional)
16+
"https://example.com", // failure (optional)
17+
List.of(), // scopes (optional)
18+
new CoroutineCallback<>((result, error) -> {
19+
if (error != null) {
20+
error.printStackTrace();
21+
return;
22+
}
23+
24+
Log.d("Appwrite", result.toString());
25+
})
26+
);
27+
28+
```

0 commit comments

Comments
 (0)