Skip to content

Commit 88635b8

Browse files
Merge pull request #8 from appwrite/dev
feat(general): updates for 0.9
2 parents 5d6a382 + 08c3291 commit 88635b8

File tree

190 files changed

+3401
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+3401
-20
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.createRecovery(
12+
13+
"https://example.com"
14+
new Continuation<Object>() {
15+
@NotNull
16+
@Override
17+
public CoroutineContext getContext() {
18+
return EmptyCoroutineContext.INSTANCE;
19+
}
20+
21+
@Override
22+
public void resumeWith(@NotNull Object o) {
23+
String json = "";
24+
try {
25+
if (o instanceof Result.Failure) {
26+
Result.Failure failure = (Result.Failure) o;
27+
throw failure.exception;
28+
} else {
29+
Response response = (Response) o;
30+
}
31+
} catch (Throwable th) {
32+
Log.e("ERROR", th.toString());
33+
}
34+
}
35+
}
36+
);
37+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.createVerification(
12+
"https://example.com"
13+
new Continuation<Object>() {
14+
@NotNull
15+
@Override
16+
public CoroutineContext getContext() {
17+
return EmptyCoroutineContext.INSTANCE;
18+
}
19+
20+
@Override
21+
public void resumeWith(@NotNull Object o) {
22+
String json = "";
23+
try {
24+
if (o instanceof Result.Failure) {
25+
Result.Failure failure = (Result.Failure) o;
26+
throw failure.exception;
27+
} else {
28+
Response response = (Response) o;
29+
}
30+
} catch (Throwable th) {
31+
Log.e("ERROR", th.toString());
32+
}
33+
}
34+
}
35+
);
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.deleteSession(
12+
"[SESSION_ID]"
13+
new Continuation<Object>() {
14+
@NotNull
15+
@Override
16+
public CoroutineContext getContext() {
17+
return EmptyCoroutineContext.INSTANCE;
18+
}
19+
20+
@Override
21+
public void resumeWith(@NotNull Object o) {
22+
String json = "";
23+
try {
24+
if (o instanceof Result.Failure) {
25+
Result.Failure failure = (Result.Failure) o;
26+
throw failure.exception;
27+
} else {
28+
Response response = (Response) o;
29+
}
30+
} catch (Throwable th) {
31+
Log.e("ERROR", th.toString());
32+
}
33+
}
34+
}
35+
);
36+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.deleteSessions(new Continuation<Object>() {
12+
@NotNull
13+
@Override
14+
public CoroutineContext getContext() {
15+
return EmptyCoroutineContext.INSTANCE;
16+
}
17+
18+
@Override
19+
public void resumeWith(@NotNull Object o) {
20+
String json = "";
21+
try {
22+
if (o instanceof Result.Failure) {
23+
Result.Failure failure = (Result.Failure) o;
24+
throw failure.exception;
25+
} else {
26+
Response response = (Response) o;
27+
}
28+
} catch (Throwable th) {
29+
Log.e("ERROR", th.toString());
30+
}
31+
}
32+
});
33+
}

docs/examples/java/account/delete.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.delete(new Continuation<Object>() {
12+
@NotNull
13+
@Override
14+
public CoroutineContext getContext() {
15+
return EmptyCoroutineContext.INSTANCE;
16+
}
17+
18+
@Override
19+
public void resumeWith(@NotNull Object o) {
20+
String json = "";
21+
try {
22+
if (o instanceof Result.Failure) {
23+
Result.Failure failure = (Result.Failure) o;
24+
throw failure.exception;
25+
} else {
26+
Response response = (Response) o;
27+
}
28+
} catch (Throwable th) {
29+
Log.e("ERROR", th.toString());
30+
}
31+
}
32+
});
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.getLogs(new Continuation<Object>() {
12+
@NotNull
13+
@Override
14+
public CoroutineContext getContext() {
15+
return EmptyCoroutineContext.INSTANCE;
16+
}
17+
18+
@Override
19+
public void resumeWith(@NotNull Object o) {
20+
String json = "";
21+
try {
22+
if (o instanceof Result.Failure) {
23+
Result.Failure failure = (Result.Failure) o;
24+
throw failure.exception;
25+
} else {
26+
Response response = (Response) o;
27+
}
28+
} catch (Throwable th) {
29+
Log.e("ERROR", th.toString());
30+
}
31+
}
32+
});
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.getPrefs(new Continuation<Object>() {
12+
@NotNull
13+
@Override
14+
public CoroutineContext getContext() {
15+
return EmptyCoroutineContext.INSTANCE;
16+
}
17+
18+
@Override
19+
public void resumeWith(@NotNull Object o) {
20+
String json = "";
21+
try {
22+
if (o instanceof Result.Failure) {
23+
Result.Failure failure = (Result.Failure) o;
24+
throw failure.exception;
25+
} else {
26+
Response response = (Response) o;
27+
}
28+
} catch (Throwable th) {
29+
Log.e("ERROR", th.toString());
30+
}
31+
}
32+
});
33+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.getSession(
12+
"[SESSION_ID]"
13+
new Continuation<Object>() {
14+
@NotNull
15+
@Override
16+
public CoroutineContext getContext() {
17+
return EmptyCoroutineContext.INSTANCE;
18+
}
19+
20+
@Override
21+
public void resumeWith(@NotNull Object o) {
22+
String json = "";
23+
try {
24+
if (o instanceof Result.Failure) {
25+
Result.Failure failure = (Result.Failure) o;
26+
throw failure.exception;
27+
} else {
28+
Response response = (Response) o;
29+
}
30+
} catch (Throwable th) {
31+
Log.e("ERROR", th.toString());
32+
}
33+
}
34+
}
35+
);
36+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.getSessions(new Continuation<Object>() {
12+
@NotNull
13+
@Override
14+
public CoroutineContext getContext() {
15+
return EmptyCoroutineContext.INSTANCE;
16+
}
17+
18+
@Override
19+
public void resumeWith(@NotNull Object o) {
20+
String json = "";
21+
try {
22+
if (o instanceof Result.Failure) {
23+
Result.Failure failure = (Result.Failure) o;
24+
throw failure.exception;
25+
} else {
26+
Response response = (Response) o;
27+
}
28+
} catch (Throwable th) {
29+
Log.e("ERROR", th.toString());
30+
}
31+
}
32+
});
33+
}

docs/examples/java/account/get.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.get(new Continuation<Object>() {
12+
@NotNull
13+
@Override
14+
public CoroutineContext getContext() {
15+
return EmptyCoroutineContext.INSTANCE;
16+
}
17+
18+
@Override
19+
public void resumeWith(@NotNull Object o) {
20+
String json = "";
21+
try {
22+
if (o instanceof Result.Failure) {
23+
Result.Failure failure = (Result.Failure) o;
24+
throw failure.exception;
25+
} else {
26+
Response response = (Response) o;
27+
}
28+
} catch (Throwable th) {
29+
Log.e("ERROR", th.toString());
30+
}
31+
}
32+
});
33+
}

0 commit comments

Comments
 (0)