Repository navigation
feat: API specs update for version 2.3.x #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
examples/2.3.x/client-android/java/account/create-anonymous-session.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createAnonymousSession(new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| })); | ||
| ``` |
27 changes: 27 additions & 0 deletions
27
examples/2.3.x/client-android/java/account/create-email-password-session.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createEmailPasswordSession( | ||
| "email@example.com", // email | ||
| "password", // password | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
28 changes: 28 additions & 0 deletions
28
examples/2.3.x/client-android/java/account/create-email-token.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createEmailToken( | ||
| "<USER_ID>", // userId | ||
| "email@example.com", // email | ||
| false, // phrase (optional) | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
26 changes: 26 additions & 0 deletions
26
examples/2.3.x/client-android/java/account/create-email-verification-otp.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createEmailVerificationOTP( | ||
| false, // phrase (optional) | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
26 changes: 26 additions & 0 deletions
26
examples/2.3.x/client-android/java/account/create-email-verification.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createEmailVerification( | ||
| "https://example.com", // url | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
32 changes: 32 additions & 0 deletions
32
examples/2.3.x/client-android/java/account/create-id-token-session.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
| import io.appwrite.enums.IdTokenProvider; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createIdTokenSession( | ||
| IdTokenProvider.APPLE, // provider | ||
| "<ID_TOKEN>", // idToken | ||
| "<NONCE>", // nonce (optional) | ||
| "<ACCESS_TOKEN>", // accessToken (optional) | ||
| 0, // accessTokenExpiry (optional) | ||
| "<NAME>", // name (optional) | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createJWT( | ||
| 0, // duration (optional) | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
29 changes: 29 additions & 0 deletions
29
examples/2.3.x/client-android/java/account/create-magic-url-token.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createMagicURLToken( | ||
| "<USER_ID>", // userId | ||
| "email@example.com", // email | ||
| "https://example.com", // url (optional) | ||
| false, // phrase (optional) | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
27 changes: 27 additions & 0 deletions
27
examples/2.3.x/client-android/java/account/create-mfa-authenticator.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
| import io.appwrite.enums.AuthenticatorType; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createMFAAuthenticator( | ||
| AuthenticatorType.TOTP, // type | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
27 changes: 27 additions & 0 deletions
27
examples/2.3.x/client-android/java/account/create-mfa-challenge.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
| import io.appwrite.enums.AuthenticationFactor; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createMFAChallenge( | ||
| AuthenticationFactor.EMAIL, // factor | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` |
22 changes: 22 additions & 0 deletions
22
examples/2.3.x/client-android/java/account/create-mfa-recovery-codes.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| import io.appwrite.Client; | ||
| import io.appwrite.coroutines.CoroutineCallback; | ||
| import io.appwrite.services.Account; | ||
|
|
||
| Client client = new Client(context) | ||
| .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| })); | ||
| ``` |
30 changes: 30 additions & 0 deletions
30
examples/2.3.x/client-android/java/account/create-o-auth-2-session.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| ```java | ||
| import android.util.Log; | ||
|
|
||
| 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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint | ||
| .setProject("<YOUR_PROJECT_ID>"); // Your project ID | ||
|
|
||
| Account account = new Account(client); | ||
|
|
||
| account.createOAuth2Session( | ||
| OAuthProvider.AMAZON, // provider | ||
| "https://example.com", // success (optional) | ||
| "https://example.com", // failure (optional) | ||
| List.of(), // scopes (optional) | ||
| new CoroutineCallback<>((result, error) -> { | ||
| if (error != null) { | ||
| error.printStackTrace(); | ||
| return; | ||
| } | ||
|
|
||
| Log.d("Appwrite", result.toString()); | ||
| }) | ||
| ); | ||
|
|
||
| ``` | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snippet calls
List.of()but does not importjava.util.List, so copying it into a Java or Android project fails to compile with an unresolved symbol. The same generator issue affects 266 new Java examples, including examples that useMap.of()without importingjava.util.Map; please update the generator templates to emit the required imports.Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid, but not new in 2.3.x: the published 2.2.x Java examples have the same missing
java.utilimports at about the same rate (123 vs 120 in a 400-file sample). The examples come from the sdk-generator Java templates, so the fix belongs there and will land in every version on the next regeneration. Not blocking this release.